Skip to content

Expose legacy merge progress and uncertain writes to the master - #418

Merged
beinan merged 3 commits into
mainfrom
codex/legacy-merge-progress
Oct 20, 2026
Merged

beinan merged 3 commits into
mainfrom
codex/legacy-merge-progress

Conversation

@beinan

@beinan beinan commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Legacy merge requests can time out while a worker is waiting for a slot, still making progress, or has an uncertain storage commit. Today the master records only the HTTP failure, leaving operators unable to identify the execution behind the stall.

Instrument legacy worker HTTP merges and self-merge passes with process-local execution IDs, slot/running/returned/interrupted states, actual work counters, and outstanding/uncertain commit observations. Master obtains a bounded snapshot after an ambiguous legacy RPC failure and puts a small typed summary in the task error. The read-only endpoint does not open stores or contact etcd. Registry/history/response limits explicitly report lost coverage and do not reject work.

The legacy scope is observation-only: it preserves existing cancellation and slot lifetimes instead of spawning detached storage work. Caller cancellation during an admitted commit records uncertainty. These observations never authorize takeover and do not change serial fan-out, fencing, migration admission, or automatic table enrollment. Other processes, old binaries, and evicted history remain outside their coverage.

Validation: five local server tests passed, including sustained concurrent healthy/frozen execution isolation, interrupted/slot-wait states, bounded registry/history, etcd-independent status access, and a real three-generation self-merge proving reclamation without attributing ingestion flushes to maintenance. Final-commit CI test compilation and all three wheel builds passed. Master legacy fan-out, core cancellation/uncertainty, and the remaining CI suites are still running; this is not a deployment report.

@beinan
beinan marked this pull request as ready for review October 20, 2026 22:37
@beinan
beinan merged commit 792694e into main Oct 20, 2026
11 checks passed
beinan added a commit that referenced this pull request Oct 20, 2026
…419)

Masters currently bypass execution fencing for compact/index/repair on
tables outside `MERGE_OWNED_TARGETS`. A stuck operation on a newly hot
legacy table can therefore retain an untracked write even though the
native recovery machinery exists.

Add an opt-in `MASTER_FENCE_LEGACY_MAINTENANCE=true` mode that uses the
existing durable admission, real-progress watchdog, commit permits and
storage recovery barrier for new rollout/generic master maintenance
executions. Prepared compaction/index work keeps its separate
preparation phase. The execution scope also observes successful file IO
so long scans need not finish an entire phase to demonstrate progress.
Recovery scans continue resolving recorded protocol-2 maintenance
executions after flag rollback.

This does not change worker merge admission, enroll legacy tables into
native merging, fence pre-upgrade writes, change datagen behavior, add
Pods, or stop ingestion. It is the master-write prerequisite for safe
automatic handoff, not a claim that handoff is complete. The flag
defaults off for a measured canary rollout.

Validation: all 13 maintenance execution tests passed against isolated
local etcd 3.7.0, including successful real file reads across multiple
idle windows, all three stalled legacy maintenance kinds, version
fencing before successor execution, flag rollback with an unresolved
barrier, and preserved retry budgets. The source hashes matched the
tested commit at completion. Rebased onto main after #418 merged;
final-head CI is running.

---------

Co-authored-by: Beinan Wang <beinanwang@microsoft.com>
beinan added a commit that referenced this pull request Oct 21, 2026
)

The worker rollout compaction endpoint currently accepts untracked
base-table rewrites even when the table is draining or configured for
owned maintenance. That bypass can race the master’s fenced recovery and
handoff.

Apply the existing legacy admission check before opening the table or
acquiring its write lock. Owned/draining tables use the master’s fenced
maintenance path. The regression test holds a live reader while checking
immediate rejection for both protected states, and exercises successful
compaction for an ordinary legacy table.

Validation: formatting and diff checks passed. The first Clippy run
found unused response values in the regression test; the final commit
now checks the create status and compaction result explicitly. Rebased
onto main after #418 merged. The focused local regression passed on the
initial functional patch (1 passed, 0 failed); response assertions were
tightened afterward. Final-head CI must pass before merge.

This closes an HTTP compaction bypass; automatic hotspot enrollment and
durable legacy worker admission remain separate unfinished work.

---------

Co-authored-by: Beinan Wang <beinanwang@microsoft.com>
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