Repository navigation
rgw/swift: preserve dashes/underscores in swift user metadata names - #50790
Conversation
|
thanks @jzhu116-bloomberg! does this change the format of the stored |
No, it doesn't change the format of the stored After On both "Quincy 17.2.0" and "main + this PR", I have the following format. They are exactly the same on both versions. I also tested retrieving/removing the metadata set in version "Quincy 17.2.0" after I upgraded my cluster to the version "main + this PR"), and everything worked well. However please note, with the fixed version, there is a display change in the output of "stat bucket". Please see the following examples. In the fixed version, the output reflects exactly the dashes/underscores in the metadata names, instead of always converting them to dashes in the older versions. On "Quincy 17.2.0", On "main + this PR", |
|
Couple of code nits: /1/ you can glue std::strings together using +, and /2/ you can ingest r-values (& eventually return them as your result) using "&&". Using both of these should produce simpler better code. (yes the original code didn't do that...) { there's a stringstream use & an on-stack variable C string allocation that I think you can eliminate with this... { and yes your stringstream is better than the original code snprintf...} } Also, /3/ rather than having two slightly different copies of the lowercase-dash and camelcase-http functions I'd recommend adding an extra boolean flag to elicit the different behavior. You can add a 'default' value for the parameter in .h if you only want the special behavior in a few places. |
|
I ran this PR through teuthology a few weeks ago and the tests it said it fixed still failed: http://qa-proxy.ceph.com/teuthology/amaredia-2023-07-13_13:19:49-rgw:tempest-wip-rgw-swift-underscore-distro-default-smithi/7336183/teuthology.log @mdw-at-linuxbox have you run tempest locally on this PR to see the tests that fail succeed? |
|
agree, avoid stringstream if possible, maybe fmt can substitute? |
|
i just recently noticed that the swift API specifies that underscores should be converted to dashes:
this text shows up under both https://docs.openstack.org/api-ref/object-store/#create-container and https://docs.openstack.org/api-ref/object-store/#create-update-or-delete-container-metadata tempest test case test_create_container_with_metadata_value checks for this part and is failing with this PR we used to handle this correctly for swift before #38737, which was a fix for the s3 side; however, those changes should have only applied to the s3 API |
dff0b53 to
c5e24a4
Compare
|
Checked in changes
|
|
Just to note: Quincy has the same issue so the potential backport required after https://tracker.ceph.com/issues/51772 will be fixed. |
|
Do we have any updates on this issue? We disabled corresponding tempest tests but want to see them working with a proper fix |
|
@prazumovsky: When I run this PR through the tempests tests locally I still get failures for I have a an additional fix (ceph/ceph-ci@3999c57) that got the tests to pass locally. I want to run it through the tempest tests in teuthology before it is added to this PR. I should have more information in the next day or two. |
|
thank you for the update! |
|
@jzhu116-bloomberg @cbodley updated this PR with a commit that has the tempest tests passing. Will need someone else to review. |
There was a problem hiding this comment.
discussed in the bug scrub - we want to return here on any fatal errors, but continue on if op_ret is either EEXIST or ERR_BUCKET_EXISTS
275c4f7 to
ca99395
Compare
There was a problem hiding this comment.
if (op_ret < 0 && op_ret != -EEXIST && op_ret != -ERR_BUCKET_EXISTS)ca99395 to
9a36125
Compare
|
@alimaredia please use public links: http://pulpito.ceph.com/amaredia-2023-10-30_21:38:22-rgw-wip-rgw-swift-preserve-dash-underscore-in-container-metadata-distro-default-smithi/ i see the relevent tempest tests are failing [teuthology.log]: |
I did some more manual tests, and found out that POST request works fine, but not PUT request. The above 2 tempest tests are using PUT requests. The very first PUT request to create a container with "X-Container-Meta-*" header succeeds with status code 201, and the meta data is properly set. However the following PUT requests on the same container return with the status code 202 without handling the "X-Container-Meta-*"/"X-Remove-Container-Meta-*" headers at all. Please see below for some relevant log lines: The 2nd PUT request on the same container: What should be the correct behavior for a PUT request on an existing container in terms of custom metadata handling?
Does this mean we should update all attributes specified in the PUT container request if the container exists? |
Please ignore my question. I didn't read through thoroughly. Ali's fix actually answered it. |
There was a problem hiding this comment.
shouldn't it be if (op_ret < 0 && op_ret != -EEXIST && op_ret != -ERR_BUCKET_EXISTS) ?
9a36125 to
8909a2f
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
jenkins test make check |
|
jenkins test api |
|
jenkins test api |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
Please actualizethis PR because the issue is still reproducable |
Signed-off-by: Juan Zhu <[email protected]>
Signed-off-by: Juan Zhu <[email protected]>
Return prevents swift metadata from being removed if bucket already exists. Signed-off-by: Ali Maredia <[email protected]>
Signed-off-by: Juan Zhu <[email protected]>
|
pushed a rebase that removed the merge commit. the tasks/tempest.yaml conflict was resolved automatically. will merge once checks pass |
|
Bugfix merged, great news! Hope to see it in reef and quincy. |
|
Hello! Still hoping to see backport to Reef at least :) |
Preserve dashes/underscores in swift user metadata names so it allows proper display and deletion.
Fixes: https://tracker.ceph.com/issues/51772
Signed-off-by: Jane Zhu [email protected]
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows