rgw : Bucket mv, bucket chown and user rename utilities#28813
rgw : Bucket mv, bucket chown and user rename utilities#28813cbodley merged 22 commits intoceph:masterfrom
Conversation
626855a to
b2f872a
Compare
b2f872a to
d4ebef0
Compare
cbodley
left a comment
There was a problem hiding this comment.
it looks like there's some code duplication between RGWBucket::link() and the for loop in RGWUser::execute_user_rename(). is it possible to refactor some of that into a separate helper function?
Done |
4e3dc21 to
6952e60
Compare
cbodley
left a comment
There was a problem hiding this comment.
can you please try to add some test coverage for 'user rename' in qa/tasks/radosgw_admin.py?
|
Looking into the seemingly unrelated failure. |
65eee91 to
ba84c6f
Compare
Successful run: |
|
we have a 'test case' that compares the output of |
0e4e54a to
3eda34e
Compare
Fixed. Also line wrap. Missed it while switching between branches. Thanks. |
|
@smanjara i did a quick test, and it looks like |
@cbodley, yes, that's not intended. I seem to have missed this case. Will add checks to fail if new-uid already exists. Thanks for testing it. |
In jewel, "rgw keystone implicit tenants" only applied to swift. As of luminous), this option applies to s3 also. Sites that used this feature with jewel now have outstanding data that depends on the old behavior. The fix here is to expand "rgw keystone implicit tenants" so that it can be set to any of "none", "all", "s3" or "swift" (also 0=false=none, 1=true=all). When set to "s3" or "swift", the actual id lookup is also partitioned. Formerly "rgw keystone implicit tenants" was a legacy opt. This change converts it to the new style of option, including support for dynamically changing it. Fixes: http://tracker.ceph.com/issues/24348 Signed-off-by: Marcus Watts <mwatts@redhat.com>
Add types: RGWBucketEntryPoint obj_version rgw_user These are structures that are visible as data at rest inside of rados when a bucket is made via radosgw. RGWBucketEntryPoint is the contents of a rados object with names that may be either "<bucket-name>" or "<tenant>/<bucket-name>" rgw_user is a structure contained inside of RGWBucketEntryPoint and other structures. obj_version is visible as the xattr "ceph.objclass.version" on rados objects in ".rgw.meta" that contain ".bucket.meta." Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
This just adds the command line option and related bits. Underlying functionality will be a later commit. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
This is not a complete fix; but it makes it possible for the bucket link command to correctly find and attempt to link a bucket to a user with a different tenant. The reason this is not a complete fix is that with just this change, the resulting bucket is "broken"; a duplicate endpoint but 0 length contents is created, and the info entry is not correctly moved. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
The bucket link command was doing an extra bucket get info call because it needed attributes. Revised ::init so that attributes could optionally be requested, and eliminate now unnecessary call. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
The bucket link command was doing a fetch of the entrypoint late in the link process. This makes it harder to do "bucket move" functionality, because then it would need to know the old bucket late in the process. The bucketinfo structure has all the data elements necessary to recreate the endpoint, so the changes here arrange to just use that data. In order to write the object it's also necessary to propagate xattrs. The only xattr that seems to be present on the endpoint is "ceph.objclass.version", so that's what this copies out. It appears that attribute may be set set separately by cls, so I'm not sure this is actually necessary. However, the old code would have written it, so this code preserves that behavior. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
The existing RGWBucket::link logic changed things incrementally in order to relink a bucket. When doing a "bucket move", this is no longer a good idea - bucket objects must be written to new names which don't exist, so it is better to create then wholly out of in-memory data. Also, add != for rgw_bucket - inverse of existing of ==, provides another option to arrange code to make it more readable. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
This is the base or primitive "bucket move" function. It handles rewriting the endpoint and info rados objects for the rgw bucket, plus deleting the original rados objects that are no longer correct. It doesn't handle changing the bucket name; that's in a future commit. Some of the changes here will get overwritten by that commit. Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
…of an existing user are moved under the new user namespace specified by "--new-uid". It calls bucket link and bucket chown to link the buckets and objects to the new user namespace. Access and secret keys of the user(and the subusers) are preserved. Usage: "radosgw-admin user rename --uid=<> --new-uid=<>" Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
… a time. Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Added a helper function to modify bucket acl. Rebased onto master. Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
da32c64 to
67e98eb
Compare
|
thanks @smanjara; could you please add a test case for user rename over an existing user? it should also verify that, after failing to rename, both users can still access their buckets/objects? since the metadata refactoring in #29118 is changing a lot of this code, i'd really like some extra coverage to make sure we don't break anything here |
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
Since ceph#28813 is in master, the bucket operations (with tenanted owners) behaviour has changed regarding nautilus, so this fix is applied to nautilus directly. Fixes: https://tracker.ceph.com/issues/41067 Signed-off-by: alfonsomthd <almartin@redhat.com>
Since ceph#28813 is in master, the bucket operations (with tenanted owners) behaviour has changed regarding nautilus, so this fix is applied to nautilus directly. Fixes: https://tracker.ceph.com/issues/41067 Signed-off-by: Alfonso Martínez <almartin@redhat.com>
|
Are these new features available via RGW Admin OPS API? There are plans to support them via Dashboard. Can anyone comment this in the tracker issue https://tracker.ceph.com/issues/41819 please. |
In summary, some of the key changes (detailed in the commit messages) are:
Bucket link feature extension support to include tenanted user namespace and ability to change bucket name. Refers to pr rgw: bucketmv #23994 submitted by @mdw-at-linuxbox
Introduces 'bucket chown' command to move buckets and objects under a new user built upon the above pr.
Introduces 'user rename' to change user ID.
References tracker ticket
Updates documentation if necessary
Includes tests for new functionality or reproducer for bug