Skip to content

Narrow the outbox watermark fence to its allocation-proof core - #44

Merged
ewhauser merged 1 commit into
mainfrom
fence-hold-time
Aug 5, 2026
Merged

Narrow the outbox watermark fence to its allocation-proof core#44
ewhauser merged 1 commit into
mainfrom
fence-hold-time

Conversation

@ewhauser

@ewhauser ewhauser commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Fixes #36 — the exclusive fence now covers only what the C-S2 allocation proof requires (fenced candidate read + publication + atomic commit/release); lease renewal, config, observations, and the durable heartbeat moved out, each with a stated fence-free argument (table in the review record). Convoy regression uses deterministic lock gates including the dangerous lower-uncommitted/higher-committed gap during the unfenced heartbeat — safe_seq provably stays below the gap. Bonus fixes: committed progress no longer suppressed by heartbeat failure; canceled heartbeats leave no leaked fence. All existing stream/outbox/streamclient tests unchanged.

Built and adversarially reviewed by paired Codex sol-xhigh agents in a dedicated worktree (parallel batch #33#38). Full gate green locally.

🤖 Generated with Claude Code

The watermarker's exclusive advisory fence covered lease renewal,
configuration, the fenced read/publish, commit, observations, and the
durable heartbeat, so a queued exclusive waiter convoyed shared outbox
writers behind the whole step. The exclusive section now covers
exactly what the C-S2 sequence-allocation proof requires -- the
candidate watermark read and publication in one fenced transaction,
committed atomically with the lock release -- while lease work happens
before acquisition (revalidated inside the fenced transaction),
observations operate on in-memory state after commit, and the
operation heartbeat runs post-commit through the pool. Each moved
operation carries its fence-free argument in the review record.

The convoy regression uses deterministic lock gates: a leading shared
writer, a queued exclusive watermarker, and a queued shared writer,
then the dangerous gap interleaving -- a late lower sequence held
uncommitted while a higher shared writer commits during the unfenced
heartbeat -- proving safe_seq stays below the gap until the next
fenced step. Also fixed en route: a post-commit heartbeat failure no
longer suppresses the committed progress observation, and a canceled
heartbeat provably leaves a complete watermark with no leaked fence.
Every existing stream, outbox, and streamclient test passes unchanged.

Fixes #36

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ewhauser
ewhauser merged commit e171b56 into main Aug 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimize outbox watermark fence hold time to avoid writer lock convoys

1 participant