Expand description
REP-1 STEP 5 (B): the syncup wire protocol (feeder<->replica matchpoint negotiation).
Port of the syncup message exchange in FeederReplicaSyncup.java /
ReplicaFeederSyncup.java, using the message set from
BaseProtocol.{EntryRequest, Entry, EntryNotFound, AlternateMatchpoint, StartStream, RestoreRequest, RestoreResponse}.
§Handshake
The replica drives a backward search over its own log (the
crate::stream::syncup_reader::SyncupLogView) and asks the feeder, for
each candidate matchpoint VLSN, “do you hold the same record at this VLSN?”
(EntryRequest). The feeder answers with:
SyncupMsg::Entry— “yes, here is my record at that VLSN” (JEEntry);SyncupMsg::EntryNotFound— “I do not hold that VLSN” (below my range) (JEEntryNotFound); orSyncupMsg::AlternateMatchpoint— “that VLSN is above my range; here is my highest sync point as a counter-offer” (JEAlternateMatchpoint, only on the first exchange).
When the records match (same LSN + fingerprint), the replica sends
SyncupMsg::StartStream with matchpoint+1 and the two converge.
Otherwise the replica scans to its previous sync point and repeats. If the
search walks past the replica’s contiguous range, the replica sends
SyncupMsg::RestoreRequest and falls back to network restore
(ReplicaFeederSyncup.setupLogRefresh).
This module is the transport of that negotiation. The matchpoint
decision is crate::stream::syncup::find_matchpoint /
crate::stream::syncup::verify_rollback; the rollback execution is
REP-1 STEP 5 (C). The driver in crate::stream::syncup_reader and the
wiring in replicated_environment glue the three together.
Enums§
- Syncup
Msg - One syncup-protocol message. Wire form: a 1-byte opcode followed by a
fixed body (little-endian). Mirrors the
BaseProtocolmessage classes used during syncup. - Syncup
Outcome - Result of the replica’s side of the syncup handshake.
Constants§
- SYNCUP_
SERVICE_ NAME - Service name registered with the dispatcher for the syncup handshake.
Functions§
- feeder_
syncup_ handshake - Run the feeder’s side of the syncup handshake over
channel, answering the replica’sEntryRequests from the feeder’s local log view. - local_
matchpoint - Compute the agreed matchpoint by running the replica handshake against a
LOCAL feeder view (no channel) — the in-process fast path used when both
nodes share an address space (the test harness). Equivalent in result to
running
replica_syncup_handshake+feeder_syncup_handshakeover a real channel. - replica_
syncup_ handshake - Run the replica’s side of the syncup handshake over
channel, driven by the replica’s local log view. - vlsn_
entry - Build a
VlsnEntry(helper for callers constructing feeder views).