Repository navigation
Make /readyz catch up to latest consensus commit - #5405
Merged
Merged
Conversation
Don't just catch up to the cluster commit at the start of the node, but keep polling the latest commit and what for it instead.
timvisee
commented
Nov 8, 2024
| // Get *cluster* commit index, or check if this is the only node in the cluster | ||
| let Some(cluster_commit_index) = self.cluster_commit_index().await else { | ||
| // Get estimate of current cluster commit so we can wait for it | ||
| let Some(mut cluster_commit_index) = self.cluster_commit_index(true).await else { |
Member
Author
There was a problem hiding this comment.
Minor change: the first consensus commit we wait on is just requested from a single node, which may not necessarily be the latest. It is fine because we'll always do another set of requests to all nodes later.
In an ideal situation this reduces requests to other nodes by (50% - 1).
timvisee
marked this pull request as ready for review
November 18, 2024 11:52
generall
approved these changes
Nov 18, 2024
timvisee
added a commit
that referenced
this pull request
Dec 9, 2024
* Make /readyz fully catch up to current latest cluster commit Don't just catch up to the cluster commit at the start of the node, but keep polling the latest commit and what for it instead. * On first consensus commit request, just rely on the commit of one node
This was referenced Jan 17, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
/readyza more strict and let it catch up to the latest current consensus commit, instead of just the latest commit at the time the peer started.In other words, it now constantly polls the latest commit and tries to catch up to that, instead of just trying to catch up to the latest commit we saw at the time of starting the peer.
This is important because if a replica is marked as dead and is then recovered, the active state of that replica might blink on the restarted peer while it is already accepting updates. That could result in missing updates.
Some potential negative side effects of this change are:
But, ensuring data consistency is more important than the above three points.
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --all --all-featurescommand?