rgw: check all users bucket for resharding, this will reshard bucket created in older versions

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
This commit is contained in:
Orit Wasserman 2017-06-11 16:04:52 +03:00
parent b95093356b
commit ad420d5574
2 changed files with 8 additions and 0 deletions

View File

@ -13120,6 +13120,9 @@ int RGWRados::check_bucket_shards(const RGWBucketInfo& bucket_info, const rgw_bu
}
if (need_resharding) {
ldout(cct, 20) << __func__ << " bucket " << bucket.name << " need resharding " <<
" old num shards " << bucket_info.num_shards << " new num shards " << suggested_num_shards <<
dendl;
return add_bucket_to_reshard(bucket_info, suggested_num_shards);
}

View File

@ -77,6 +77,11 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id)
ldout(cct, 0) << "ERROR: could not sync bucket stats: ret=" << ret << dendl;
return ret;
}
RGWQuotaInfo bucket_quota;
ret = store->check_bucket_shards(bucket_info, bucket_info.bucket, bucket_quota);
if (ret < 0) {
ldout(cct, 0) << "ERROR in check_bucket_shards: " << cpp_strerror(-ret)<< dendl;
}
}
} while (is_truncated);