]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWSetRequestPayment request should be forwarded to master zone
authorChang Liu <liuchang0812@gmail.com>
Tue, 28 May 2019 09:08:11 +0000 (17:08 +0800)
committerChang Liu <liuchang0812@gmail.com>
Tue, 28 May 2019 09:08:11 +0000 (17:08 +0800)
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index 3a83d61e9ffaa9883e25fb2cd4501ef0c4b745a4..be741be6d4479518ee962daeeccc6deed089796e 100644 (file)
@@ -5456,6 +5456,15 @@ void RGWSetRequestPayment::pre_exec()
 
 void RGWSetRequestPayment::execute()
 {
+
+  if (!store->svc.zone->is_meta_master()) {
+    op_ret = forward_request_to_master(s, nullptr, store, in_data, nullptr);
+    if (op_ret < 0) {
+      ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl;
+      return;
+    }
+  }
+
   op_ret = get_params();
 
   if (op_ret < 0)
index 912cf3c3719601f282d1e629f0c550517b8f9d21..463a2b90838ba2f46a72d47c5fb7c131e0c3c612 100644 (file)
@@ -1596,6 +1596,7 @@ public:
 class RGWSetRequestPayment : public RGWOp {
 protected:
   bool requester_pays;
+  bufferlist in_data;
 public:
  RGWSetRequestPayment() : requester_pays(false) {}
 
index acb7b308fa63354829224fa5a31c8a83a96324d3..b0533a5486656800b4a02991890855f57605fc3d 100644 (file)
@@ -2602,6 +2602,8 @@ int RGWSetRequestPayment_ObjStore_S3::get_params()
     return r;
   }
 
+  in_data.append(data);
+
   RGWSetRequestPaymentParser parser;
 
   if (!parser.init()) {