Skip to main content

restore_txn_index_entry_valid

Function restore_txn_index_entry_valid 

Source
pub fn restore_txn_index_entry_valid(
    previous_last: Option<i64>,
    entry: RestoreAbortedTxn,
    segment: RestoreSegmentExtent,
) -> bool
Expand description

Validate one decoded aborted-transaction index entry against the previous entry’s last_offset.

An aborted transaction is indexed in the segment that holds its abort marker, in marker order, so last_offset (the marker) lies inside the segment and strictly increases across entries (Kafka’s TransactionIndex.append rejects a non-increasing lastOffset, and TransactionIndex.sanityCheck requires lastOffset at or past the index’s start offset). start_offset is neither bounded below by the segment base (a transaction may span a segment roll) nor ordered across entries (transactions interleave: one opened later can abort first).