]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix radosgw-admin bucket check stat calculation bug
authorCory Snyder <csnyder@1111systems.com>
Fri, 22 Sep 2023 21:08:25 +0000 (21:08 +0000)
committerCory Snyder <csnyder@1111systems.com>
Fri, 22 Sep 2023 21:17:58 +0000 (21:17 +0000)
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 <csnyder@1111systems.com>
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.cc

index 046c063bbfa3a79782867fa0df873fc9525fa19b..75a37bad63428404b86b2e3b0450ee802a73f45e 100644 (file)
@@ -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;
index 7fb5d97c6d4e68e63a83fb215731e26d6320c35f..1c232a576bbaf9d4a081ff283cbc5f1482f3800c 100644 (file)
@@ -403,7 +403,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;
   }