]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rgw_user_sync_all_stats uses bucket entrypoint 24911/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 15 Oct 2018 20:25:20 +0000 (16:25 -0400)
committerNathan Cutler <ncutler@suse.com>
Sat, 3 Nov 2018 14:22:39 +0000 (15:22 +0100)
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)

src/rgw/rgw_user.cc

index b94a2d36bb3fb566bb163b5c4659fd7f8fec12f0..b9ca1b6d01d8434f7319b0a6f5dcad553909c5a9 100644 (file)
@@ -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;