Repository navigation
feat: add opt-in replica spreading for WAL source reads - #468
Merged
Merged
Conversation
beinan
force-pushed
the
codex/wal-distributed-preparation-public
branch
from
October 22, 2026 09:47
d0e8259 to
6e767f4
Compare
beinan
marked this pull request as ready for review
October 22, 2026 10:48
beinan
changed the base branch from
codex/wal-distributed-preparation-public
to
main
October 22, 2026 10:48
beinan
force-pushed
the
codex/wal-source-fetch-spread-public
branch
from
October 22, 2026 10:48
30e0736 to
83a158e
Compare
beinan
added a commit
that referenced
this pull request
Oct 22, 2026
A bounded source scan can encounter only records from other tables. The worker previously released its claim and discarded the scan cursor, then started from the same durable checkpoint on its next claim. A table behind more than one scan budget of retained foreign records could remain unpublished indefinitely. Retain the empty-page scan hints per fixed worker assignment and move them through claim jobs. Hints are checked against the complete table binding, contain only quorum-observed ranges without that table's records, and never advance durable checkpoints. Scan limits, claim rotation and publisher fencing remain unchanged. Restart may rescan those ranges safely. Refs #378. Built on merged #466, #468, #469, #470 and #471. Validation: - Real three-replica WAL, etcd and Lance regression: a target behind 129 retained foreign records fails with the old worker and publishes its exact payload with the fix, while another table remains unpublished. - Materializer, worker, service and service/http-client feature Clippy checks; ingestion and etcd-backed worker recovery suites. - Full repository CI helper, including Rust/Python tests, formatting and lint/type checks. The first worker-suite run encountered an existing lease-revoke timeout with slow local etcd synchronization. The unchanged suite passed on a fresh run with the same storage and deadlines; the original failure was retained. This change fixes publication progress and does not claim a throughput improvement.
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.
When multiple preparers read a WAL group, every payload currently starts at the first configured voter. Add the opt-in
source_read_policy: spreadsetting to distribute initial reads by immutable group/index while retaining every other voter as a fallback. The default remainsfirst_voter.This changes read placement only: exact source-pin matching, payload/schema validation, fetch concurrency, reservations and manifest authority stay in place. The selection hash touches two integers and does not hash or copy payload buffers. It applies to both buffered and streamed preparation, including remote preparers.
Validation covers real Lance recovery, exact retries and retirement, plus a network failure test that leaves only one payload endpoint reachable at a time, exercising each replica as the sole source. An independent Rust process fixture also recovered 192 MiB of acknowledged/unpublished records after all nine WAL processes were killed and reopened, followed by a preparer crash/cache loss; all 64 records and columns were read back without producer replay.
A controlled cloud comparison is queued; no throughput benefit has been established, so this option remains disabled by default. The qualified candidate includes the directory-lock fix from #465; final CI will validate the combined source after dependency promotion.
Built on merged #466 and #465. Refs #378.
Testing
An additional 10-minute local endurance run published 9,447 MiB / 3,149 rows through two preparers. All columns and the aggregate remained correct after killing and reopening all nine WAL processes, with no producer replay or restarted publisher. Each node completed 9–10 checkpoints and collected 16–18 obsolete files. The run also had 619 producer retries and repeated leader-term changes under shared-disk pressure; it establishes recovery after this finite workload, not a throughput gain or stable capacity.