Skip to content

fix: avoid fleet scans during dedicated merge admission - #307

Merged
beinan merged 1 commit into
mainfrom
codex/target-local-merge-admission
Oct 5, 2026
Merged

beinan merged 1 commit into
mainfrom
codex/target-local-merge-admission

Conversation

@beinan

@beinan beinan commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Dedicated catch-up processes can time out claiming a free table because startup and each claim sweep every running task. This change makes dedicated startup, admission and completion target-local; ordinary recovery batches healthy-claim checks and reads running tasks in bounded pages. Blocked queue candidates are rejected before allocating leases, while final ownership comparisons remain authoritative.

Start lease renewal before publishing a claim, verify our unique token after a lost transaction response, and let an already admitted claim attempt finish across the retry deadline. This prevents a successful claim from being discarded by the outer timeout. Storage fencing, merge concurrency and retry budgets are unchanged.

Validation:

  • Workspace test build, master all-target check, formatting and diff checks pass.
  • Master tests: 63 ordinary tests and all 67 etcd-backed HA tests pass on native local etcd (4 test threads). An earlier x86-emulated etcd run suffered multi-second RPC latency and 11 timeout/lease-sensitive failures; the complete suite passed after switching to the host architecture.
  • Isolated staging etcd: target isolation, live/expired ownership, paginated recovery and unique-token lost-response tests pass.
  • Three staging samples with 80 healthy running tasks: old sequential recovery scan 6.31–6.67 s (median 6.44 s), batched recovery 0.43–0.46 s (median 0.43 s), complete exact-target claim 0.58–0.60 s (median 0.59 s). These are admission/control-plane timings, not end-to-end merge throughput; the old scan excludes the additional work of claiming.
  • Self-review confirmed final claim/recovery CAS predicates remain authoritative; a stale preflight cannot grant ownership or requeue a newly claimed task. CI must pass before merge; production acceptance also requires subsequent WAL publication.

@beinan
beinan marked this pull request as ready for review October 5, 2026 08:34
@beinan
beinan merged commit 84121dc into main Oct 5, 2026
11 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.

1 participant