]> git-server-git.apps.pok.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>
Wed, 4 Oct 2023 08:55:06 +0000 (08:55 +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>
(cherry picked from commit 4728daa5557bfb79a608dd903b8630e2b15fcb2c)

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

index 9058658827db69de67d7b866628ea838a2b1300e..485cc88be34becd1862c228fcfc1666f1602ef51 100644 (file)
@@ -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;
index 22a07dc90631eb57422c01d4b1a1a16ec509e523..4e93924276c7949b4148eb91296ae789be841291 100644 (file)
@@ -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;
   }