Skip to content

rgw: add radosgw-admin bucket suspend/unsuspend commands - #69645

Merged
AliMasarweh merged 3 commits into
ceph:mainfrom
RaminNietzsche:rgw-bucket-suspend
Aug 17, 2026
Merged

AliMasarweh merged 3 commits into
ceph:mainfrom
RaminNietzsche:rgw-bucket-suspend

Conversation

@RaminNietzsche

Copy link
Copy Markdown
Member

Add per-bucket suspend and unsuspend via radosgw-admin without suspending the bucket owner. S3 and Swift requests against a suspended bucket fail with 403 BucketSuspended (distinct from UserSuspended). Expose the suspended field in bucket stats output.

Propagate read_bucket_policy errors from rgw_build_bucket_policies so suspended buckets are rejected during permission setup rather than falling through to unrelated S3 errors.

Includes admin documentation, release note, QA workunit, and unit tests.

Use cases

  • Temporarily block S3/Swift access to a single bucket while the owner and their other buckets remain active (e.g. incident response or compliance hold on one bucket).
  • Quarantine or investigate a specific bucket without disabling the entire RGW user account.
  • Restore access after maintenance with radosgw-admin bucket unsuspend.

User-level suspend (radosgw-admin user suspend) is unchanged: it still suspends all of that user's buckets and blocks all requests for that user.

On multisite secondary zones, bucket suspend and bucket unsuspend require --yes-i-really-mean-it, consistent with other metadata-changing admin commands.

Testing

Unit tests

unittest_rgw_http_errors (local, build-local):

[==========] Running 3 tests from 1 test suite.
[ RUN      ] RGWHttpErrors.BucketSuspendedS3
[       OK ] RGWHttpErrors.BucketSuspendedS3 (0 ms)
[ RUN      ] RGWHttpErrors.BucketSuspendedSwift
[       OK ] RGWHttpErrors.BucketSuspendedSwift (0 ms)
[ RUN      ] RGWHttpErrors.BucketSuspendedDistinctFromUser
[       OK ] RGWHttpErrors.BucketSuspendedDistinctFromUser (0 ms)
[==========] 3 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 3 tests.

Local vstart E2E smoke test

Manual smoke test against vstart RGW (MON=1 OSD=1 RGW=1, memstore, --localhost, port 8000):

  1. Create bucket + object via S3
  2. radosgw-admin bucket stats → suspended: false
  3. S3 ListObjects → success
  4. radosgw-admin bucket suspend --bucket … → suspended: true
  5. S3 ListObjects → 403 BucketSuspended
  6. radosgw-admin bucket unsuspend --bucket … → suspended: false
  7. S3 ListObjects → success; cleanup

Result: PASS

QA / teuthology

Added qa/workunits/rgw/test_rgw_bucket_suspend.py, run-bucket-suspend.sh, and qa/suites/rgw/verify/tasks/bucket-suspend.yaml. Not run locally via teuthology; will rely on CI after ok to test.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@RaminNietzsche
RaminNietzsche requested review from a team as code owners June 22, 2026 16:33
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

14 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@RaminNietzsche

Copy link
Copy Markdown
Member Author

@cbodley @AliMasarweh could you please review when you have a chance?

@RaminNietzsche

Copy link
Copy Markdown
Member Author

Gentle ping @cbodley @AliMasarweh @ceph/rgw — still looking for a review when you have a moment. Also need ok to test so Jenkins can run. Thanks!

@AliMasarweh

Copy link
Copy Markdown
Member

@RaminNietzsche thanks for your patience, I had tasks with close deadline and an urgent costumer issues that I am working on for the past month. so I couldn't review your change
I will ask if someone from RGW can review your change

@AliMasarweh AliMasarweh 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.

Great job @RaminNietzsche
I have a few comments

Comment thread src/rgw/driver/rados/rgw_bucket.cc Outdated
logrecord_ut.gmtime(formatter->dump_stream("judge_reshard_lock_time"));
formatter->dump_bool("object_lock_enabled", bucket_info.obj_lock_enabled());
formatter->dump_bool("mfa_enabled", bucket_info.mfa_enabled());
formatter->dump_bool("suspended", (bucket_info.flags & BUCKET_SUSPENDED) != 0);

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.

I think we should add a helper method to get this flag

struct RGWBucketInfo {
...
bool bucket_suspended() const { return (flags & BUCKET_SUSPENDED) != 0; }

I saw it 4 times in the code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we should add a helper method to get this flag

Agreed — added RGWBucketInfo::bucket_suspended() and switched the call sites over to it.

Comment on lines +15 to +16
ACCESS_KEY = 'OJODXSLNX4LUNHQG99PB'
SECRET_KEY = '3l6ffld34qaymfomuh832j94738aie2x4p2o8h6n'

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.

All of our tests uses these access key and secret key (which matches vstart ones):

endpoint = 'http://127.0.0.1:8000'
access_key='0555b35654ad1656d804'
secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All of our tests uses these access key and secret key (which matches vstart ones)

Updated the workunit to use the standard vstart access/secret keys.

Comment thread src/rgw/rgw_op.cc
s->bucket->get_attrs(),
s->bucket_acl, s->bucket->get_key(), y);
if (ret < 0) {
return ret;

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.

it would be nice if we add a log before returning:

ldpp_dout(this, 0) << "failed to read bucket policy, err: " << cpp_strerror(r)  << dendl;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it would be nice if we add a log before returning

Added an ldpp_dout before returning when read_bucket_policy fails in rgw_build_bucket_policies (using dpp/ret to match the surrounding code).

@AliMasarweh

Copy link
Copy Markdown
Member

ok to test

Add per-bucket suspend and unsuspend via radosgw-admin without
suspending the bucket owner. S3 and Swift requests against a suspended
bucket fail with 403 BucketSuspended (distinct from UserSuspended).
Expose the suspended field in bucket stats output.

Propagate read_bucket_policy errors from rgw_build_bucket_policies so
suspended buckets are rejected during permission setup rather than
falling through to unrelated S3 errors.

Includes admin documentation, release note, QA workunit, and unit tests.

Signed-off-by: ramin.najarbashi <[email protected]>
Add RGWBucketInfo::bucket_suspended() helper and use it in the
GET/policy and admin stats paths. Log read_bucket_policy failures
in rgw_build_bucket_policies. Align QA workunit credentials with
the standard vstart access key pair.

Signed-off-by: ramin.najarbashi <[email protected]>
Include bucket suspend/unsuspend in the CLI help golden so
run-cli-tests matches the new admin commands.

Signed-off-by: ramin.najarbashi <[email protected]>
@RaminNietzsche

Copy link
Copy Markdown
Member Author

Updated src/test/cli/radosgw-admin/help.t to include the new bucket suspend / bucket unsuspend help lines so run-cli-tests matches radosgw-admin --help.

Verified locally:

  • radosgw-admin --help emits both lines after bucket stats
  • unittest_rgw_http_errors — 3/3 PASS

The run-tox-mgr failure (No module named 'py.log') looks unrelated to this PR.

@AliMasarweh AliMasarweh 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.

Great job!

@anrao19

anrao19 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@anrao19

anrao19 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@anrao19

anrao19 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-11-06:41.

@anrao19

anrao19 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-08-11-06:41.

pr testing completed and approved by @ivancich. @RaminNietzsche if no further testing is needed then this pr can be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants