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: v16.2.15~169^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf1a1956eadde7d81d0ca995ff8eebe87843d1e7;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 9058658827db..485cc88be34b 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2888,7 +2888,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 22a07dc90631..4e93924276c7 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -338,7 +338,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; }