Merge pull request #10077 from yehudasa/wip-16494

rgw: fix for issue 16494
This commit is contained in:
Orit Wasserman 2016-07-04 09:37:34 +02:00 committed by GitHub
commit 76705d87ad
4 changed files with 12 additions and 8 deletions

View File

@ -157,6 +157,7 @@ void req_info::rebuild_from(req_info& src)
{
method = src.method;
script_uri = src.script_uri;
args = src.args;
if (src.effective_uri.empty()) {
request_uri = src.request_uri;
} else {

View File

@ -1651,20 +1651,17 @@ void RGWSetBucketVersioning::pre_exec()
void RGWSetBucketVersioning::execute()
{
op_ret = get_params();
if (op_ret < 0)
return;
if (!store->is_meta_master()) {
bufferlist in_data;
JSONParser jp;
op_ret = forward_request_to_master(s, NULL, store, in_data, &jp);
op_ret = forward_request_to_master(s, NULL, store, in_data, nullptr);
if (op_ret < 0) {
ldout(s->cct, 20) << __func__ << "forward_request_to_master returned ret=" << op_ret << dendl;
}
return;
}
op_ret = get_params();
if (op_ret < 0)
return;
if (enable_versioning) {
s->bucket_info.flags |= BUCKET_VERSIONED;

View File

@ -446,6 +446,7 @@ public:
class RGWSetBucketVersioning : public RGWOp {
protected:
bool enable_versioning;
bufferlist in_data;
public:
RGWSetBucketVersioning() : enable_versioning(false) {}

View File

@ -746,6 +746,11 @@ int RGWSetBucketVersioning_ObjStore_S3::get_params()
return r;
}
if (!store->is_meta_master()) {
/* only need to keep this data around if we're not meta master */
in_data.append(data, len);
}
r = parser.get_versioning_status(&enable_versioning);
return r;