Skip to main content

Module syncup_protocol

Module syncup_protocol 

Source
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:

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§

SyncupMsg
One syncup-protocol message. Wire form: a 1-byte opcode followed by a fixed body (little-endian). Mirrors the BaseProtocol message classes used during syncup.
SyncupOutcome
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’s EntryRequests 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_handshake over 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).