Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crimson/osd/osd_operations/snaptrim_event: fix lifetime management #54431

Merged

Conversation

Matan-B
Copy link
Contributor

@Matan-B Matan-B commented Nov 9, 2023

The operation's id and future returned when starting SnapTrimObjSubEvent
is empalced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed op to go out of scope and lose all its references
(and get deleted) before exiting.

Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.

Fixes: https://tracker.ceph.com/issues/63299

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

@Matan-B Matan-B added the bug-fix label Nov 9, 2023
@Matan-B Matan-B requested a review from a team as a code owner November 9, 2023 09:48
@Matan-B Matan-B force-pushed the wip-matanb-crimson-extend-snaptrimsubevent-lifetime branch from fde0174 to d1d4481 Compare November 9, 2023 11:10
Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

LGTM!

Two typos found in the commit msg:

is empalced into subop_blocker.

Stroing the operation as a reference instead of the id

The operation's id and future returned when starting SnapTrimObjSubEvent
is emplaced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed `op` to go out of scope and lose all its references
(and get deleted) before exiting.

Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.

Fixes: https://tracker.ceph.com/issues/63299

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
@Matan-B Matan-B force-pushed the wip-matanb-crimson-extend-snaptrimsubevent-lifetime branch 2 times, most recently from d1d4481 to c9d1f28 Compare November 12, 2023 14:14
@Matan-B
Copy link
Contributor Author

Matan-B commented Nov 14, 2023

https://shaman.ceph.com/builds/ceph/wip-matanb-crimson-testing-11-12-v2/
https://pulpito.ceph.com/matan-2023-11-14_08:12:53-crimson-rados-wip-matanb-crimson-testing-11-12-v2-distro-crimson-smithi/

361bccc5072 Merge branch 'wip-matanb-crimson-extend-pg-lifetime'
5b0ac71654a Merge branch 'wip-matanb-crimson-extend-snaptrimsubevent-lifetime'
dc8490de1f2 Merge branch 'wip-matanb-crimson-do_osd_ops_execute-v3'

Failures, unrelated:
7456902 - [ FAILED ] TestLibRBD.TestEncryptionLUKS2 (no OSD crash)

7456908 - [ FAILED ] TestClsRbd.directory_methods (no OSD crash)

7456917 - infra

7456896 - https://tracker.ceph.com/issues/61651

@Matan-B Matan-B merged commit c2091ef into ceph:main Nov 14, 2023
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants