]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore::_collection_move_rename: handle missing dst dir on replay
authorSamuel Just <sam.just@inktank.com>
Mon, 4 Nov 2013 19:25:31 +0000 (11:25 -0800)
committerSamuel Just <sam.just@inktank.com>
Tue, 5 Nov 2013 04:33:56 +0000 (20:33 -0800)
In case of a replay, a missing destination directory indicates that
the destination object and directory have been removed by a later
transaction.  Thus, we need to remove the src object and return
0.

Fixes: #6714
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/os/FileStore.cc

index ffac501aaf20d78394af99489a3b7bce0ed29407..89a55b393db7cfa872ca2b69ea27ae8fd1b30d92 100644 (file)
@@ -4273,6 +4273,14 @@ int FileStore::_collection_move_rename(coll_t oldcid, const ghobject_t& oldoid,
   int r = 0;
   int dstcmp, srccmp;
 
+  if (replaying) {
+    /* If the destination collection doesn't exist during replay,
+     * we need to delete the src object and continue on
+     */
+    if (!collection_exists(c))
+      goto out_rm_src;
+  }
+
   dstcmp = _check_replay_guard(c, o, spos);
   if (dstcmp < 0)
     goto out_rm_src;