From: J. Eric Ivancich Date: Thu, 29 Nov 2018 23:02:45 +0000 (-0500) Subject: rgw: fix bad versioned bucket stats after reshard X-Git-Tag: v13.2.7~287^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49a6d901b54b6ea85947f78eb23c5bc9e12840c7;p=ceph.git rgw: fix bad versioned bucket stats after reshard When a versioned bucket is resharded, the stats for bucket index entries of type PlainIdx and InstanceIdx were both accumulated to determine the bucket stats. This caused a doubling of some stats, such as bytes used. This fix makes certain that only PlainIdx entries are accumulated. This works for unversioned buckets as well, as they only have Plain Idx entries. Signed-off-by: J. Eric Ivancich (cherry picked from commit 6379ec6a81bf469341a095b3b852678115fb99f7) --- diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc index cbcc47525739..c48a2b353cf5 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -247,6 +247,8 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc using ceph::decode; switch (type) { case PlainIdx: + account = true; + // NO BREAK; falls through to case InstanceIdx: case InstanceIdx: { rgw_bucket_dir_entry entry; @@ -257,7 +259,6 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc accounted_stats->total_size += entry.meta.accounted_size; accounted_stats->total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size); accounted_stats->actual_size += entry.meta.size; - account = true; } break; case OLHIdx: