]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore::_split_collection: src or dest may be removed on replay
authorSamuel Just <sam.just@inktank.com>
Wed, 24 Apr 2013 21:23:45 +0000 (14:23 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 24 Apr 2013 22:05:41 +0000 (15:05 -0700)
If the collection is subsequently removed, the _split_collection
might get replayed and find either src or dest removed.

Fixes: #4806
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc

index bc758b8591b22df4f5ecb1b8003aa2ab2f710fe9..484d074be8b92123d1a415b0de8001dc0f3601ac 100644 (file)
@@ -4786,6 +4786,17 @@ int FileStore::_split_collection(coll_t cid,
   int r;
   {
     dout(15) << __func__ << " " << cid << " bits: " << bits << dendl;
+    if (!collection_exists(cid)) {
+      dout(2) << __func__ << ": " << cid << " DNE" << dendl;
+      assert(replaying);
+      return 0;
+    }
+    if (!collection_exists(dest)) {
+      dout(2) << __func__ << ": " << dest << " DNE" << dendl;
+      assert(replaying);
+      return 0;
+    }
+
     int dstcmp = _check_replay_guard(dest, spos);
     if (dstcmp < 0)
       return 0;