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

[v23.1.x] Removed lock contention when writing Raft snapshots #10973

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #10870

When writing a snapshot Raft uses the state that is a part of already
committed log, offset translator and configuration manager. The snapshot
does not relay on the protocol state that mutates. This observation
allows to write snapshot outside of Raft operation mutex as that
operation is not changing any of the current state and does not relay on
the current state. Using separate mutex to protect the snapshot reduces
contention and does not influence the write path latency.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 8b21874)
When prefix truncating configuration manager and offset translator the
main raft operation mutex doesn't have to be held. Prefix truncation
only mutates the state that is no longer changed by any other operation
than persisting a snapshot. It is enough to make the operation mutually
exclusive with other snapshot related operations.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 54fc7cd)
@vbotbuildovich vbotbuildovich added this to the v23.1.x-next milestone May 23, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 23, 2023
@mmaslankaprv mmaslankaprv marked this pull request as ready for review May 23, 2023 19:17
@mmaslankaprv mmaslankaprv modified the milestones: v23.1.x-next, v23.1.11 May 23, 2023
@mmaslankaprv
Copy link
Member

ci failure: #10219

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants