]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix a journal replay issue with collection_add()
authorJoao Eduardo Luis <jecluis@gmail.com>
Thu, 26 Apr 2012 23:31:55 +0000 (00:31 +0100)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 26 Apr 2012 23:36:03 +0000 (16:36 -0700)
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
src/os/FileStore.cc

index 3611e5befaf0c18a52b3bc967906644bbfe34c6a..8c11d6b8647093019762244e4c08caf71fd21656 100644 (file)
@@ -4599,6 +4599,14 @@ int FileStore::_collection_add(coll_t c, coll_t oldcid, const hobject_t& o,
   // open guard on object so we don't any previous operations on the
   // new name that will modify the source inode.
   int fd = lfn_open(oldcid, o, 0);
+  if (fd < 0) {
+    // the source collection/object does not exist. If we are replaying, we
+    // should be safe, so just return 0 and move on.
+    assert(replaying);
+    dout(10) << "collection_add " << c << "/" << o << " from "
+        << oldcid << "/" << o << " (dne, continue replay) " << dendl;
+    return 0;
+  }
   assert(fd >= 0);
   if (dstcmp > 0) {      // if dstcmp == 0 the guard already says "in-progress"
     _set_replay_guard(fd, spos, true);