]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: order rmdir in remove_collection after deleting dir contents
authorSage Weil <sage@newdream.net>
Mon, 8 Feb 2010 19:57:52 +0000 (11:57 -0800)
committerSage Weil <sage@newdream.net>
Tue, 9 Feb 2010 16:09:21 +0000 (08:09 -0800)
src/osd/OSD.cc

index 50eddad1e2533db782ee5d43a8d836024f887612..74f599742e96b28ba811ba750f1112a44bd9aca9 100644 (file)
@@ -3511,6 +3511,8 @@ void OSD::_remove_pg(PG *pg)
 
   int n = 0;
 
+  ObjectStore::Transaction *rmt = new ObjectStore::Transaction;
+
   // snap collections
   for (set<snapid_t>::iterator p = pg->snap_collections.begin();
        p != pg->snap_collections.end();
@@ -3537,10 +3539,7 @@ void OSD::_remove_pg(PG *pg)
        }
       }
     }
-    ObjectStore::Transaction *t = new ObjectStore::Transaction;
-    t->remove_collection(coll_t::build_snap_pg_coll(pgid, *p));
-    int tr = store->queue_transaction(t);
-    assert(tr == 0);
+    rmt->remove_collection(coll_t::build_snap_pg_coll(pgid, *p));
   }
 
   // (what remains of the) main collection
@@ -3567,6 +3566,10 @@ void OSD::_remove_pg(PG *pg)
   }
 
   pg->unlock();
+
+  dout(10) << "_remove_pg " << pgid << " flushing store" << dendl;
+  store->flush();
+  
   dout(10) << "_remove_pg " << pgid << " taking osd_lock" << dendl;
   osd_lock.Lock();
   pg->lock();
@@ -3580,9 +3583,8 @@ void OSD::_remove_pg(PG *pg)
   dout(10) << "_remove_pg " << pgid << " removing final" << dendl;
 
   {
-    ObjectStore::Transaction *t = new ObjectStore::Transaction;
-    t->remove_collection(coll_t::build_pg_coll(pgid));
-    int tr = store->queue_transaction(t);
+    rmt->remove_collection(coll_t::build_pg_coll(pgid));
+    int tr = store->queue_transaction(rmt);
     assert(tr == 0);
   }