Skip to content

Commit

Permalink
rgw: bucket resharding should rewrite bucket attrs after link
Browse files Browse the repository at this point in the history
bucket link op resets bucket ACL attr.

Fixes: http://tracker.ceph.com/issues/22742
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
  • Loading branch information
oritwas committed Jan 21, 2018
1 parent 070b87a commit d2f1a77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/rgw/rgw_reshard.cc
Expand Up @@ -345,7 +345,7 @@ class BucketInfoReshardUpdate

int RGWBucketReshard::do_reshard(
int num_shards,
const RGWBucketInfo& new_bucket_info,
RGWBucketInfo& new_bucket_info,
int max_entries,
bool verbose,
ostream *out,
Expand Down Expand Up @@ -482,6 +482,12 @@ int RGWBucketReshard::do_reshard(
return -ret;
}

ret = rgw_bucket_set_attrs(store, new_bucket_info, bucket_attrs, &new_bucket_info.objv_tracker);
if (ret < 0) {
lderr(store->ctx()) << "failed to reset attrs for bucket " << new_bucket_info.bucket.name << " instance (bucket_id=" << new_bucket_info.bucket.bucket_id << ": " << err << "; " << cpp_strerror(-ret) << ")" << dendl;
/* don't error out, reshard process succeeded */
}

ret = bucket_info_updater.complete();
if (ret < 0) {
ldout(store->ctx(), 0) << __func__ << ": failed to update bucket info ret=" << ret << dendl;
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_reshard.h
Expand Up @@ -31,7 +31,7 @@ class RGWBucketReshard {

int create_new_bucket_instance(int new_num_shards, RGWBucketInfo& new_bucket_info);
int do_reshard(int num_shards,
const RGWBucketInfo& new_bucket_info,
RGWBucketInfo& new_bucket_info,
int max_entries,
bool verbose,
ostream *os,
Expand Down

0 comments on commit d2f1a77

Please sign in to comment.