Each 1 MiB fence slice writes its aligned bytes O_DIRECT (Linux, where
the filesystem allows it) and is fdatasynced before it counts as
recovery progress, so a fence on a shared, capped disk no longer waits
behind other writers' page writeback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes. When the --json answer cannot be written, retire-host and
finalize-format exit 1 instead of 0. A retire whose record removal failed
answers Internal (the CLI's failed, exit 1), not FailedPrecondition (refused,
exit 2); the node store's test hook can fail a removal for the control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
retire-host follows finalize-format's contract: exit 0 retired, 2 refused,
75 the master could not be reached, 1 any other failure or usage error, and
--json prints result, reason, server, volumes and message for every outcome.
The master's HOST_HOLDS_WORK refusal names each held volume in its typed
metadata. The forced-move preview answers the typed reason the move itself
would carry (reason_code, e.g. BINARY_TOO_OLD), and force-move --dry-run
--json shows it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three tests read or damaged the store file through a second handle while
the store held its byte-range lock: mandatory on Windows, so they failed
there only. They now go through the open store's own file: the slots by
slotsV3Of, a record by damageOpenRecord. What they assert is unchanged.
Fixes#953.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestWALStoreV3SlowExtentKeepsReclaimMoving flaked on a busy Windows
host: a single slow fsync pushed one bounded cycle past its 500 ms
admission budget (attempts of 500-577 ms, against cycles whose writes
take about 77 ms). The slow disk is now 5 ms per extent write and the
budget half a whole-map cycle from the measured sleep (about 1.2 s): a
bounded cycle (about 160 ms of writes) leaves room for a slow fsync,
and a whole-map cycle (about 2.4 s) still outlasts the budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The direct-attach test bounds its Close as mustAttach does. The status
test pins the exact union of live and in-flight candidates during an
upload (distinct and overlapping) and the in-flight part leaving after
HEAD installs. The drained-pause test pins exact deltas: 2k for k dirty
chunks, 2N for a whole-volume pass, and nothing carried over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A non-blocking one-shot guard holds snapshot A alone (B passes the hook
without blocking, so a read outside the lock lets B finish during A's
hold), the newer wait's first-seen time is pinned to B's, and A's
completion and B's join are bounded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The waiting set's placements are read inside the lock that reconciles
it, so a snapshot that read older placements can never reconcile after
a newer one and drop the wait it started. A held-old/new control pins
it. host.go is rewritten without the carriage returns the previous
commit added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The waiting set and its first-seen times are computed and reconciled
under one lock, so a concurrent snapshot never drops an entry another
just started (its wait would restart).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An idle unreported host stays info. A host holding a placed volume that
has waited for its grant past the startup window (the freshness window,
from when this master first saw it waiting) is a warning naming each
such volume and its wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createWALStoreV3Configured recovered the new store with a background
context, so the fence of that recovery reported no progress although the
provider passes RecoveryProgress on create; on a slow disk the startup
window could end inside it. It now recovers with the options' observer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestLeaseRefusalKinds measures v1.0's barrier (65 s after the grant) and
assumed a fresh master is at format level 0; a new cluster now starts at
level 1, whose barrier is the lease deadline plus the skew (50 s). The
test runs on an existing (upgraded, not finalized) cluster's store and
asserts level 0 before the BARRIER case; the level-1 barrier stays
covered by TestTheForcedBarrierFollowsTheFormatLevel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>