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

Tighten up threading in snapshot finalization #124403

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DaveCTurner
Copy link
Contributor

Today snapshot finalization does nontrivial work on the calling thread
(often the cluster applier thread) and also in theory may fork back to
the cluster applier thread in getRepositoryData, yet it always forks
at least one task (the SnapshotInfo write) to the SNAPSHOT pool
anyway. With this change we fork to the SNAPSHOT pool straight away
and then make sure to stay on this pool throughout.

Today snapshot finalization does nontrivial work on the calling thread
(often the cluster applier thread) and also in theory may fork back to
the cluster applier thread in `getRepositoryData`, yet it always forks
at least one task (the `SnapshotInfo` write) to the `SNAPSHOT` pool
anyway. With this change we fork to the `SNAPSHOT` pool straight away
and then make sure to stay on this pool throughout.
@DaveCTurner DaveCTurner added >non-issue :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.19.0 v9.1.0 labels Mar 8, 2025
@DaveCTurner DaveCTurner requested review from DiannaHohensee and removed request for DiannaHohensee March 8, 2025 09:22
@DaveCTurner
Copy link
Contributor Author

Somewhat relates #108907: moving this code into a method object will let us split it up into more manageable pieces and eventually move it out of SnapshotsService altogether which will give us more opportunities to simplify finalization. Not doing that yet because it'd be quite noisy, and I've crafted this PR to have a minimal diff for ease of review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant