From: Casey Bodley Date: Tue, 3 Feb 2026 15:12:43 +0000 (-0500) Subject: rgw: reenable 'bucket stats' on indexless buckets X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ff6be32622231df3e753a726e86f2c5de183062;p=ceph.git rgw: reenable 'bucket stats' on indexless buckets Signed-off-by: Casey Bodley (cherry picked from commit bedcac2d53895c589abee243de168a214cd07078) --- diff --git a/src/rgw/driver/rados/rgw_bucket.cc b/src/rgw/driver/rados/rgw_bucket.cc index 0a11b0b89473..ad925fe7b45a 100644 --- a/src/rgw/driver/rados/rgw_bucket.cc +++ b/src/rgw/driver/rados/rgw_bucket.cc @@ -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;