From c037800ef515d3fe74b7dbf30524ab24e3f6c1d8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 15 Oct 2018 16:25:20 -0400 Subject: [PATCH] rgw: rgw_user_sync_all_stats uses bucket entrypoint 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 (cherry picked from commit b33328ff9bacd11d8449cb3b5c52f94d9dffec6e) --- src/rgw/rgw_user.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index b94a2d36bb3fb..b9ca1b6d01d84 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -66,7 +66,8 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id) 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; -- 2.39.5