Skip to content

Commit 461be1c

Browse files
committed
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 <[email protected]>
1 parent 4dc4e36 commit 461be1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9756,6 +9756,8 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp,
97569756
for (auto& miter : updates) {
97579757
if (miter.second.length()) {
97589758
ObjectWriteOperation o;
9759+
o.assert_exists();
9760+
cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
97599761
cls_rgw_suggest_changes(o, miter.second);
97609762
// we don't care if we lose suggested updates, send them off blindly
97619763
AioCompletion *c =
@@ -9991,6 +9993,8 @@ int RGWRados::cls_bucket_list_unordered(const DoutPrefixProvider *dpp,
99919993
for (; miter != updates.end(); ++miter) {
99929994
if (miter->second.length()) {
99939995
ObjectWriteOperation o;
9996+
o.assert_exists();
9997+
cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
99949998
cls_rgw_suggest_changes(o, miter->second);
99959999
// we don't care if we lose suggested updates, send them off blindly
999610000
AioCompletion *c = librados::Rados::aio_create_completion(nullptr, nullptr);

0 commit comments

Comments
 (0)