Skip to content

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

Merged
derekcollison merged 1 commit intomainfrom
maurice/prevent-spin-on-snapshot-no-leader
Oct 29, 2024
Merged

[FIXED] Don't spin during snapshot processing with no leader#6050
derekcollison merged 1 commit intomainfrom
maurice/prevent-spin-on-snapshot-no-leader

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
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
Copy Markdown
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
@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