From 1ddec86e64089530b6a989dc807deb2aba331482 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 5 Mar 2014 12:50:43 -0800 Subject: [PATCH 1/2] FileStore::_collection_move_rename: propogate EEXIST Previously, an EEXIST would get masked by the subsequent clone operation. Signed-off-by: Samuel Just --- src/os/FileStore.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 43dea84e67b..f6c51b34596 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -4465,10 +4465,12 @@ int FileStore::_collection_move_rename(coll_t oldcid, const ghobject_t& oldoid, _inject_failure(); - // the name changed; link the omap content - r = object_map->clone(oldoid, o, &spos); - if (r == -ENOENT) - r = 0; + if (r == 0) { + // the name changed; link the omap content + r = object_map->clone(oldoid, o, &spos); + if (r == -ENOENT) + r = 0; + } _inject_failure(); From 8b3934fc0f8e8e69a60cd5d9dd0cc850d8f92010 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 5 Mar 2014 12:51:08 -0800 Subject: [PATCH 2/2] PGBackend::rollback_stash: remove the correct shard Fixes: #7616 Signed-off-by: Samuel Just --- src/osd/PGBackend.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index f6698a1864d..19f3d997d0d 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -235,7 +235,9 @@ void PGBackend::rollback_stash( version_t old_version, ObjectStore::Transaction *t) { assert(!hoid.is_temp()); - t->remove(coll, hoid); + t->remove( + coll, + ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard)); t->collection_move_rename( coll, ghobject_t(hoid, old_version, get_parent()->whoami_shard().shard),