]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: flush previous operations to fs before collection list + destroy
authorSage Weil <sage@newdream.net>
Wed, 31 Aug 2011 22:43:41 +0000 (15:43 -0700)
committerSage Weil <sage@newdream.net>
Wed, 31 Aug 2011 23:24:39 +0000 (16:24 -0700)
We need to flush any prior ops to the fs before we can rely on
collection_list to return all the objects we need to delete.  If we miss
any, we will crash shortly after this when the rmdir(2) fails with
-ENOTEMPTY (as with #1471).

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc
src/osd/ReplicatedPG.cc

index 6f27edb9744f1d78abc592cf4846211e5b8e9424..95adc3ff8ac358de56d93215d84ef3e1c2a14393 100644 (file)
@@ -4494,6 +4494,10 @@ void OSD::_remove_pg(PG *pg)
     int tr = store->queue_transaction(&pg->osr, t);
     assert(tr == 0);
   }
+  
+  // flush all pg operations to the fs, so we can rely on
+  // collection_list below.
+  pg->osr.flush();
 
   int n = 0;
 
index 94947b73098f1d7500ea1d7f2374f4a3042f9aeb..1090df34851b1ea18ac092d6bd968767f5a45d03 100644 (file)
@@ -5083,6 +5083,10 @@ boost::statechart::result ReplicatedPG::RepColTrim::react(const SnapTrim&)
   coll_t col_to_trim(pg->info.pgid, snap_to_trim);
   to_trim.erase(snap_to_trim);
   
+  // flush all operations to fs so we can rely on collection_list
+  // below.
+  pg->osr.flush();
+
   vector<hobject_t> obs_to_trim;
   pg->osd->store->collection_list(col_to_trim, obs_to_trim);
   ObjectStore::Transaction *t = new ObjectStore::Transaction;