Release 2.4.0 — format 4 tier B: leader batching + verdicts#22
Merged
Conversation
Completes two-tier writes (Design §6). Constraint-bearing statements normally race slots exactly as in format 3; when the contention heuristic trips (two slot losses in one commit, or rescue after an exhausted retry budget), writers queue their statement as an ordered intent instead. Any waiting writer that finds the lease free elects itself leader, plans every pending intent sequentially against a virtual manifest (the in-process group-commit machinery promoted across process boundaries), and lands the batch as ONE log slot with per-intent verdicts — RETURNING rows or a precise error — embedded in the entry. Waiting writers learn their fate from the log-tail reads they already do. Safety: the lease stays a performance mechanism (slots arbitrate); a verdict on record makes a leftover intent cleanup, never work, closing the crashed-leader window by construction. The one real bug the harness caught: concurrent request handlers share the proto's writer identity, so lease acquisition alone let N waiters elect N simultaneous leaders (8x over-applied counter) — all lease work now serializes through one per-instance chain. Harness datapoint: 24 concurrent ordered updates from 3 instances landed as a single log slot. 240 checks green (10 new), live suites + stress/property over real Blob. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI caught the tickets check reading 400ms after two instances' appends — too early when their folds serialize behind one lease (150ms poll cycles). Not a correctness bug: the qlog showed every intent durable and the second fold still lease-waiting; the design says appends are durable at ack and visible at fold. The suite now polls for the condition (waitFor, 5s cap) at every fold boundary, and the fake S3 keeps an env-gated queue/log traffic journal (LARVA_DBG) for the next flake hunt. 6/6 local runs green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The second half of format 4 — tier B: ordered intents, lease-elected leader batching, verdicts in log entries — completing the committed track from the design (PR #19). Client-side behavior on the same on-store format; no new format bump.
How it works
ConflictErrorrescue after an exhausted budget) flips the instance into queue mode for 10s — statements ship asorderedintents (SQL + params, shippable as data; transactions never travel this path).The bug the harness caught (worth reading)
First run: hot counter at 188 instead of 24. Concurrent request handlers inside one instance share the proto's writer identity, so
tryLease's "holder is me → renew" path let every concurrent waiter elect itself — eight simultaneous leaders each executing the full batch. Fix: all lease-holding work (folds + leader passes) now serializes through one per-instance chain. The design doc records the subtlety.Verification — 240 checks green (10 new)
PRIMARY_KEY_CONFLICT) propagates to the right writer; planted crashed-leader intent executes exactly once, re-planted one is swept without re-executing.--log(zero lost updates), property--log(model holds) — real Blob store.Merging publishes 2.4.0 to npm as
latest— the committed implementation track (auto IDs → intent queues → cross-process group commit) is then complete.🤖 Generated with Claude Code