From 461be1cd3d504af07dbd059e1a32255843ea572f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 4 Sep 2024 16:02:44 -0400 Subject: [PATCH] rgw/rados: guard against dir suggest during reshard no changes to the bucket index should be allowed while resharding. these rados ops are fire-and-forget, so we want to fail them until reshard completes. the next listing after that should resend the suggestions Signed-off-by: Casey Bodley --- src/rgw/driver/rados/rgw_rados.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 23c149574ae9c..b36220d4f1186 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -9756,6 +9756,8 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, for (auto& miter : updates) { if (miter.second.length()) { ObjectWriteOperation o; + o.assert_exists(); + cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING); cls_rgw_suggest_changes(o, miter.second); // we don't care if we lose suggested updates, send them off blindly AioCompletion *c = @@ -9991,6 +9993,8 @@ int RGWRados::cls_bucket_list_unordered(const DoutPrefixProvider *dpp, for (; miter != updates.end(); ++miter) { if (miter->second.length()) { ObjectWriteOperation o; + o.assert_exists(); + cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING); cls_rgw_suggest_changes(o, miter->second); // we don't care if we lose suggested updates, send them off blindly AioCompletion *c = librados::Rados::aio_create_completion(nullptr, nullptr);