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=bedcac2d53895c589abee243de168a214cd07078;p=ceph.git rgw: reenable 'bucket stats' on indexless buckets Signed-off-by: Casey Bodley --- diff --git a/src/rgw/driver/rados/rgw_bucket.cc b/src/rgw/driver/rados/rgw_bucket.cc index 2ad0427bd157..233163ce78ba 100644 --- a/src/rgw/driver/rados/rgw_bucket.cc +++ b/src/rgw/driver/rados/rgw_bucket.cc @@ -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;