pub struct AppendEntriesReply {
pub term: Term,
pub success: bool,
pub from: NodeId,
pub match_index: Index,
pub conflict_index: Index,
pub conflict_term: Term,
}Expand description
A follower’s response to an AppendEntries.
success is true when the follower’s log matched at prev_log_index and
it accepted the RPC. match_index reports the highest log index the
follower now agrees on, which the leader uses to track replication progress.
On a rejection, the conflict_* fields let the leader skip the follower’s
next_index back by a whole term in one round trip instead of decrementing
one entry at a time (the fast-backtracking optimisation from the Raft thesis,
§5.3). They are 0 on success and ignored.
§Examples
use raft_io::AppendEntriesReply;
let ok = AppendEntriesReply {
term: 4,
success: true,
from: 2,
match_index: 9,
conflict_index: 0,
conflict_term: 0,
};
assert!(ok.success);Fields§
§term: TermThe follower’s current term, for the leader to update itself.
success: boolWhether the follower accepted the RPC.
from: NodeIdThe node that produced this reply.
match_index: IndexHighest log index the follower now matches with the leader.
conflict_index: IndexOn rejection, the index the leader should probe next (the follower’s
first index of conflict_term, or its log length plus one when the log
is simply too short). 0 on success.
conflict_term: TermOn rejection, the term of the follower’s entry at prev_log_index, or
0 when the follower has no entry there. 0 on success.
Trait Implementations§
Source§impl Clone for AppendEntriesReply
impl Clone for AppendEntriesReply
Source§fn clone(&self) -> AppendEntriesReply
fn clone(&self) -> AppendEntriesReply
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppendEntriesReply
impl Debug for AppendEntriesReply
Source§impl Deserialize for AppendEntriesReply
impl Deserialize for AppendEntriesReply
impl Eq for AppendEntriesReply
Source§impl PartialEq for AppendEntriesReply
impl PartialEq for AppendEntriesReply
Source§fn eq(&self, other: &AppendEntriesReply) -> bool
fn eq(&self, other: &AppendEntriesReply) -> bool
self and other values to be equal, and is used by ==.