]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reenable 'bucket stats' on indexless buckets 67189/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 3 Feb 2026 15:12:43 +0000 (10:12 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 3 Feb 2026 16:58:59 +0000 (11:58 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_bucket.cc

index 2ad0427bd15763bc8ca8b92b585953c772651f5e..233163ce78ba7adcd002dff0f2692b84ac930a8d 100644 (file)
@@ -1588,17 +1588,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;