]> 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)
committerCasey Bodley <cbodley@redhat.com>
Wed, 18 Oct 2023 15:05:39 +0000 (11:05 -0400)
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>
(cherry picked from commit 4728daa5557bfb79a608dd903b8630e2b15fcb2c)

src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.cc

index fed30e153336925e18433fa8923f370198c9294b..a7e1b65e8a09ae2d0f23b20d8c64e28ef132bc15 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 3d09a2133a315ae8e0be272467661b6146241c07..3a71860c316b439c8cf0d85c9754a5b7617342f0 100644 (file)
@@ -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;
   }