Skip to content

tentacle: rgw: fix 'bucket stats' when bucket index doesn't exist - #68505

Merged
batrick merged 4 commits into
ceph:tentaclefrom
cbodley:wip-76144-tentacle
May 9, 2026
Merged

batrick merged 4 commits into
ceph:tentaclefrom
cbodley:wip-76144-tentacle

Conversation

@cbodley

@cbodley cbodley commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

cbodley added 4 commits April 21, 2026 08:48
Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit a3509f6)
Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit ca6d509)

Conflicts:
	src/rgw/driver/rados/rgw_bucket.cc missing restore stats
buckets that reside in other zonegroups probably don't have a local
bucket index, so we should avoid trying to read stats from them

Fixes: https://tracker.ceph.com/issues/74231

Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit 01d4deb)
Signed-off-by: Casey Bodley <[email protected]>
(cherry picked from commit bedcac2)
@cbodley
cbodley requested a review from a team as a code owner April 21, 2026 12:50
@cbodley cbodley added this to the tentacle milestone Apr 21, 2026
@batrick batrick added releng-audit-queue Release engineering: queued for backport verification audit. releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-queue Release engineering: queued for backport verification audit. labels May 2, 2026

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Backport Parity Review - Backport Deviation Alert

A conflict or unapproved deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff below to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.

Affected File(s)

Range Diff

Click to expand
--- Original (ca6d5092)
+++ Backport (62a61d28)
@@ -1,3 +1,7 @@
 rgw/rados: pass SiteConfig into bucket_stats()
 
 Signed-off-by: Casey Bodley <[email protected]>
+(cherry picked from commit ca6d50921286d31cf26096f80ed5a4287f539abd)
+
+Conflicts:
+	src/rgw/driver/rados/rgw_bucket.cc missing restore stats

================================================================================
RANGE DIFF
================================================================================

