Skip to content

rgw: followup for 'user rename' - #29540

Merged
cbodley merged 7 commits into
ceph:masterfrom
cbodley:wip-rgw-user-rename
Aug 9, 2019
Merged

cbodley merged 7 commits into
ceph:masterfrom
cbodley:wip-rgw-user-rename

Conversation

@cbodley

@cbodley cbodley commented Aug 7, 2019

Copy link
Copy Markdown
Contributor

some cleanup and refactoring to make it closer to the new user interfaces in #29118. allows overwriting the --new-uid user when --yes-i-really-mean-it is given

cbodley added 7 commits August 7, 2019 16:25
removes unused 'attrs' argument, and takes uid + display name instead
of RGWUserInfo

Signed-off-by: Casey Bodley <[email protected]>
helper function to remove the user:buckets object.
rgw_remove_uid_index() now omits the object version tracker argument to
avoid reading the user info

Signed-off-by: Casey Bodley <[email protected]>
user rename creates a 'stub' user and links all buckets to that before
modifying the existing user. once everything succeeds, the stub user is
updated to match the existing user and all index objects are updated to
point at it

Signed-off-by: Casey Bodley <[email protected]>
if a previous rename attempt fails to complete, it can be restarted with
--yes-i-really-mean-it to overwrite the 'stub' user created previously

Signed-off-by: Casey Bodley <[email protected]>
this calls remove_old_indexes() to clean up the uid and buckets index
objects, and also sets 'old_info = user_info' so that radosgw-admin
dumps the json output of the renamed user instead of the old user

Signed-off-by: Casey Bodley <[email protected]>
@cbodley cbodley added the rgw label Aug 7, 2019
@cbodley
cbodley requested a review from smanjara August 7, 2019 20:28

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

Looks good to me!

@cbodley

cbodley commented Aug 9, 2019

Copy link
Copy Markdown
Contributor Author

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

I think I follow and it looks ok

Comment thread src/rgw/rgw_user.cc Outdated
// update the 'stub user' with all of the other fields and rewrite all of the
// associated index objects
RGWUserInfo user_info = old_user_info;
user_info.user_id = stub_user_info.user_id;

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.

ack

@cbodley
cbodley merged commit bc45261 into ceph:master Aug 9, 2019
@cbodley
cbodley deleted the wip-rgw-user-rename branch August 9, 2019 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants