From: Cory Snyder Date: Fri, 22 Sep 2023 21:08:25 +0000 (+0000) Subject: rgw: fix radosgw-admin bucket check stat calculation bug X-Git-Tag: v18.2.1~135^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c41a198a00377fdd475586b2a659eecffffd09ff;p=ceph.git rgw: fix radosgw-admin bucket check stat calculation bug Fixes a regression with radosgw-admin bucket check stat calculation and bucket reshard stat calculation when there are objects that have transitioned from unversioned to versioned. The bug was introduced in 152aadb71b61c53a4832a1c8cf82fce3d64b68d1. Signed-off-by: Cory Snyder (cherry picked from commit 4728daa5557bfb79a608dd903b8630e2b15fcb2c) --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index fed30e1533369..a7e1b65e8a09a 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -3090,7 +3090,7 @@ static int check_index(cls_method_context_t hctx, return -EIO; } - if (entry.exists && entry.key.instance.empty()) { + if (entry.exists && entry.flags == 0) { rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category]; stats.num_entries++; stats.total_size += entry.meta.accounted_size; diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc index 3d09a2133a315..3a71860c316b4 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -389,7 +389,7 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, accounted_stats->total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size); accounted_stats->actual_size += entry.meta.size; if (type == BIIndexType::Plain) { - return entry.exists && entry.key.instance.empty(); + return entry.exists && entry.flags == 0; } else if (type == BIIndexType::Instance) { return entry.exists; }