]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: guard against dir suggest during reshard 59609/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 4 Sep 2024 20:02:44 +0000 (16:02 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 4 Sep 2024 20:02:46 +0000 (16:02 -0400)
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 <cbodley@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index 23c149574ae9c2dc1ee05d881ef5b5e62baa9eda..b36220d4f1186981db3b5d00aeb4a5bedd96fb17 100644 (file)
@@ -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 @@ check_updates:
   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);