Repository navigation
island spares: settle without clocks, unconfirmed rollback stops quarantine the spare (#885 follow-up) - #920
Open
michaellchung wants to merge 3 commits into
Open
michaellchung wants to merge 3 commits into
michaellchung wants to merge 3 commits into
Conversation
michaellchung
force-pushed
the
own/island-spares-followup
branch
from
November 26, 2026 21:35
f5b60b9 to
4b047ed
Compare
…antine the spare - A spare whose start failed and whose stop of that start is not confirmed is treated as lost: quarantined with the stop it owes and the lease holder, its claim and kept lease held, so no island of any run picks it. - settle creates its marker, then reads the record again and removes the marker once the record no longer lists that stop; no tombstone clock is compared. Marker names encode each field (urlsafe base64, dot-joined). - release-node writes no tombstone into the lease store; a store or ledger failure is a message and exit 1, not a traceback. - Spare quarantines (refused, start failed) carry the lease holder. - A pick whose lease step raises gives its claim back; the picks so far are given back when a later pick raises. - The owed stops of a node picked again run in the background, outside the ops lock; owed_kill_script quotes its trap for any name. - own_quarantine turns read and listing failures into an unreadable record. - node_quarantine: run_store_quarantines and trainer_pick_excluded (the trainer pick's exclusions, shared with a pick prediction). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arnation numbers, synchronous owed stops) - A spare lost at a rollback gives its claim up (its quarantine keeps every island off it), gets an owed ledger row of its own, and the incarnation's row closes when only such spares failed to confirm. - A failed start keeps its incarnation number; an incarnation not confirmed stopped on a node is carried back to the old islands and stopped first at the next try. - A settled-marker listing failure returns the record unfiltered with read_error; _owes and _still_owed count an unreadable record as owed; quarantine() never writes over a record it could not read; release-node asks to be run again later on a read error. - The owed stops of a candidate released elsewhere run synchronously in its checks (outside the ops lock, before any start), one per node at a time; a candidate whose stop fails is passed over with the reason. - release() removes the record before the markers; a settle whose second read raises removes its marker. - The steps after the pick run inside the rollback's try. - The owed stop's trap quotes each path word; the trainer pick also reads the run store's quarantines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arantines kept in memory - down() releases every earlier incarnation not confirmed stopped on a node (a failed start on spares) before the current one; while one is not confirmed it returns False and the island keeps its leases, claims and rows. - A quarantine the store refuses is kept in memory (IslandSpares.pending): the node is left out of this island's picks, owes its stops (_owes, _still_owed; a lost node also gets its owed ledger row at once), keeps the island's claim, and every check and down() writes the record again, then gives the claim up. A confirmed stop drops its owed row from the pending quarantine. - A candidate whose run ledger cannot be read is passed over this round (release_owed_elsewhere(strict=True) raises LedgerUnread). - Tests for each reviewer counterexample and mutant: a rollback whose only unconfirmed stop is a lost spare carries no unreleased incarnation; an unhealthy candidate runs no owed stop; an owed stop that raises passes the candidate over; two refused quarantines of one node owe both stops. - Docs: the candidate checks have no overall deadline; down() and refused quarantines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michaellchung
force-pushed
the
own/island-spares-followup
branch
from
November 26, 2026 22:22
4b047ed to
140e96a
Compare
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.
Summary
Follow-up to #885 (own-cluster group 4, spare nodes for resident ssh trainer islands): the low-severity review items of its fifth review, and the fixes of this PR's own review.
owed) and the lease holder, that stop in an owed ledger row of its own (priced as that node, open until the stop is confirmed), its claim given up (the record keeps every island off it) and its lease kept. The incarnation's own row closes when only such spares failed to confirm. No island of this run or another can pick it untilyeto cluster release-node; once released, any island can.fleet/nodes/<name>/settled/), then reads the quarantine record again. If the record no longer lists that stop (released, or quarantined anew), it removes the marker, so none is left behind. A record that only gained another stop keeps the marker. Thereleased.jsontime is no longer read; it stays in the run store as a record of the release.., which never appears in the encoding.",$(...), backticks or'expands nothing there. (kill_scriptitself, shared with the golden-locked launch scripts, still double-quotes its paths; such names are not validated today.)read_error): it counts as quarantined,_owesand_still_owedtake its stops as owed,quarantine()refuses to write over it, and release-node asks to be run again later (not--force). When only the settled markers cannot be listed, the record comes back unfiltered withread_error(every stop owed; each is idempotent) and still counts as quarantined at a start.release()removes the record before the markers; a settle whose second read raises removes its marker. A loss whose quarantine cannot be written keeps the island's claim.node_quarantine.run_store_quarantines(objects, names, *, log=None)reads a run store's quarantine records the wayshared_quarantinesreads a lease store; an unreadable record counts.node_quarantine.trainer_pick_excluded(names, *, lease_objects=None, run_objects=None, assigned=(), log=None) -> (excluded, quarantines, note)is the trainer pick's exclusion set.lease_trainer_nodesuses it with the run's lease objects,assignedand the run store's objects (_run_store_objects(args)), so a prediction made with the same arguments matches the pick.docs/OWN_CLUSTERS.mdstates the settle and rollback behaviour.Tests
tests/test_ssh_island_spares_recovery.py, new cases:quarantine()does not write over it, release-node asks to be run again later;down()until release-node confirms the stop; the incarnation's row closed;",$(...), a backtick or'in the name passesbash -n, expands nothing and writes the marker at the literal path.run_store_quarantinesandtrainer_pick_excludedcover broken JSON, read errors, listing failures, the union with the lease store andassigned, and the note.Results:
assigned, the run store, a listing failure, the wrong key, the trainer pick ignoring the set), the stale-lease quarantine guard;_still_owedand_owesskipping unreadable,quarantine()writing over an unread record, release-node forcing on a read error, a start skipping a listing-failure record, a failed quarantine giving the claim up; the owed stop not run in the checks, a failed one still a candidate, no per-node lock; markers removed before the record, a marker kept when the second read raises; the health watches outside the try; the trap words unquoted or not one word; the trainer pick without the run store; a stale lease not held released.--timeout=600, one process per shard, on base b65c3a0; the rebase onto 1a5d22f adds two test files only, rerun here with the spares files: 190 passed): 18505 passed, 377 skipped, 11 xfailed; one failure outside this change,test_bulk_resend.py::test_slow_receiver_of_a_rejoin_catch_up_does_not_stall_rounds_or_leases[inline-old-behavior](a syncer timing test; reported, not rerun). The real-syncer spares e2e passes in its shard.Customer gate
🤖 Generated with Claude Code