Repository navigation
tentacle: rgw: fix 'bucket stats' when bucket index doesn't exist - #68505
Merged
Merged
Conversation
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)
batrick
approved these changes
May 9, 2026
batrick
reviewed
May 9, 2026
batrick
left a comment
Member
There was a problem hiding this comment.
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)
src/rgw/driver/rados/rgw_bucket.cc
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/76144
backport of #67189
parent tracker: https://tracker.ceph.com/issues/74231
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh