pub struct ReadProbe {
pub term: Term,
pub leader: NodeId,
pub seq: u64,
}Expand description
A leader’s read-confirmation probe, the network half of a linearizable read.
To serve a read that reflects every previously-committed write, a leader must
confirm it is still the leader at the moment of the read — a deposed leader
that has not yet learned of its fall could otherwise answer with stale state
(the ReadIndex protocol, Raft thesis §6.4). The leader sends ReadProbe to
every other voter and waits for a quorum of ReadProbeReplys carrying the
matching seq before releasing the read. The probe carries no log data and
changes no state; it is a pure leadership check.
§Examples
use raft_io::ReadProbe;
let probe = ReadProbe { term: 5, leader: 1, seq: 42 };
assert_eq!(probe.seq, 42);Fields§
§term: TermThe leader’s term.
leader: NodeIdThe leader issuing the probe.
seq: u64A monotonic confirmation-round number, echoed back in the reply so the leader can tell which round a reply confirms.
Trait Implementations§
Source§impl Deserialize for ReadProbe
impl Deserialize for ReadProbe
impl Eq for ReadProbe
Source§impl Serialize for ReadProbe
impl Serialize for ReadProbe
impl StructuralPartialEq for ReadProbe
Auto Trait Implementations§
impl Freeze for ReadProbe
impl RefUnwindSafe for ReadProbe
impl Send for ReadProbe
impl Sync for ReadProbe
impl Unpin for ReadProbe
impl UnsafeUnpin for ReadProbe
impl UnwindSafe for ReadProbe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more