From 29fae494d0b1459c8bb934d42446e0ada7355402 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 25 Nov 2012 14:27:23 -0800 Subject: [PATCH] osd: do not ENOENT on missing key on remove The MDS may include RM ops in a tmap update for items that were already removed: after restarting and replaying the journal, it doesn't know which dentries were previously committed and which were not. No other (known) users care about the error code. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 3 --- src/test/librados/misc.cc | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 6320e3d8da4ff..2990822a98c3d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1839,9 +1839,6 @@ int ReplicatedPG::do_tmapup(OpContext *ctx, bufferlist::iterator& bp, OSDOp& osd dout(20) << " create " << key << " " << val.length() << dendl; nkeys++; } else if (op == CEPH_OSD_TMAP_RM) { - if (!key_exists) { - return -ENOENT; - } // do nothing. } } diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc index 43dd5d474087b..7f717bb43f2f9 100644 --- a/src/test/librados/misc.cc +++ b/src/test/librados/misc.cc @@ -130,7 +130,7 @@ TEST(LibRadosMisc, TmapUpdatePP) { // remove key1 from tmap ASSERT_EQ(0, remove_key_from_tmap(ioctx, "foo", "key1")); - ASSERT_EQ(-ENOENT, remove_key_from_tmap(ioctx, "foo", "key1")); + ASSERT_EQ(0, remove_key_from_tmap(ioctx, "foo", "key1")); // key should be removed ASSERT_EQ(string(""), read_key_from_tmap(ioctx, "foo", "key1")); -- 2.39.5