From 8cd33e3a8ebf7c2aa796ec9f92d6b554c39ff705 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 19 Aug 2013 16:56:27 -0700 Subject: [PATCH] rgw: bucket meta remove don't overwrite entry point first Fixes: #6056 When removing a bucket metadata entry we first unlink the bucket and then we remove the bucket entrypoint object. Originally when unlinking the bucket we first overwrote the bucket entrypoint entry marking it as 'unlinked'. However, this is not really needed as we're just about to remove it. The original version triggered a bug, as we needed to propagate the new header version first (which we didn't do, so the subsequent bucket removal failed). Reviewed-by: Greg Farnum Signed-off-by: Yehuda Sadeh (cherry picked from commit 0373d749cea7d9b532069ba8ebca2f005b2c9f59) --- src/rgw/rgw_bucket.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 4c53dfe6eb1c2..28dda2f99c8c9 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1455,7 +1455,12 @@ public: if (ret < 0) return ret; - ret = rgw_unlink_bucket(store, be.owner, entry); + /* + * We're unlinking the bucket but we don't want to update the entrypoint here — we're removing + * it immediately and don't want to invalidate our cached objv_version or the bucket obj removal + * will incorrectly fail. + */ + ret = rgw_unlink_bucket(store, be.owner, entry, false); if (ret < 0) { lderr(store->ctx()) << "could not unlink bucket=" << entry << " owner=" << be.owner << dendl; } -- 2.39.5