]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/reshard: bucket reshard may race with bucket index update. 66553/head
authorShilpa Jagannath <smanjara@redhat.com>
Mon, 8 Dec 2025 17:48:53 +0000 (12:48 -0500)
committerShilpa Jagannath <smanjara@redhat.com>
Mon, 8 Dec 2025 19:11:16 +0000 (14:11 -0500)
guard_reshard() serves as a wrapper to protect bucket index operations
against concurrent resharding. but it only handles -ERR_BUSY_RESHARDING
if bucket index update is already in progress with bucket shard
assigned, and a concurrent resharding operation deletes this old shard
object, there may be a window of operations targeting the old shards
failing with -ENOENT. this error is not caught anywhere in the calling
functions. as a result we could end up with objects in an inconsistent state.

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index 4e861f937767dfd3e77a541d72dd62101344a6cb..a1dac761cd9d675428a9b02acf3874036762877d 100644 (file)
@@ -7974,6 +7974,12 @@ int RGWRados::Bucket::UpdateIndex::guard_reshard(const DoutPrefixProvider *dpp,
     }
 
     r = call(bs);
+    if (r == -ENOENT) {
+      ldpp_dout(dpp, 10) << "ENOENT in guard_reshard(), likely bucket resharding, retrying" << dendl;
+      invalidate_bs();
+      continue;
+    }
+
     if (r != -ERR_BUSY_RESHARDING) {
       break;
     }
@@ -8678,6 +8684,10 @@ int RGWRados::guard_reshard(const DoutPrefixProvider *dpp,
     }
 
     r = call(bs);
+    if (r == -ENOENT) {
+      ldpp_dout(dpp, 10) << "ENOENT in guard_reshard(), likely bucket resharding, retrying" << dendl;
+      continue;
+    }
     if (r != -ERR_BUSY_RESHARDING) {
       break;
     }