From 154ee0b0345482bdfdeb84b7d3b00dba71577d97 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 4 Nov 2013 11:25:31 -0800 Subject: [PATCH] FileStore::_collection_move_rename: handle missing dst dir on replay 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 Reviewed-by: Greg Farnum --- src/os/FileStore.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index ffac501aaf20d..89a55b393db7c 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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; -- 2.39.5