- hostlimit: Config.FetchSlots (default 64, files fetch-0..N-1 in the pool).
HoldFetch takes a free slot without waiting, from the key's hash slot;
with every slot held it blocks on its hash slot (the kernel queues the
waiters) and tries the other slots every 20 ms, using whichever lock comes
first and releasing the other; its context bounds the wait, and a lock got
after that is released at once. lockBlocking on Unix and Windows.
- storage: BudgetFetch; fillOnce holds one slot across its remote read only
(a read miss and a hydrate-all fill alike); a context error on the wait is
the hydration path's pending, as before.
- blockvolume: --host-limit-fetch-slots. Invariants: INV-HOST-FETCH-CAP-001;
M7 states it. v1.1 notes carry it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seams: Config.FetchSlots (default 64), fetchSlot (a key's hash slot),
Limiter.HoldFetch (no cap yet) and storage.BudgetFetch.
- TestHoldFetchCapHoldsAcrossProcesses: with every slot held by other
processes, a fetch waits until one is released, then takes it. Fails here.
- TestHoldFetchAWaiterThatGivesUpLeavesNoSlotHeld: a waiter past its context
returns the context's error, and a slot it gets after is released at once.
Fails here.
- TestHoldFetchTakesAnotherSlotThatFreesFirst: a waiter behind a slow holder
of its own hash slot takes another slot within one retry interval of its
release. Fails here.
- TestHoldFetchTakesAFreeSlotAtOnce: a fetch with a free slot does not wait
(holds here, must keep holding).
- TestChunkFetchHoldsAHostSlotAroundItsRemoteRead: a chunk fetch holds one
slot exactly across its remote read. Fails here: none is held.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
requeue is set by an admitted attempt that fails and cleared only by a
success: a wait, a refusal or a dropped ticket (a reconcile, a pause) leaves
it set, so every later ticket of the turn is taken at the host's now.
INV-HOST-TICKET-REENTRY-001 states it and names the test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestChunkLoop_ARequeuedTurnStaysAtTheBackAcrossAWaitAndADrop: a cut admitted
on its ticket fails, its retry waits (not the head) on a tail ticket, and a
reconcile then drops it; the next ticket must not be earlier than the tail
one. Fails here: an unadmitted result clears requeue, so the new ticket is
back at the schedule's old due time, ahead of the cuts that queued meanwhile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the cut loop: an attempt admitted on its ticket that then fails retries on
a fresh ticket at the back of the queue (the host's now), never at its
schedule's earlier due time; a failed ticket creation is a wait (no cut,
the reason in status, the next poll tries again), never an un-ticketed cut.
- the limiter: an urgent admission refused after taking its urgent-pending
hold closes the hold, so no Normal admission stays refused for it.
- tests: the new concurrent tests and the ticket tests end their workers
with a bounded join on every path, a failing assertion too.
- invariants: INV-HOST-TICKET-REENTRY-001; the urgent row names its test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestChunkLoop_AConsumedAttemptRetriesAtTheBack: a cut admitted on its
ticket that then fails after staging is retried on a fresh ticket at the
back. Fails here: the retry's ticket is due at the schedule's old time
(even earlier than its first one), ahead of every cut that waited.
- TestChunkLoop_NoTicketNoCut: a timer cut that cannot take a ticket must
not cut un-ticketed. Fails here: it cut twice.
- TestRefusedUrgentAdmissionReleasesItsPendingHold: an urgent admission
refused after it took its urgent-pending hold gives the hold back. Fails
here: the hold leaks, keeping Normal admissions refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The change of this PR's 22 commits, carried onto current main as one
commit (its base was 1884 commits behind). Fitted to main:
- pacing: main's rule that fallback-only leases are not paced stays; a
healthy lease is paced at the budget over the held normal and urgent
slots (this PR's rule) instead of over the configured slot count.
TestFallbackDoesNotUnpaceAHealthyLease keeps its property (a healthy
lease beside a fallback lease is paced) with a 500 ms deadline, since a
lone holder now gets the whole budget.
- the cut loop keeps main's attempted hook and afterStaging (a failed
attempt that staged new chunks retries at the next poll), with the
ticket handling; the random retry delay is gone, as this PR intends.
- imports and constants: neither side's removed ones return.
- invariants: main's new rows and this PR's new and restated rows; the
slot-wait row is this PR's (ticket order, the next poll).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- expire decides and revokes in one step under the limiter's lock, reading
the last progress at that step: a progress report that completed before it
is always honoured.
- Progress takes no lock: it reads a lease index (sync.Map, kept with the
live set) and stores an atomic stamp, so it never waits behind an
admission's file-system work.
- the window runs on the monotonic clock: a stamp is time.Since of the
limiter's base, never a wall timestamp.
- the launch refusal of a pool written with other flags names
configuration.json and the cure (stop every process, remove it, start);
the v1.1 notes carry the hold change and the upgrade step; the upload
rate flag says the window must exceed one chunk's send time at it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seam: testExpireRace, run between a hold's expiry decision and its
revocation.
- TestProgressRacingTheExpiryIsHonoured: a progress report landing while
the expiry is decided must be honoured. Fails here: the decision is made,
the lock dropped, and the hold revoked anyway.
- TestProgressDoesNotWaitForTheLimiterLock: Progress must not wait for the
limiter's lock, which admission holds across file-system work. Fails
here: it takes that lock.
- TestProgressStampIsMonotonicElapsed: the progress stamp must be an
elapsed time on the limiter's monotonic base. Fails here: a wall-clock
timestamp, so a clock step revokes or keeps holds wrongly.
- TestLaunchMismatchNamesTheFileAndTheCure: the launch refusal of a pool
written with other flags must name configuration.json and the cure
(stop every process, remove the file). Fails here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hostlimit: Config.MaxHold (a fixed 5-minute hold limit) becomes
NoProgress (default 60 s). Progress(id) records the work's progress, with
no OS call; the hold's one timer, when it fires, arms again for the rest
of the window if the work progressed, and revokes otherwise. A hold whose
work keeps progressing is never revoked; a stalled one is revoked within
the window.
- blockvolume: --host-limit-no-progress; --host-limit-max-hold stays as a
deprecated alias of it.
- storage: BudgetProgress, the optional Budget that renews a hold; a cut
attempt reports one unit of work per chunk compared, staged or uploaded.
A hydrate-all holds one permit per chunk fill, so its hold is one fetch.
- invariants: INV-HOST-HOLD-NO-PROGRESS-001; M7 states the rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seams: Config.NoProgress (default 60 s), Limiter.Progress (a no-op for
now) and storage.BudgetProgress, the optional Budget that renews a hold.
- TestStalledHoldIsRevokedWithinTheWindow: a hold with no progress is
revoked within its no-progress window. Fails here: the fixed 5-minute
hold limit still governs.
- TestProgressRenewsTheHold: a hold whose work keeps progressing is never
revoked; once the progress stops, it is revoked within the window. Fails
here on the second half.
- TestCutReportsProgressToItsBudget: a cut reports progress at least once
per uploaded chunk. Fails here: no report. (A hydrate-all takes one permit
per chunk fill, so its hold is one fetch and needs no renewal.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- diagWriter is now the volume-delete command's stderr: Write never blocks
(queued in order to one writer goroutine, dropped when the queue is full),
so the sweeps, the error line written before stdout, the answer on stdout
and the exit never wait on stderr. close runs after the answer, waits at
most 200 ms for queued lines, then abandons a stuck writer: nothing more
is written. All of the command's stderr goes through it, so its writes
never overlap.
- deleteVolumeWithProgress writes to the stderr it is given (it must not
block) and no longer owns a writer.
- harness: a server whose launch failed reports 'not started', not running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestVolumeDeleteAnswerDoesNotWaitOnAStuckStderr: with a stderr whose
writes never return, the answer must reach stdout and the command exit as
with a fast stderr, within the bound plus a short drain. Fails here: no
answer and no exit in 10 s (the writer is joined before stdout is written,
and the error line is written to stderr before stdout).
- TestVolumeDeleteNeverWritesStderrConcurrently replaces the store-call
timing: a stderr not safe for concurrent use, 1 s per progress line, sees
no overlapping writes (holds here and must keep holding).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- diagWriter.close joins its writer goroutine: nothing the delete queued is
written beside the caller's later writes, so a stderr need not be safe for
concurrent use. The queue holds 4 lines, so after the answer is decided
close waits for at most 4 writes; sweeps and the answer never wait.
- registerWeedReport is called after each weed server's own stop cleanup,
so the latest one runs before every stop: a test that fails while its
cluster is still starting gets the report too; once per cluster, none for
a discarded start attempt (its failure message carried one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestVolumeDeleteAnswerDoesNotWaitOnASlowStderr now uses a stderr that is
not safe for concurrent use and flags overlapping writes, with 1 s per
progress line: the answer and exit must be a fast stderr's, the last store
call must come within the bound, and no two writes may overlap. Fails here:
after its 200 ms drain the writer goroutine still writes beside the
caller's final line.
- TestWeedReportCoversAFailureDuringTheStart: a test failing while its
cluster is still starting gets one report with every server still
running. Fails here (seam registerWeedReport).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- volume-delete: every progress line goes through a diagnostic writer whose
one goroutine owns the stderr writes; a line that finds its queue full
is dropped and printf never blocks, so a slow stderr delays neither a
sweep, the retry window nor the answer. Once the answer is decided the
command waits at most 200 ms for queued lines.
- process-test harness: a failed weed start (a server never listened, or
every attempt failed) is reported with each server's state and the
master's and the volume server's last lines, taken before the servers
are stopped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestVolumeDeleteAnswerDoesNotWaitOnASlowStderr: a stderr that takes 3 s
for each of the delete's progress lines must change neither the answer nor
the exit status, and the answer must come within the bound plus a short
drain. Fails here: the answer waited 15 s on stderr (bound 400 ms).
- TestWeedStartFailureCarriesTheReport: a failed weed start attempt's
message carries each server's state and the master's and the volume
server's last lines. Fails here (seam weedStartFailure).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sw-block ops chunk volume-delete: while a sweep makes no progress, stderr
says so every quarter of --timeout (at most every 5 s), with how long
nothing has moved, the object it waits on and the count so far; the bound
and the answer are unchanged.
- process-test harness: each weed server keeps its own exit status per start;
a failed test logs, as its own message, each server as running or exited
with its status and the master's and the volume server's last lines (the
volume server last, within what the CI summary keeps); the delete
helper's kill and deadline failures name the store's state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestVolumeDeleteReportsAStalledStoreWhileItWaits (sw-block): a store that
holds every object delete until its deadline; while the sweep waits, stderr
must say how long nothing has moved and the object it waits on. Fails
here: stderr has only the end-of-sweep count.
- TestWeedFailureReportNamesEachServerAndItsTail (blockvolume harness): a
failed test's evidence names each weed server as running or exited with
its status, then the master's and the volume server's last lines, inside
the 20 continuation lines the CI summary keeps. Fails here (seams
weedState and weedFailureReport return nothing); the cluster records each
server's exit status for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The diagram gains the Recovering -> Serving edge of the v1.1 attach's
upgrade, and the table its row: whole local chunks Rebuilt all, Hash,
Commit to HP with HEAD's hash only when the clean-stop proof holds (the
claim's own HEAD a committed, idle detach; the store's lineage; the store's
synced position), unknown otherwise; linked to INV-CHUNK-RECORD-SEED-001,
whose machine column now names the same transition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- layout: LocalRoot.ReportCleanStop is told, on each attempt of the claim's
own check, whether the HEAD the claim is built on is a committed, idle
detach (DetachedBy) carrying this root's claim id; the committing
attempt's report is the last. Never judged on Start's first read.
- durable: startLayoutRoot returns that clean stop; the provider carries it
into ChunkLayerConfig.CleanStop.
- storage: upgradeChunkRecordSeeded seeds only an unmarked store whose
layout claim id is the proof's and whose synced position (the pages'
valid-through) is the proof's; the attached HEAD at another position is
logged and never seeded on. A whole local chunk steps Rebuilt all, Hash,
Commit and takes HEAD's hash (a chunk HEAD does not name: the zero
chunk's). The upgrade's order is unchanged.
- invariants: INV-CHUNK-RECORD-SEED-001.
- tests: the attach takes the proof from its config
(TestV11AttachSeedsFromTheCleanStopInItsConfig); startLayoutRoot reports
it (TestStartLayoutRootReportsTheCleanStop).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A seam: CleanStop and LocalRoot.ReportCleanStop, never called for now.
- TestStart_ReportsTheCleanStopItClaimedFrom: a start at a higher epoch
on HEAD detached (committed, idle) by this root's lineage reports the
detach's position, the claim id and the generation. Fails here.
- TestStart_TheCleanStopIsTheClaimsOwnRead: the proof is judged on the
HEAD the claim's update is built on, its own re-read, not Start's first
read (a fake store answers the two differently). Fails here.
- TestStart_NoCleanStopWithoutADetachOfThisLineage: a live HEAD, a
detach with an open session, another lineage's detach and a continuing
claim report none (holds here, must keep holding).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The geometry control now includes 1024 blocks a chunk (a 64 GiB sparse
store): the held heap per chunk is the same as at one block (387 B on
v1.0, 436-439 on v1.1), because the map's wider coverage entry is the
on-disk page format, not the attached heap. The store's cleanup is
registered before the attach, so a failed attach still closes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A seam: ChunkCleanStop (the proof a start reads before its claim: HEAD a
committed, idle detach of this root's lineage at a position), upgradeSeed
(the proof, the attached HEAD, the zero chunk's hash) and
upgradeChunkRecordSeeded, which ignores the seed for now.
- TestUpgradeSeedsAfterACleanStop: with the proof at the store's synced
position and the store's own lineage, every whole local chunk is HP with
HEAD's hash (zero in HEAD: the zero chunk's). Fails here: U.
- TestUpgradeSeedCrashAtEachStep: a crash after the seeded pages and before
the field rebuilds without trusting them; after the field the marked store
never seeds; after the header the complete record is used as written.
The first and last fail here (no seeded pages are written).
- Guards that hold here and must keep holding: no seed when the store is
above or below the proof (an acknowledged write after the detach; the
checkpoint position is not the store's), for another or no recorded
lineage, without a proof, or when HEAD moved since the proof.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layer's HEAD now comes from a remote whose GetHead allocates its own
key strings (as a real remote's decode does), so the keys the layer keeps
are counted; the keys are in the layout's canonical form (114 bytes at
the 1 TiB chunk count). TestSpaceMeasurementControls shows a shallow copy
would be undercounted by its keys, that the per-chunk heap does not
depend on a chunk's block count (1, 8 and 32 blocks a chunk agree), and
that key length moves it about one byte a key byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestSpacePerChunkAt1TiBShape reports the holder's heap per chunk after
attach for 262,144 chunks every one named by HEAD (with CHUNK_SPACE_RED=1
it asserts the 200 B/chunk target, red today). BenchmarkCutBarrierScan
and BenchmarkCopyHead time the barrier's idle candidate scan and the flat
map copy at 1 and 16 TiB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit logged every cut attempt at INFO. The rule is every
transition: an idle no-op (no HEAD write) stays at DEBUG, as before, and
a cut that a publication rides on is marked by its caller
(WithPublishingCut): the provider's snapshot marks its cut, so a snapshot
of an unchanged image (a no-op cut, then the snapshot-unchanged HEAD
write) logs the cut's record at INFO. The operator guide is unchanged
from main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cut with no candidate and nothing published (a restored target's first
cut) logged its "cut phases" record at DEBUG only, so at the default
level the attempt left no event. Every attempt now logs it at INFO; the
operator guide says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit journal read whole with no records in the window (or a command
the host does not have) is only unavailable; only the command's own
failure (cut, nonzero exit, truncated) makes the bundle unproven. Two JSON
keys that collide once sanitized are no longer told apart by a suffix,
which could itself be a known credential and cost quadratic probes: that
artifact is withheld as not proven, checked after its redaction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fake remote and every CASHead-hooking test remote check a commit by
change: HEAD with the change set applied must be exactly the proposal's
chunk map, so a dropped or altered index fails the CAS instead of
publishing a HEAD that lost the chunk (a mutant dropping every index
after the first fails TestV11CutCommitsEveryChangedChunk). A census
requires every type in the package with CASHead or CheckCommit to have
its by-change form (deleting one wrapper's fails it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failing path (start error, unexpected success, timeout) skipped the
mid-test stop, and the cleanups restore floorFS before the setup's Stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A declared log file refused before discovery (not a regular file, changed,
over 4 MiB, not text, unreadable), a process whose arguments could not be
read, and a failed or truncated unit command each make the bundle
manifest-only, not only a unit cut by the time budget. A missing file or a
gone process holds nothing to discover and stays only unavailable. In an
unproven bundle every artifact error is replaced by a fixed one, and the
skipped names are printed sanitized. A known credential used as a JSON
object key is redacted too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lost commit's change values and expected version are copied when it
is sent; the settlement's check and CAS must carry those values and that
base. Comparing the map with itself could not see an in-place change (a
mutant that edits the pending set before the re-proposal now fails).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The listener's connection goroutines still read floorFS while they settle
the session; restoring it before they stopped raced their read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Credential discovery read the declared log files only while the
collection's time budget lasted: a slow run (as under the race detector)
skipped the later files, and an earlier file was written with a
credential only a skipped one named. The declared log files are now read
whole for discovery whatever time is left (each is bounded at 4 MiB, at
most 32), after the declared commands and before the status reads. A
declared source the budget still cuts (a -unit's commands) makes the
bundle hold only its manifest, which says the redaction is not proven
and names the cut sources; the command reports it and exits 3. Each log
file is discovered once, not twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the draft v1.1 format a cut's commit check and CAS go to the remote by
change (CheckCommitDelta, CASHeadDelta) with one owned change set built
from the chunks the cut changed; an unresolved commit keeps that set and
the settlement re-proposes it at the same base. Release builds keep the
full commit. The commit-site guard now also requires a by-change check
before a by-change commit, and the test remotes that hook CASHead route
CASHeadDelta through it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The summary kept only each file:line line, so a message whose reason is on
its next lines (a holder's log tail after "its log ends:") lost it. Each
own message now keeps its last 20 continuation lines; a harness header's
dump stays out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>