]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: the create_bucket forward request omits the 59960/head
authorShilpa Jagannath <smanjara@redhat.com>
Tue, 24 Sep 2024 21:12:02 +0000 (17:12 -0400)
committerShilpa Jagannath <smanjara@redhat.com>
Wed, 8 Jan 2025 17:19:00 +0000 (12:19 -0500)
the request body, thus missing some data if specified inside
CreateBucketConfiguration xml on the non-master zone.
also, now that we perform cksum validation against empty payloads,
such a request would fail with -ERR_AMZ_CONTENT_SHA256_MISMATCH due
to a zero content-length but a non-empty payload hash.
this fix ensures that request body is forwarded during create_bucket

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index b54805bdc7d4b64548c1ac1d49560c6f62b8f148..07f61ba60b4f756eaa5928bb20a10915ef8992ba 100644 (file)
@@ -3618,7 +3618,6 @@ void RGWCreateBucket::execute(optional_yield y)
 
   if (!driver->is_meta_master()) {
     // apply bucket creation on the master zone first
-    bufferlist in_data;
     JSONParser jp;
     op_ret = rgw_forward_request_to_master(this, *s->penv.site, s->owner.id,
                                            &in_data, &jp, s->info, y);
index 47a4c3da60958b709663f55b7bead94119be0468..eaf34da4edbbbf041e7beda93621f3faaae0bdaa 100644 (file)
@@ -1117,6 +1117,7 @@ class RGWCreateBucket : public RGWOp {
   bool relaxed_region_enforcement = false;
   RGWCORSConfiguration cors_config;
   std::set<std::string> rmattr_names;
+  bufferlist in_data;
 
   virtual bool need_metadata_upload() const { return false; }
 
index 4a50baf1cb20195b763828215bb9013898832a1b..4e5aca8cf30d536531315e4e3f889c61e515f7b9 100644 (file)
@@ -2492,6 +2492,10 @@ int RGWCreateBucket_ObjStore_S3::get_params(optional_yield y)
   if ((op_ret < 0) && (op_ret != -ERR_LENGTH_REQUIRED))
     return op_ret;
 
+  if (!driver->is_meta_master()) {
+    in_data.append(data);
+  }
+
   if (data.length()) {
     RGWCreateBucketParser parser;