Skip to content

rgw: fix get_obj_state_impl wrongly set s->has_attrs = true#60957

Closed
shashalu wants to merge 1 commit intoceph:mainfrom
shashalu:fix-rgw-get-obj-state-impl
Closed

rgw: fix get_obj_state_impl wrongly set s->has_attrs = true#60957
shashalu wants to merge 1 commit intoceph:mainfrom
shashalu:fix-rgw-get-obj-state-impl

Conversation

@shashalu
Copy link
Contributor

@shashalu shashalu commented Dec 5, 2024

rgw: fix get_obj_state_impl wrongly set s->has_attrs = true

While RGWRados::raw_obj_stat return ENOENT,
s->has_attrs shouldnot set to true

Signed-off-by: [Shasha Lu] lu.shasha@aishu.cn

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Signed-off-by: Shasha Lu <lu.shasha@aishu.cn>
@shashalu shashalu requested a review from a team as a code owner December 5, 2024 03:28
@github-actions github-actions bot added the rgw label Dec 5, 2024
if (r == -ENOENT) {
s->exists = false;
s->has_attrs = true;
s->has_attrs = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please clarify what breaks as a result of this?

looking back through git history, i see that it's been this way since 2011 though i'm not sure why: b03930f

Copy link
Contributor Author

Choose a reason for hiding this comment

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

while upload a multipart,
1.the multipart obj data was written first
2.after all shadow obj has been written, will do write_meta for multipart obj, which only write some xatt
In RGWRados::Object::Write::write_meta, assume_noent is true, in RGWRados::get_obj_state_impl wouldnot actually do raw_obj_stat, only set s->exists = false, s->has_attrs = true
3.if write_meta write xattr failed, then ~RadosWriter() will remove those objs, when remove multipart obj. Because of s->has_attrs = true, s->exists = false, the delete_obj will return ENOENT, thus multipart obj leaked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually i have no idea why https://github.com/ceph/ceph/commit/b03930fa02295f8068195f30312ff2d6fac50991 set s->has_attrs = true either?

Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

thanks @shashalu. still not sure about this, but we'll run through qa to see whether anything breaks 🤞

@ivancich ivancich added the wip-eric-testing-2 for ivancich testing label Dec 12, 2024
@ivancich
Copy link
Member

jenkins test make check arm64

@ivancich
Copy link
Member

@shashalu Please fill out the checklist and add a tracker if need be. I've added this PR to a QA run.

@ivancich
Copy link
Member

ivancich commented Dec 18, 2024

I believe this PR is causing this teuthology error, which can be found here:

https://qa-proxy.ceph.com/teuthology/ivancich-2024-12-18_02:37:18-rgw-wip-eric-testing-2-distro-default-smithi/8043007/teuthology.log

2024-12-18T03:34:26.157 INFO:teuthology.orchestra.run.smithi122.stdout:=================================== FAILURES ===================================
2024-12-18T03:34:26.157 INFO:teuthology.orchestra.run.smithi122.stdout:______________________ test_versioning_obj_suspended_copy ______________________

... elided...

2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:> assert body == content
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:E AssertionError: assert 'content-0' == 'null content'
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:E
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:E - null content
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:E + content-0
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:
2024-12-18T03:34:26.159 INFO:teuthology.orchestra.run.smithi122.stdout:s3tests_boto3/functional/test_s3.py:7722: AssertionError

@ivancich ivancich removed wip-eric-testing-2 for ivancich testing needs-qa labels Dec 18, 2024
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Feb 17, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Mar 19, 2025
@cbodley
Copy link
Contributor

cbodley commented Mar 19, 2025

while upload a multipart,
1.the multipart obj data was written first
2.after all shadow obj has been written, will do write_meta for multipart obj, which only write some xatt
In RGWRados::Object::Write::write_meta, assume_noent is true, in RGWRados::get_obj_state_impl wouldnot actually do raw_obj_stat, only set s->exists = false, s->has_attrs = true
3.if write_meta write xattr failed, then ~RadosWriter() will remove those objs, when remove multipart obj. Because of s->has_attrs = true, s->exists = false, the delete_obj will return ENOENT, thus multipart obj leaked.

i think there's still something to fix here. we may just need to work through the unintended consequences of the change

@cbodley cbodley reopened this Mar 19, 2025
@ceph-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@github-actions github-actions bot removed the stale label Mar 19, 2025
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label May 18, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

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