when bucket reshard completes, rgw_link_bucket() passes the new bucket
instance id down to cls_user, but cls_user_set_buckets_info() does not
change the instance id when it's updating an existing bucket. so when
rgw_user_sync_all_stats() looks up each of the user's buckets, it uses
the original bucket instance id instead of the resharded one and
calculates user stats that may not match the current bucket stats
as a workaround, rgw_user_sync_all_stats() no longer relies on the
bucket instance id it gets from rgw_read_user_buckets(), and instead
calls get_bucket_info() to look up the current instance in the bucket
entrypoint
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
b33328ff9bacd11d8449cb3b5c52f94d9dffec6e)
RGWBucketEnt& bucket_ent = i->second;
RGWBucketInfo bucket_info;
- ret = store->get_bucket_instance_info(obj_ctx, bucket_ent.bucket, bucket_info, NULL, NULL);
+ ret = store->get_bucket_info(obj_ctx, user_id.tenant, bucket_ent.bucket.name,
+ bucket_info, nullptr, nullptr);
if (ret < 0) {
ldout(cct, 0) << "ERROR: could not read bucket info: bucket=" << bucket_ent.bucket << " ret=" << ret << dendl;
continue;