At RF=1 every local write logged 'replication: OnLocalWrite volume=...
lba=... lsn=... peers=0'; under sustained writes one volume's log grew to
162 MB in 13 minutes and the useful lines were buried. The counters (Stats:
WriteOps, WriteFanoutNanos) keep the per-write evidence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ordinary replicated ApplyEntry was still refused (errV3NotYet) on dark
v3, while its real callers are the replica's MsgShipEntry handler
(replica.go) and the ReplicaApplyGate's recovery and live lanes. It now
shares one body with the install-lane apply (applyEntryV3, DESIGN 8.1,
6.7, r16.1): through the v3 writer in LSN order; an LSN at or below the
highest appended is a superseded no-op when the LBA holds a higher LSN
and ErrWALLSNOrder otherwise; an unanchored gap is refused (recovery
needs a contiguous prefix); and an ordinary apply while installing is
refused with ErrBaseInstalling (the install lane is the handle's).
Controls: the store rules and a crash; the real ship handler on a v3
replica (apply, barrier ack, crash and reopen; an out-of-order entry
ends the connection); the real apply gate (recovery lane with its
stale-skip, live lane). Mutants: ApplyEntry refused on v3, no gap check,
no installing refusal. The store's order check alone is equivalent: the
v3 writer refuses the same LSN with ErrWALLSNOrder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new peer starts Healthy and Unknown is only set by Close, after which
Invalidate returns early.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Invalidate stored Degraded directly, so a NeedsRebuild peer could be
invalidated to Degraded and then set Healthy, escaping the terminal
state. Invalidate now checks replicaStateTransitionAllowed like
SetState: from NeedsRebuild the state is kept and the reason is still
logged; every other state still moves to Degraded.
Fixes#182.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .github/workflows/test.yml, job 'go test (linux)': on pull_request and on
push to main; Go from go.mod; go build ./..., go vet ./..., and
go test -short -count=1 -timeout 10m ./... with CGO_ENABLED=0. Actions are
pinned by commit SHA, permissions are contents: read, and a new push to a
PR cancels the older run.
- core/ops/surface_test.go: fix the two go vet warnings (resp used before
the error check), so vet covers the whole module.
- cmd/blockvolume: a withdrawn port no longer has to answer ECONNREFUSED.
A successful connect still fails; any other dial error passes only if the
address can be bound again.
- core/host/volume: probe tests dial a listener they opened and closed,
not the fixed 127.0.0.1:1.
- core/replication/component: on failure, the G5-5C and G9A catch-up tests
log frontiers, peer status and the engine trace. Assertions and timeouts
are unchanged.
Test files and the workflow only; no product code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments in source and tests named individual reviewers and carried the
time a decision was taken (for example "(name's ruling, 06:47Z)"). Those
are review bookkeeping, not design rationale. Remove the names and the
dates/timestamps; keep the rationale, issue and PR references (#51, #82,
#83, #142, #159) and spec section references as plain text.
Comment-only: no code, test logic or string literal changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up: the release was a t.Cleanup registered before Start, and
cleanups run LIFO, so the executor shutdown Start registers ran first; a
t.Fatal while the base frame was held would deadlock StopAndWait. A defer
inside the scenario runs before every t.Cleanup, including on t.Fatal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. The pre-barrier hold proved in-session delivery and
convergence but no longer the test's point: a newer WAL write for an LBA must
win over an OLDER base frame for that LBA that arrives later.
Drop the production SetPreBarrierHook seam (core/recovery is back to main)
and hold the base lane instead, through the existing WithPrimaryStorageWrap:
staleBaseHold captures the base read of LBA 5 (old value A) and holds it; the
test pushes the same-LBA overwrites (the session cannot seal its recovery cut
while base is held, so they ship in-session: this is also what fixes the
flake), waits until the replica holds B at LBA 5, then releases the stale A
frame. Convergence requires LBA 5 == B: RebuildSession.ApplyBaseBlock must
skip a base frame for an LBA the WAL lane already applied (bitmap).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestPillar3Slice2_EngineDriven_SameLBAArbitration was flaky (on main baca5fd,
-race -count=40: 25/40 failures at -cpu 1, 6/40 at -cpu 2, 1/40 at -cpu 4).
Root cause is a timing assumption in the test, not a product race: with a
12-LBA backlog, base copy and DrainBacklog finish in microseconds and
Sender.Run seals the recovery cut (SealBeforeBarrier) before the test pushes
its same-LBA overwrites. PushLiveWrite then returns ErrSinkBarrierSealed,
the documented 'retain the WAL entry for replay' outcome that production
FeedLiveWrite maps to LiveWriteRetained, and the test treated it as fatal.
Once in a while the whole session also finished inside waitBridgeLiveReady's
1 ms poll gap.
Tolerating the error would defeat the test (the overwrites would never ship
in-session, so convergence could not be checked), and a larger backlog would
only shift the timing. Instead add a test-only hook,
PrimaryBridge.SetPreBarrierHook: each sender runs it after base + backlog
drain and before SealBeforeBarrier. The test installs it before the probe
that starts the rebuild, waits until the sender reaches it (session live,
cut not made), pushes the overwrites, releases, and asserts convergence.
With no hook installed the sender path is unchanged.
The now-unused waitBridgeLiveReady helper in this package is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A push between HasActiveSession and live-ready returns
ErrSessionNotLiveReady (2 of 200 runs on Linux). ship_sender treats
it, ErrSinkBarrierSealed, ErrSinkSealed and ErrNoActiveSession as
retained or handed back to the steady path; the test now accepts the
same set, and the replica byte check still pins arrival.
Refs #94
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestDualLane_EngineDrivenRebuild_WithPushLiveDuringSession pushed its
live write straight into PrimaryBridge and failed on any error. Since
the dual-lane sink seals at the pre-barrier cut (8682e15), a push after
the cut returns ErrSinkBarrierSealed and the entry stays in the WAL for
replay; the production live-write path treats that as retained. A
12-entry rebuild usually reaches its cut before the push, and sometimes
closes before the test sees it live, so the test failed on most runs.
The test now accepts both: ErrSinkBarrierSealed from the push, or a
session that already closed (no push). The existing byte check that
the live LBA matches on the replica still pins that the write arrived.
Refs #94
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetWriteObserver published the observer first and only logged a refused
ship-LSN rebase, so the volume kept serving writes its observer would
mis-order.
Now:
- SetWriteObserver rebases an LSN-ordering observer to the store's next
LSN before installing it. If the rebase is refused, the observer is
not installed and the error is returned. The backend also records the
fault and refuses every I/O until an install succeeds, so a later
attach that marks the volume operational cannot reopen it. blockvolume
reports the error.
- The frontier seed and its observer rebase run in one critical section
with observer installs (observerMu). Whichever runs second sees the
other's result; a seed landing between an install's rebase and its
publication can no longer leave the observer on the old LSN. A refused
rebase after the seed records the same fault.
- RebaseShipLSN documents that it moves only the ordering cursor:
entries already dispatched to peer queues carry lower LSNs and are
untouched.
The composition test checks the install error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ReplicationVolume orders writes from the store's next LSN, captured
when it is built. On a restored walstore-chunk host the frontier seed
moves that LSN to HEAD.remote_lsn+1 later, during the deferred attach.
The resequencer then waited forever for the LSNs below it, and writes
and flushes hung.
Whoever moves the next LSN now tells every component that cached it:
- ReplicationVolume.RebaseShipLSN(lsn) moves the ship order forward. It
is refused while any write is pending or in flight, never dropping
one, and never moves backwards; an equal LSN is a no-op.
- The provider calls it through the backend's observer right after
SeedChunkFrontier, before the layer attaches and the volume serves
I/O.
- StorageBackend.SetWriteObserver rebases a newly installed observer
to the store's next LSN, covering a seed that landed before the
observer was installed (blockvolume installs it after
SetReplicationVolume, while the attach is still deferred).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* storage: bound flusher snapshot to published LSN cut
* storage: make checkpoint snapshot atomic with write publication
* transport: close the replica connection when ApplyEntry fails (#89)
The production replica listener (no apply hook) only logged a failed
store.ApplyEntry and kept reading. Later entries on the same connection
were still applied, so the next barrier acked a frontier past the LSN
that was never applied. walstore's ApplyEntry can fail when its WAL is
full, and the primary only checks that AchievedLSN reaches the target,
so the gap went unnoticed.
A failed apply now ends the connection, as the apply-gate path already
does. Nothing after the failed LSN is applied on that connection, and
the primary sees the close, marks the peer degraded and recovers it
from the replica's real frontier.
The new test ships LSNs 1, 2 and 3 with LSN 2 failing and checks that
no barrier, on the same connection or a fresh one, acks LSN 2 or later.
It fails before this change (the barrier acks 3) and passes after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: prove the failed apply, the close and the primary's recovery (#89)
The replica test now waits for the injected ApplyEntry(2) failure, requires
the failed connection to end with EOF or a reset (a timeout fails), and
checks that LSN 3 never reaches the store.
A new component test runs the production primary path with the host's
PeerAdapterRegistry and probe loop: a transient replica apply failure
degrades the peer, recovery replays from the replica's frontier starting
exactly at the failed LSN with exact bytes, the peer returns to healthy,
and a later write and barrier succeed. Without the fix the peer is never
degraded and the failed block stays missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Package the Kubernetes alpha into a script-based Day-1 activation loop: activate the stack, create the first PVC-backed volume, verify writer/reader data, collect product-owned observation evidence, render a local read-only report, and clean up.
Includes multi-node-safe activation defaults, first-volume example automation, read-only ops report output, README/quickstart/release note updates, and review-driven hardening for fail-fast configuration, promotion evidence, inventory fail-closed behavior, and test guards.
Validated by Day-1 activation run 20260517-205252-04e9 and read-only report run 20260517-212358-bfba. Local targeted tests passed.
Adds the beta-hardening test and operations foundation for Seaweed Block, including runner-native protocol/beta gates, CSI lifecycle and durable restart coverage, iSCSI/NVMe protocol release gates, returned-replica evidence, read-only operations status reports, OS initiator compatibility gates, and fast iSCSI L2 durable restart/reconnect coverage.
Strip T4a/T4b/T4c/T4d, G3+/G5-5/G5-5A/G5-5C/G6/G7-redo, P14/P15, and
"architect round-NN" prose from godoc and in-body comments across the
core/ tree. Preserve stable invariant identifiers (INV-* names) since
they're searchable across the codebase.
Files: core/engine/apply.go, core/host/master/services.go,
core/replication/component/cluster.go, core/replication/probe_loop.go,
core/storage/walstore.go, core/storage/walstore_recovery.go,
core/transport/executor.go, core/transport/replica.go.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>