1:  ca6d5092128 ! 1:  62a61d2816f rgw/rados: pass SiteConfig into bucket_stats()
    @@ Commit message
         rgw/rados: pass SiteConfig into bucket_stats()
     
         Signed-off-by: Casey Bodley <[email protected]>
    +    (cherry picked from commit ca6d50921286d31cf26096f80ed5a4287f539abd)
    +
    +    Conflicts:
    +            src/rgw/driver/rados/rgw_bucket.cc missing restore stats
     
      ## src/rgw/driver/rados/rgw_bucket.cc ##
    -@@ src/rgw/driver/rados/rgw_bucket.cc: static int bucket_restore_stats(rgw::sal::Driver* driver,
    -   return 0;
    +@@ src/rgw/driver/rados/rgw_bucket.cc: int RGWBucketAdminOp::sync_bucket(rgw::sal::Driver* driver, RGWBucketAdminOpStat
    +   return bucket.sync(op_state, dpp, y, err_msg);
      }
      
     -static int bucket_stats(rgw::sal::Driver* driver,
     +static int bucket_stats(rgw::sal::Driver* driver, const rgw::SiteConfig& site,
    -                         const std::string& tenant_name, const std::string& bucket_name,
    -                         bool dump_restore_stats, Formatter* formatter,
    +                         const std::string& tenant_name,
    +                         const std::string& bucket_name, Formatter* formatter,
                              const DoutPrefixProvider* dpp, optional_yield y) {
     @@ src/rgw/driver/rados/rgw_bucket.cc: int RGWBucketAdminOp::limit_check(rgw::sal::Driver* driver,
      static int list_owner_bucket_info(const DoutPrefixProvider* dpp,
    @@ src/rgw/driver/rados/rgw_bucket.cc: static int list_owner_bucket_info(const Dout
      
          for (const auto& ent : listing.buckets) {
            if (show_stats) {
    --        bucket_stats(driver, tenant, ent.bucket.name, false, formatter, dpp, y);
    -+        bucket_stats(driver, site, tenant, ent.bucket.name, false, formatter, dpp, y);
    +-        bucket_stats(driver, tenant, ent.bucket.name, formatter, dpp, y);
    ++        bucket_stats(driver, site, tenant, ent.bucket.name, formatter, dpp, y);
            } else {
              formatter->dump_string("bucket", ent.bucket.name);
            }
    @@ src/rgw/driver/rados/rgw_bucket.cc: int RGWBucketAdminOp::info(rgw::sal::Driver*
        const bool show_stats = op_state.will_fetch_stats();
        const rgw_user& user_id = op_state.get_user_id();
        if (!bucket_name.empty()) {
    --    ret = bucket_stats(driver, user_id.tenant, bucket_name, op_state.restore_stats, formatter, dpp, y);
    -+    ret = bucket_stats(driver, site, user_id.tenant, bucket_name, op_state.restore_stats, formatter, dpp, y);
    +-    ret = bucket_stats(driver, user_id.tenant, bucket_name, formatter, dpp, y);
    ++    ret = bucket_stats(driver, site, user_id.tenant, bucket_name, formatter, dpp, y);
          if (ret < 0) {
            return ret;
          }
    @@ src/rgw/driver/rados/rgw_bucket.cc: int RGWBucketAdminOp::info(rgw::sal::Driver*
      						   &truncated);
            for (auto& bucket_name : buckets) {
              if (show_stats) {
    --          bucket_stats(driver, user_id.tenant, bucket_name, op_state.restore_stats, formatter, dpp, y);
    -+          bucket_stats(driver, site, user_id.tenant, bucket_name, op_state.restore_stats, formatter, dpp, y);
    +-          bucket_stats(driver, user_id.tenant, bucket_name, formatter, dpp, y);
    ++          bucket_stats(driver, site, user_id.tenant, bucket_name, formatter, dpp, y);
      	} else {
                formatter->dump_string("bucket", bucket_name);
      	}
    @@ src/rgw/driver/rados/rgw_bucket.h: public:
     
      ## src/rgw/driver/rados/rgw_rest_bucket.cc ##
     @@ src/rgw/driver/rados/rgw_rest_bucket.cc: void RGWOp_Bucket_Info::execute(optional_yield y)
    +   op_state.set_bucket_name(bucket);
        op_state.set_fetch_stats(fetch_stats);
    -   op_state.set_restore_stats(fetch_restore_stats);
      
     -  op_ret = RGWBucketAdminOp::info(driver, op_state, flusher, y, this);
     +  op_ret = RGWBucketAdminOp::info(driver, *s->penv.site, op_state, flusher, y, this);
    @@ src/rgw/radosgw-admin/radosgw-admin.cc: int main(int argc, const char **argv)
            int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket);
            if (ret < 0) {
     @@ src/rgw/radosgw-admin/radosgw-admin.cc: int main(int argc, const char **argv)
    +     else
            bucket_op.max_entries = 0; /* for backward compatibility */
    -     bucket_op.set_restore_stats(bool(show_restore_stats));
      
     -    int r = RGWBucketAdminOp::info(driver, bucket_op, stream_flusher, null_yield, dpp());
     +    int r = RGWBucketAdminOp::info(driver, *site, bucket_op, stream_flusher, null_yield, dpp());

Commit Parity Visualizer

BACKPORT PR #68505 SOURCE PR SOURCE STATUS
988f251 rgw: bucket_stats() uses local variable 'index' PR #67189 a3509f6 rgw: bucket_stats() uses local variable 'index'
62a61d2 rgw/rados: pass SiteConfig into bucket_stats() ca6d509 rgw/rados: pass SiteConfig into bucket_stats()
79cc73f rgw: 'bucket stats' omits usage for buckets on other zonegroups 01d4deb rgw: 'bucket stats' omits usage for buckets on other zonegroups
1ff6be3 rgw: reenable 'bucket stats' on indexless buckets bedcac2 rgw: reenable 'bucket stats' on indexless buckets

🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.

@batrick
batrick merged commit cefdbd6 into ceph:tentacle May 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa ready-to-merge releng-audit-pass Release engineering: passed backport verification audit. rgw TESTED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants