pub enum SnapshotMarker {
Begin,
End(u64),
Ping {
generation: u64,
next_offset: u64,
},
}Expand description
Decoded snapshot marker, returned by decode_snapshot_marker.
Variants§
Begin
+SNAPSHOT\r\n — primary is about to stream snapshot chunks.
End(u64)
+SNAPSHOT_END <ack_offset>\r\n — end of snapshot; the next
live frame’s offset will equal ack_offset.
Ping
+PING <generation> <next_offset>\r\n — v3.14 in-stream
heartbeat: the primary’s current feed generation + next_offset,
sent every ~1s so a replica can compute its own lag (applied vs
primary) and judge link liveness without a request/response
round trip. Out-of-band: occupies no offset space.
v3.16 D2 added the generation (REPL.TOKEN / REPL.WAIT compare
token generations against the replica’s last-seen upstream
generation). A legacy one-number +PING <next_offset>\r\n line
still decodes — generation reads as 0, the “unknown” value
no real feed ever serves (feed generations start at 1).