]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #32476 from theanalyst/rgw/multisite/user-policy
authorAbhishek L <abhishek@suse.com>
Thu, 30 Jan 2020 11:50:02 +0000 (12:50 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 11:50:02 +0000 (12:50 +0100)
rgw: user policy: forward write requests to master zone

Reviewed-By: Casey Bodley <cbodley@redhat.com>
1  2 
src/rgw/rgw_rest_user_policy.cc

index aed374fbfa7cf63146703be26dd285ea95561b90,356ea9883bea60e937c49226a9311011bd5bba0a..6a73a67fd9e829cab2f5812e6f0694c57e5c0b7f
@@@ -131,8 -132,17 +132,17 @@@ void RGWPutUserPolicy::execute(
      return;
    }
  
+   if (!store->svc()->zone->is_meta_master()) {
+     ceph::bufferlist in_data;
+     op_ret = forward_request_to_master(s, nullptr, store, in_data, nullptr);
+     if (op_ret < 0) {
+       ldpp_dout(this, 0) << "ERROR: forward_request_to_master returned ret=" << op_ret << dendl;
+       return;
+     }
+   }
    try {
 -    const Policy p(s->cct, s->user->user_id.tenant, bl);
 +    const Policy p(s->cct, s->user->get_tenant(), bl);
      map<string, string> policies;
      if (auto it = uattrs.find(RGW_ATTR_USER_POLICY); it != uattrs.end()) {
        bufferlist out_bl = uattrs[RGW_ATTR_USER_POLICY];