fn record_progress<P: PartialEq>(
acc: &mut Vec<SsaRecoveryProgress<P>>,
snapshot: SsaRecoveryProgress<P>,
)Expand description
Merges a snapshot into the batch’s pending set, keeping the furthest-along one per SSA.
Concurrent batches share a cycle’s counters, so snapshots taken microseconds apart can be unordered. Keeping the maximum means one batch never reports its own SSA going backwards.
Merged componentwise rather than by choosing one snapshot whole, because the counters are two
independent axes and a batch can advance either alone. A surplus share moves only shares_seen,
so selecting on useful_shares discarded exactly the snapshots that say an Entry is still
serving during a surplus run — the run this crate emits Progressed for in the first place, and
the axis the Session layer’s egress gate and idle deadline both read. Selecting on shares_seen
instead would only move the same defect onto the other axis, since the two orderings disagree
precisely when a snapshot is worth keeping.
Every field merged here is monotone over a cycle’s life, so the componentwise maximum is itself a
reachable state rather than an artefact. target_useful_shares is fixed at construction and
ssa_id is the key, so neither is merged.