summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_op.cc
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2022-07-26 18:29:08 +0200
committerCasey Bodley <cbodley@redhat.com>2023-11-06 17:07:23 +0100
commit59708637fac2dc5b036b81fb3df7b0eaebdac7c3 (patch)
tree11cf7b3c11511ea54c0529683a6f6efb9eb74382 /src/rgw/rgw_op.cc
parentrgw: don't use other zone's shard count for forwarded CreateBucket requests (diff)
downloadceph-59708637fac2dc5b036b81fb3df7b0eaebdac7c3.tar.xz
ceph-59708637fac2dc5b036b81fb3df7b0eaebdac7c3.zip
rgw: RGWBulkDelete calls forward_to_master before remove_bucket()
fix the path of the forwarded request the same way that RGWBulkUpload does, and call forward_request_to_master() before remove_bucket() Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_op.cc')
-rw-r--r--src/rgw/rgw_op.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc
index 8d2f564b8e3..32416457213 100644
--- a/src/rgw/rgw_op.cc
+++ b/src/rgw/rgw_op.cc
@@ -7322,7 +7322,7 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path, optional_yie
goto auth_fail;
}
- if (!path.obj_key.empty()) {
+ if (!path.obj_key.empty()) { // object deletion
ACLOwner bucket_owner;
bucket_owner.set_id(bucket->get_info().owner);
@@ -7338,8 +7338,20 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path, optional_yie
if (ret < 0) {
goto delop_fail;
}
- } else {
- ret = bucket->remove_bucket(dpp, false, true, &s->info, s->yield);
+ } else { // bucket deletion
+ if (!driver->is_meta_master()) {
+ // apply bucket deletion on the master zone first
+ req_info req = s->info;
+ forward_req_info(dpp, s->cct, req, path.bucket_name);
+
+ bufferlist data;
+ ret = driver->forward_request_to_master(dpp, s->user.get(), nullptr,
+ data, nullptr, req, y);
+ if (ret < 0) {
+ goto delop_fail;
+ }
+ }
+ ret = bucket->remove_bucket(dpp, false, false, nullptr, s->yield);
if (ret < 0) {
goto delop_fail;
}