[IMPROVED] NRG: Reliable peer current/lag state#7885
Merged
neilalexander merged 1 commit intomainfrom Mar 2, 2026
Merged
Conversation
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
wallyqs
approved these changes
Feb 27, 2026
Contributor
A regression? Or just flaky test? |
Member
Author
Flaky |
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.
Follow-up to #7402. Also resetting the last replicated index, since we only know it if we're the leader, since only the leader is in contact with all servers and knows the amount of messages they have persisted in their logs.
The
LagandCurrentvalues were mostly unusable/stale/incorrect when read on a follower node. These values are returned in requests like stream and consumer info, as well as JSZ. So, this PR makes then.Peers()state more usable and consistent:Lag/Currentfields now accurately describe whether the current server is current (or lags) when compared with the peer in the list.Lag. All followers that are part of quorum will reportCurrent: true, Lag: 0. Other non-current followers not part of quorum will showLagof the amount of entries that are committed but not yet persisted on this peer. (This was already the case)Currentwhether it has seen the leader recently.Signed-off-by: Maurice van Veen github@mauricevanveen.com