Skip to main content

Module commit_landing_loop

Module commit_landing_loop 

Source
Expand description

The landing loop with replay, revalidation and the starvation reservation. What: The landing loop: land, and after each lost race replay and revalidate outside both locks, until the commit lands, its replay conflicts, revalidation rejects it, or the target cannot take it. Why: Each replay rebuilds the prepared commit from the preparation base onto the target that won, so every replay starts from the same prepared change. After landing.reserveAfterLostRaces lost races the transaction takes the landing reservation before it replays, and every landing attempt yields to another transaction’s live reservation; the reservation is released when the loop ends (src/policy-engine/commit-landing-loop.ts).

In TS you’d write (pseudocode):

const outcome = await landWithReplay({ context, mode, prepared, settled, options, committedPaths, ... });

Structs§

LoopInput
What: The inputs of the loop. Why: Replay and revalidation reuse the invocation’s facts.

Enums§

LoopOutcome
What: How the loop ended. Why: A landed commit continues to post-landing completion; a failure carries the complete events and the status.

Functions§

land_with_replay
What: Land a prepared commit, replaying and revalidating after every lost race. Why: The landing lock is taken for one attempt only and released before any replay or revalidation work, so a loser never blocks the others while it rebuilds its commit.
lost_races_after
What: The count of lost races once one more race is lost. Why: The reservation threshold and the race-lost marker occurrence both read this count.
next_attempt_number
What: The landing attempt number that follows a lost race. Why: The attempt number names the attempt’s landing files, so two attempts of one commit never share a name.
replayed_events
What: The events of one replay: the lost race, the replayed commit, and the dropped signature headers when there are some. Why: The incumbent prints them in this order, and the headers event only when the rebuild dropped a header.
union_paths
What: The paths of a replay: those already committed, then the ones revalidation added that are new. Why: A path both lists name is one path of the commit.