]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reenable 'bucket stats' on indexless buckets 68505/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 3 Feb 2026 15:12:43 +0000 (10:12 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 21 Apr 2026 12:49:49 +0000 (08:49 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bedcac2d53895c589abee243de168a214cd07078)

src/rgw/driver/rados/rgw_bucket.cc

index 0a11b0b894735037651715e5d5d9acf19570b3f6..ad925fe7b45a5ca8ea5259e85cdafb000a230e9e 100644 (file)
@@ -1525,17 +1525,14 @@ static int bucket_stats(rgw::sal::Driver* driver, const rgw::SiteConfig& site,
   }
 
   const RGWBucketInfo& bucket_info = bucket->get_info();
+  const auto& index = bucket_info.get_current_index();
 
-  // buckets on a different zonegroup won't have a local bucket index for stats
+  // buckets won't have a local bucket index for stats unless they:
+  // - reside on the local zonegroup
+  // - are not indexless
   const bool local_zonegroup = (site.get_zonegroup().id == bucket_info.zonegroup);
-  const bool has_index = local_zonegroup;
-
-  const auto& index = bucket_info.get_current_index();
-  if (is_layout_indexless(index)) {
-    cerr << "error, indexless buckets do not maintain stats; bucket=" <<
-      bucket->get_name() << std::endl;
-    return -EINVAL;
-  }
+  const bool has_index = local_zonegroup &&
+      index.layout.type == rgw::BucketIndexType::Normal;
 
   std::string bucket_ver, master_ver;
   std::string max_marker;