Skip to content

rgw: suspend account-owned buckets (root user and account) - #70940

Open
RaminNietzsche wants to merge 3 commits into
ceph:mainfrom
RaminNietzsche:wip-rgw-79320-account-root-suspend
Open

RaminNietzsche wants to merge 3 commits into
ceph:mainfrom
RaminNietzsche:wip-rgw-79320-account-root-suspend

Conversation

@RaminNietzsche

@RaminNietzsche RaminNietzsche commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Account-owned buckets are not listed under individual uids after users are
adopted into an RGW account. This series addresses suspension of those
resources in two complementary ways:

  1. Account root user suspend — user suspend on a TYPE_ROOT user
    only disables that identity; it does not freeze account-owned buckets
    (tracker #79320).
  2. Account suspend/enable — new radosgw-admin account suspend|enable
    sets RGWAccountInfo ACCOUNT_SUSPENDED in flags, marks account
    buckets BUCKET_SUSPENDED, and rejects requests from users/roles in that
    account at auth time (tracker #79322).

Migrating an existing user with user modify --account-id transfers bucket
ownership to the account, but existing object ACLs may still name the
pre-migration user. Documented bucket chown --account-id for updating those
object ACLs when IAM members need access after migration.

Testing

  • ninja radosgw / radosgw-admin on local vstart; full
    qa/workunits/rgw/test_account_root_suspend.sh pass (account-first setup).
  • make check / arm64 green on prior tip; Windows failure was infra
    (network is already active), unrelated to RGW account changes.
  • Suggest after ok to test: jenkins test rgw:singleton

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

Copy link
Copy Markdown
Member Author

@cbodley @adamemerson @yuvalif Could you take a look when you have time?

Suspending an account root left account-owned buckets enabled because user suspend still listed by uid after adopt_user_buckets. Tracker: http://tracker.ceph.com/issues/79320

Local: ninja radosgw + ninja radosgw-admin OK. Workunit added for rgw:singleton. An ok to test would help kick CI.

@RaminNietzsche RaminNietzsche changed the title rgw: suspend account buckets when suspending account root rgw: suspend account-owned buckets (root user and account) Aug 10, 2026
@RaminNietzsche

Copy link
Copy Markdown
Member Author

Follow-up pushed: account suspend / account enable (tracker http://tracker.ceph.com/issues/79322) on top of the account-root suspend fix.

  • RGWAccountInfo.suspended + bucket BUCKET_SUSPENDED
  • auth rejects users/roles belonging to a suspended account
  • docs + workunit coverage updated

Local build: ninja radosgw and ninja radosgw-admin OK.

@RaminNietzsche

Copy link
Copy Markdown
Member Author

@AliMasarweh Could you take a look when you have time?

You already reviewed/approved the related per-bucket work in #69645. This PR is the complementary account-scoped side: account-root user suspend and account suspend/enable so account-owned buckets are not left enabled after uid-based listing misses them.

Happy to address any feedback. Local ninja radosgw + radosgw-admin are green; workunit is in rgw:singleton.

@ivancich

Copy link
Copy Markdown
Member

When this is ready for a review, please add the needs-review label.

@RaminNietzsche

Copy link
Copy Markdown
Member Author

When this is ready for a review, please add the needs-review label.

@ivancich Thanks — this is ready for review (not a draft). I don’t have permission to add labels on ceph/ceph; could you please add needs-review?

@adamemerson

Copy link
Copy Markdown
Contributor

ok to test

Comment thread src/rgw/radosgw-admin/radosgw-admin.cc Outdated
Comment on lines +12726 to +12745
if (opt_cmd == OPT::ACCOUNT_MODIFY) {
if (opt_cmd == OPT::ACCOUNT_MODIFY ||
opt_cmd == OPT::ACCOUNT_SUSPEND ||
opt_cmd == OPT::ACCOUNT_ENABLE) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's a little awkward how these commands are combined with 'account modify', meaning that 'account suspend' could modify other fields too:

account suspend --account-name foo --max-buckets 10

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.

Agreed. account suspend / account enable now build a dedicated AdminOpState with only the account identity and the suspended flag, so they no longer share the account modify fields (50aa5689656).

Comment thread src/rgw/rgw_account.cc Outdated
Comment on lines +260 to +262
const bool suspension_changed =
op_state.suspended && static_cast<bool>(*op_state.suspended) !=
static_cast<bool>(info.suspended);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why the static_casts? aren't those already bool?

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.

Removed. Suspension is compared and set via account_suspended() / set_account_suspended() on uint32_t flags in 50aa5689656.

/* Apply bucket suspension after account_id / account-root are resolved so
* account root users disable account-owned buckets, not an empty uid list. */
if (op_state.has_suspension_op()) {
ret = set_user_bucket_suspended(dpp, y, driver, user_info,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i don't think suspension of account root users should suspend the account's buckets. that's what 'account suspend' is for, right?

the account may have more than one root user. admins may want to suspend one and not others. suspension should only prevent that user from making requests

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.

You're right. user suspend on an account root should only block that user. An account can have more than one root, and freezing account-owned buckets belongs on account suspend.

50aa5689656 stops listing those buckets by account id on user suspend, so only that identity is disabled. account suspend still sets ACCOUNT_SUSPENDED and suspends account-owned buckets.

Comment thread src/rgw/rgw_common.h Outdated
static constexpr int32_t DEFAULT_ACCESS_KEY_LIMIT = 4;
int32_t max_access_keys = DEFAULT_ACCESS_KEY_LIMIT;

__u8 suspended{0};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please change to uint32_t flags like RGWBucketInfo, so we can easily extend it in the future

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.

Done in 50aa5689656: RGWAccountInfo now uses uint32_t flags with ACCOUNT_SUSPENDED, plus account_suspended() / set_account_suspended(). Encoding is v4; v3 __u8 suspended still decodes.

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks, just some minor comments

Comment thread src/rgw/rgw_common.cc Outdated
Comment on lines +3072 to +3073
encode_json("flags", flags, f);
encode_json("suspended", account_suspended() ? 1 : 0, f);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove suspended from the json format so it doesn't duplicate information. adding both could lead to inconsistency/confusion - for example, an admin might try passing 'flags': 0, 'suspended': 1 to radosgw-admin metadata put and it wouldn't do what they want

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.

Done in 32f345b745c: RGWAccountInfo::dump() / decode_json() now only use flags, matching RGWBucketInfo. Thanks for flagging the inconsistency risk.

Comment thread src/rgw/rgw_common.h
flags |= ACCOUNT_SUSPENDED;
}
} else if (struct_v >= 4) {
decode(flags, bl);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't need both the v3 and v4 encodings, since the u8 part never merged. please just add the v3 encoding for uint32_t

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.

Agreed — the u8 path never merged. 32f345b745c uses a single struct v3 with uint32_t flags for encode/decode.

Comment thread doc/radosgw/admin.rst Outdated
Comment on lines +198 to +201
account. Prefer ``account suspend`` / ``account enable`` to freeze or restore
an entire account (sets ``AccountInfo.suspended`` and suspends account-owned
buckets). Suspending an *account root* user has the same effect on account
buckets for compatibility with the older per-user workflow. Suspending a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this part about account root users is no longer accurate

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.

Updated in 32f345b745c: the User Suspend section now says only account suspend / account enable freeze account-owned buckets; suspending a user (including the account root) only disables that identity.

Comment thread src/rgw/rgw_common.h Outdated
Comment on lines +867 to +869
bool account_suspended() const {
return (flags & ACCOUNT_SUSPENDED) != 0;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: account->account_suspended() is repetitive, consider suspended()

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.

Renamed to suspended() in 32f345b745c.

Comment thread src/rgw/rgw_common.h Outdated
bool account_suspended() const {
return (flags & ACCOUNT_SUSPENDED) != 0;
}
void set_account_suspended(bool suspended) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

flags is a public variable, so we don't really need a setter function for this. especially when there's only one caller, the bit manipulation can just live there. RGWBucketInfo only has getters for these flags

the goal of flags is to make this extensible, and i don't want to see more of these setters duplicated for different flag values

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.

Removed set_account_suspended() in 32f345b745c; the caller sets ACCOUNT_SUSPENDED on flags directly, consistent with how bucket flags are handled elsewhere.

@cbodley cbodley left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks, nice work. would you mind squashing the commits before qa/merge?

@RaminNietzsche

Copy link
Copy Markdown
Member Author

@cbodley Thank you for the careful review and for approving. The round-2 feedback is addressed in 32f345b745c on the fork branch (replies on the inline threads above).

I built radosgw, radosgw-admin, and unittest_rgw_bencode on my test host after the push; all passed.

I'll squash the commits before qa/merge as you suggested. Thanks again — this was much clearer with your guidance on separating account suspend from user suspend and aligning RGWAccountInfo with the bucket flags pattern.

@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from 32f345b to f8d7777 Compare September 3, 2026 16:35
@RaminNietzsche

Copy link
Copy Markdown
Member Author

Squashed the branch to three commits as requested:

  • 37897ca76af — rgw: add account suspend and enable
  • fc688565832 — qa/rgw: test account suspend and account root behavior
  • f8d7777baed — doc/radosgw: document account suspend and enable

Pushed to wip-rgw-79320-account-root-suspend on the fork.

@cbodley

cbodley commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

github-actions added the needs-ci-approval label 30 minutes ago

@RaminNietzsche, @adamemerson wanted to recognize your contributions and asked me to add you to the Ceph team. i thought i'd sent you an invite, but it doesn't look like you've joined. i can send it again if you'd like. you may need to enable github 2fa before you can accept

@RaminNietzsche

Copy link
Copy Markdown
Member Author

github-actions added the needs-ci-approval label 30 minutes ago

@RaminNietzsche, @adamemerson wanted to recognize your contributions and asked me to add you to the Ceph team. i thought i'd sent you an invite, but it doesn't look like you've joined. i can send it again if you'd like. you may need to enable github 2fa before you can accept

Oh, nice! I’d be happy to join the Ceph team. that's very kind of @adamemerson, and I appreciate you checking.

I'm sorry I missed the invite. Please send it again; I'll set up 2FA if needed and accept right away. Thanks for your help with the process.

@cbodley

cbodley commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

welcome :) that granted you write access to the repo, meaning that you can review/approve other prs and merge things. please make sure you understand the qa process before you do any merges yourself

generally it's enough to add the 'needs-qa' label to get something picked up for qa. once the qa results are approved, someone else will merge the pr or add a 'ready-to-merge' label. once the pr checks are green, you're welcome to merge at that point

@RaminNietzsche

Copy link
Copy Markdown
Member Author

welcome :) that granted you write access to the repo, meaning that you can review/approve other prs and merge things. please make sure you understand the qa process before you do any merges yourself

@cbodley Thank you — I appreciate the welcome and the guidance.

I'll read up on the QA process before merging anything myself. For now I'll use needs-qa when appropriate and wait for QA approval and green checks before merging. Thanks again.

@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from fadabfa to 49c929f Compare October 7, 2026 11:03
@RaminNietzsche
RaminNietzsche requested a review from cbodley October 7, 2026 17:47
Comment thread doc/radosgw/account.rst Outdated
.. note:: Ownership of all of the user's buckets will be transferred to
the account.
the account. Existing object ACLs may still name the pre-migration user
id as the object owner. Account members that rely on IAM (rather than

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Existing object ACLs may still name the pre-migration user id as the object owner.

maybe another sentence along the lines of:

These objects will still be accessible to that user, but not to other users in the account.

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.

Added that sentence to the migration note in doc/radosgw/account.rst (commit 8c2aad3b6038):

Those objects remain accessible to that user, but not to other users in the account.

Rebased the branch onto current main (173b33c6d08b) and force-pushed to wip-rgw-79320-account-root-suspend. Local vstart: qa/workunits/rgw/test_account_root_suspend.sh still passes on the rebased tip.

@anrao19

anrao19 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-10-09-10:05.

@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from 49c929f to 8c2aad3 Compare October 11, 2026 11:06
@RaminNietzsche

Copy link
Copy Markdown
Member Author

@cbodley Round-3 follow-up:

  • Doc: migration note in doc/radosgw/account.rst now states that objects with pre-migration ACL owners stay readable by that user but not by other account members (inline thread above).
  • Rebase: branch rebased onto current main (173b33c6d08b); still three commits (feature / qa / docs). Force-pushed to wip-rgw-79320-account-root-suspend (8c2aad3b6038 tip).
  • QA: left needs-qa / teuthology queue as-is for the updated tip; happy to re-run or adjust if the prior 81586 run is no longer valid after the rebase.

Could you take another look when you have time?

@anrao19

anrao19 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-10-09-10:05.

pr testing completed and approved by @ivancich, more details in https://tracker.ceph.com/issues/81586.
@RaminNietzsche , if further testing is not needed then this can be merged

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from 8c2aad3 to f5bbadb Compare October 14, 2026 14:02
@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from f5bbadb to 36caebd Compare October 27, 2026 06:56
Add radosgw-admin account suspend and account enable. Store suspension
in RGWAccountInfo as uint32_t flags (ACCOUNT_SUSPENDED), encoded in
struct v3 like RGWBucketInfo. account suspend marks account-owned
buckets BUCKET_SUSPENDED and rejects requests from users and roles in
that account at auth time.

user suspend on an account root only disables that identity; it does
not freeze account-owned buckets. Use account suspend for that.

Dedicated AdminOpState for account suspend/enable so those commands
do not share account modify fields.

Fixes: http://tracker.ceph.com/issues/79320
Fixes: http://tracker.ceph.com/issues/79322
Signed-off-by: ramin.najarbashi <[email protected]>
Cover account suspend/enable (ACCOUNT_SUSPENDED flag and bucket
BUCKET_SUSPENDED) and verify user suspend of an account root does not
freeze account-owned buckets. Create users inside the account before
uploading objects so ACLs are account-owned. Use a jq 1.6-safe flags
check for teuthology.

Signed-off-by: ramin.najarbashi <[email protected]>
Document account suspend/enable and note that migrating users into an
account transfers bucket ownership while existing object ACLs may still
name the pre-migration user; bucket chown with --account-id updates
those object ACLs.

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

Copy link
Copy Markdown
Member Author

Rebased onto current main (169a0fb3a86c). New tip: d1c7ac390d3a.

@RaminNietzsche
RaminNietzsche force-pushed the wip-rgw-79320-account-root-suspend branch from 36caebd to d1c7ac3 Compare October 27, 2026 16:50
@adamemerson

Copy link
Copy Markdown
Contributor

@cbodley This has gone through testing, but still needs an approval. Can you take another look?

@RaminNietzsche

Copy link
Copy Markdown
Member Author

@cbodley Gentle ping. All the review threads are addressed on the current tip d1c7ac390: the authorization change is dropped (the workunit now creates the account and account root before uploading objects), suspended is gone from the JSON in favour of flags, and the docs carry the bucket chown migration note including the sentence you suggested. It has also been through QA (tracker #81586). Could you take another look when you have a cycle?

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

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.

5 participants