[admin] Add partition leader election diagnostics - #5149
Open
pcholakov wants to merge 2 commits into
Open
Conversation
pcholakov
force-pushed
the
codex/sisko-election-observability
branch
from
August 7, 2026 11:21
627cbde to
6c9f02a
Compare
pcholakov
commented
Aug 7, 2026
| legacy_cluster_state, | ||
| nodes_config, | ||
| ); | ||
| info!( |
Contributor
Author
There was a problem hiding this comment.
IDK if this might be too noisy, happy to also drop this to debug! if we want to keep the volume lower.
pcholakov
marked this pull request as ready for review
August 7, 2026 12:27
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.
Adds diagnostics for partition leader election so unexpected target choices can be root-caused from logs. These diagnostics were used to root-cause the premature reconfiguration completion fixed separately in #5150. Observability only: the selection path is extracted into a free function so tests can drive it, but candidate eligibility, scoring, and tie-breaking are unchanged; the new diagnostic types never feed selection.
Leader election combines two independent inputs: the gossip failure detector decides which replicas are eligible, and the legacy
GetNodeStatepoll supplies partition-processor status for scoring. A mismatch between them—a node alive in gossip whose legacy poll failed—silently degrades a warm replica to the lowest score. Previously, nothing recorded the inputs to a given choice.This PR adds two log streams:
restate_admin::cluster_controller::leader_election=debug): the full per-candidate input set (both detectors' views, status presence and age, replay and run modes, LSN positions, affinity, and score) plus the legacy cluster-state age. The candidate dump is only built when this target is enabled.The new test documents a failure-detector mismatch the scheduler currently permits: N2 is eligible per gossip while a failed legacy poll marks it dead and removes its processor status; N1 is
Starting. Both score zero, and replica-set order selects N1. Once N2'sActivestatus is visible again, N2 is selected. The test only exists to demonstrate potential behavior.Log sample
Example output
Representative structured output from a controlled three-node run. The values are sanitized from captured logs and line-wrapped for readability; field names and the INFO/DEBUG split reflect this PR.