]> 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)
committerJoao Eduardo Luis <jecluis@gmail.com>
Thu, 26 Apr 2012 23:31:55 +0000 (00:31 +0100)
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
src/os/FileStore.cc

index 8e32ba9805de54fedecc3ea75017f2b66a5e1949..2664bfb0da0d9e04a1e2f89914a47fdee34e508d 100644 (file)
@@ -4543,6 +4543,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);