Repository navigation
raft-runtime: expose per-peer match_index and follower-observed leader commit (replica lag) - #70
Open
chrischeng-c4 wants to merge 2 commits into
Open
chrischeng-c4 wants to merge 2 commits into
chrischeng-c4 wants to merge 2 commits into
Conversation
Contributor
Author
Summary of Changes
Local Tests Passed
Cloud Validation Required (Tests Not Run Locally)
|
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.
Closes #45
Changes
crates/raft-core/src/domain/raft_node/accessors.rs:pub fn peer_match_index(&self) -> Option<Vec<(NodeId, Index)>>onRaftNode. ReturnsNonewhen node is not leader; otherwise returns sorted(NodeId, Index)for all voters (incoming/outgoing) and learners excluding self, withIndex::new(0)for peers without recorded match index.crates/raft-core/tests/it/consensus.rs:peer_match_index_reports_leader_peers_and_advancescoveringNoneon follower, peer list on leader, and advancement after append.crates/raft-runtime/src/application/host/status.rs:PeerMatch { pub id: NodeId, pub match_index: u64 }.#[serde(default)] pub peer_match_index: Vec<PeerMatch>toRaftStatus.raft_status_deserializes_without_peer_match_index.crates/raft-runtime/src/application/host.rs,application.rs,lib.rs:PeerMatchnext toRaftStatus.crates/raft-runtime/src/interfaces/peer_http/status.rs:peer_match_indexfromn.peer_match_index()inhost_status.crates/raft-runtime/tests/it/membership_changes.rs:raftz_peer_match_index_reported_on_leader_and_empty_on_followeron a 3-voter + 1-learner cluster.crates/raft-runtime/tests/it/wire_golden.rs:raft_status_json_is_pinnedstruct literal and expected JSON to includepeer_match_index: [].Tests Passed Locally
cargo check --locked -p raft-core -p raft-runtime: PASSEDcargo test --locked -p raft-core -p raft-runtime --no-run: PASSEDcargo test --locked -p raft-runtime --lib raft_status_deserializes_without_peer_match_index: PASSED (1 passed; 0 failed)cargo fmt --check -p raft-core -p raft-runtime: PASSEDTests Not Run Locally (Deferred to Cloud CI)
Per local testing policy, cluster/network tests belong in authorized cloud CI:
crates/raft-core/tests/it/consensus.rs::peer_match_index_reports_leader_peers_and_advances(runs multi-node Raft simulation and leader election).crates/raft-runtime/tests/it/membership_changes.rs::raftz_peer_match_index_reported_on_leader_and_empty_on_follower(starts multi-node TCP/h2c cluster).cargo test -p raft-coreandcargo test -p raft-runtime.