pub fn upsert_source_offset(
txn: &mut ApplyTxn,
source: &str,
offset: &str,
chunk_seq: i64,
run_id: Option<&str>,
) -> Result<(), ReplicaError>Expand description
Upsert the durable (offset, chunk_seq) checkpoint for source into txn (co-transactional
with the effects that txn carries — a crash can never land data without its cursor, §4). Shared
by the whole-batch (ApplyConsumer::commit_normalized_with_offset) and streaming-follower
(ApplyConsumer::commit_follower_txn) commit paths. A whole-run commit passes
[SOURCE_OFFSET_WHOLE_RUN]; a mid-run segment passes the boundary chunk’s chunk_seq.
run_id is the run’s identity token from its begin frame (the fencing proof echoed on the
next subscribe — RELAY-CURSOR-EPOCH-FENCING-DESIGN.md §2); None (a pre-fence upstream or a
non-streaming source) stores NULL, which subscribes without a fence as before.