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

[FIXED] Don't spin during snapshot processing with no leader #6050

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

MauriceVanVeen
Copy link
Member

With the introduction of these PRs, #5939 and #5986, we don't blow away our state anymore as we can keep retrying.

However, if a follower had installed a snapshot from the leader and would then start processing it, only for the leader to go offline for an extended period, we could spin. Since we'd immediately detect there's no leader, stop the RAFT group, recreate it, stop since no leader, etc. etc.

Prevent spinning by introducing some wait time in-between if it's the first time trying, and check before returning if a leader became available since as then we could still continue.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@MauriceVanVeen MauriceVanVeen marked this pull request as ready for review October 29, 2024 10:52
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner October 29, 2024 10:52
@derekcollison derekcollison merged commit 07c7eda into main Oct 29, 2024
5 checks passed
@derekcollison derekcollison deleted the maurice/prevent-spin-on-snapshot-no-leader branch October 29, 2024 10:59
neilalexander added a commit that referenced this pull request Oct 29, 2024
Includes the following:

- #5115
- #6019
- #6039
- #6034
- #6043
- #6042
- #6047
- #6049
- #6050 
- #6052
- #6053

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants