contract store · 10-store.md · 11-snapshot.md · 12-time.md · 13-replica.md · 14-drain.md · 15-endpoint.md · 16-collect.md · 17-merge.md · 18-pull.md · guide · card
Unpushed runs
Replacing a disposable disk loses committed runs that have not reached the bucket.
The execution database marks each run from opening until a push carries it, and commands, pipeline serve shutdown and release checks read the mark.
drain
Tracking unpushed runs, retrying pushes before reads, pushing during shutdown and reporting status to release checks.
marktesttestUnderpostgresorcloudflare-d1, opening a run marks its rowunpushedwith the node before landing commits; closing clears the mark when no table the push includes holds a manifest of the run.record-unmarkedtestThe store’s run record keeps each run row withoutunpushed; only the execution database holds the mark.Why
because a rebuilt execution database restores rows from the run recordcleartesttestA committed push clears each mark whose run manifest its included tables held at push start or its committed bucket manifest lists. It setsloston other marks with no local manifest and no live owner, naming them on stderr.Why
because no retry restores a commit the store has lostbefore-readtestUnder these profiles,before-runpushes after pulling for unlost marks on its node with a local manifest or expired owner lease. A failed push names those runs and stops the command before its first read.deadlinetestOn a stop signal,pipeline servewithpush_after_runends its children, then pushes for its node’s marks meetingbefore-read, for at most 15 s.Why
because a platform kills a stopping process after its grace periodunfinishedtestA shutdown push failing or exceedingdeadlinekeeps the run marks and names the runs on stderr, andpipeline serveexits non-zero.Why
because a release step reading a clean exit as a carried store discards the missed runsstatustesttestcontextful sync statusprints JSONerror, the countsopenandlostof marked runs, andruns, each with pipeline, table, node, end instant andlost; any run notlostreportsSyncRunsUnpushed, exiting 3.Why
because a release step replacing a container discards each unpushed runstatus-summarytestWithout--all,runslists at most 20 runs of each kind,lostand not, in run id order; the counts still number every marked run.Why
because a caller keeping a bounded tail of stdout parses the whole document, and the counts carry what the list leaves outstatus-alltestsync status --alllists every marked run inruns.Why
because an operator auditing every mark reads the full list on request, apart from the release gate’s bounded readstatus-unreadtestAsync statusfailing to read the execution database printsrunsas null anderrorasSyncStatusUnreadwith its cause, exiting 1.Why
because a release gate tells a store holding unpushed runs from a check that read nothingprunetestA committed push clears eachlostmark, any node’s, more than 7 d afterclearset it, keeping the run row; a mark lost without its instant takes the push’s.Why
because only a push setslost, so pruning there bounds the marks to one window of losses while status stays a read
Scenarios
store.drain.mark: WHEN a process terminates after a run’s local commit and before its push, THEN the run row stays marked and the next push uploads the run.store.drain.before-read: WHEN the bucket refuses a run’s push and then accepts a push fromrun start, THEN that start pushes the marked run before opening its own run.store.drain.clear: WHEN a replacement disk holding none of a marked run’s files pushes, THEN the run turnslostandsync statuslists it without refusing.store.drain.clear: WHEN a disk whosepull_tablesexcludes a marked run’s table pushes while the bucket lists that run’s manifest, THEN the mark clears and the run never turnslost.store.drain.status-summary: WHEN the execution database holds 300 lost marks and one open mark, THENsync statuslists the open run and 20 lost runs, counts 1 open and 300 lost, and exits 3.store.drain.prune: WHEN a push settles while one mark turned lost 8 d before and another 6 d before, THEN the push clears the first mark and the second stays listed.store.drain.unfinished: WHEN a stopping serve’s push waits on a push guard past 15 s, THEN serve exits non-zero and the run stays marked.