Commit Graph
451 Commits
Author SHA1 Message Date
pingqiu b4daad80d1 fix(workspace): delegate revocation ACK to stored seal proof 2026-11-22 12:23:22 -08:00
pingqiu bdbe601e4c test(workspace): refuse unassigned stored seal proofs 2026-11-22 12:23:04 -08:00
pingqiuandClaude Opus 5.5 badc7f9596 test: start test-lock-dir children without INVOCATION_ID
A test runner that is itself a systemd service (the CI runner unit) passes
its INVOCATION_ID to every child, and blockvolume rightly refuses
--volume-lock-dir-test-only under systemd. Every subprocess start that
passes the flag now builds the child's environment without INVOCATION_ID
(one helper per test package). The product rule is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:23:55 -08:00
pingqiuandClaude Opus 5.5 f9383c5e48 test: zero HEAD CAS on the refused copy; same-epoch HEAD advance before the claim recheck
- The rolled-back copy makes no HEAD CAS attempt (counted at the remote,
  not inferred from PUTs).
- Control: an exact copy passes the preliminary HEAD read; HEAD then
  advances at the same epoch and holder before the claim's own read; the
  claim-image recheck refuses it as stale, with no CAS.
- The refused second provider leaves its storage root empty.
- The --help capture registers stderr restoration and pipe closes first,
  closes the writer before joining the reader, and bounds the join.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:40:12 -08:00
pingqiuandClaude Opus 5.5 83f8507d3b durable, blockvolume: review fold for the host lock and the rolled-back root
- The lock directory is created (0700) when missing; only a directory or
  lock file that cannot be created or opened refuses, with the cure
  (install the tmpfiles.d entry, or chown the directory and its lock files
  to the unit's user).
- The lock file is opened read-only (an existing file first, created 0644
  only when missing), so a lock file another user created stays lockable;
  it is never unlinked, and the next owner locks the same file.
- A stale-root startup end carries its cure into the final exit line:
  exiting status=78 reason=superseded cure="...".
- Tests: a cut's remote_lsn is locally durable at its HEAD CAS, and the
  root's crash image at the CAS reattaches and serves; the rolled-back copy
  makes no claim or PUT, admits no I/O, keeps its data and durable LSN; an
  exact copy at HEAD attaches; a read-only lock file is taken.
- Invariants: INV-WS-ONE-PROCESS-PER-HOST-001 and its M4 edge; the
  rollback row names its test file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:40:12 -08:00
pingqiuandClaude Opus 5.5 bd8afb0aea blockvolume: one live process per volume per host; refuse a rolled-back root
V1-SPEC r2.45.
(1) The provider takes an exclusive, non-blocking lock on
/run/sw-block/locks/<volume id>.lock before the volume's store opens and
releases it after the store closes (HostVolumeLock, set by blockvolume). A
missing directory refuses the provider with the cure; the tmpfiles.d
entry ships in deploy/systemd and both units may write it under
ProtectSystem=strict. --volume-lock-dir-test-only (hidden, refused under
systemd, warned at start) is for plain subprocess tests and harnesses.
(2) An existing root whose HEAD names this holder attaches only if its
local durable LSN reaches HEAD's remote_lsn; otherwise the existing
stale-root refusal, no retry (78 superseded), with the cure.
(3) docs/releases/one-process-per-volume.md: the lifecycle do-not list.
No HEAD change, no format bump, no new persisted file, no new exit reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:40:12 -08:00
pingqiuandClaude Opus 5.5 9d58ce6b82 test: red, one live process per volume per host (V1-SPEC r2.45 (1))
A second provider for the same volume on one host (another storage root,
the same host lock directory) must be refused before its store opens; a
missing lock directory, the default one included, refuses the provider;
blockvolume's test-only lock directory is hidden from --help and refused
under systemd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:39:43 -08:00
pingqiuandClaude Opus 5.5 440f9eff3c test: the returning old host exits 75 on its old root and on a fresh root, and the unit restarts it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:26:58 -08:00
pingqiuandClaude Opus 5.5 f0662dd31f test: an old host on its stale local root exits 78; on a fresh root, 75
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:08:31 -08:00
pingqiu 7076b54a23 Merge remote-tracking branch 'origin/main' into test/procedure-gate
# Conflicts:
#	cmd/blockvolume/planned_handoff_checks_test.go
#	cmd/blockvolume/planned_handoff_integration_test.go
#	cmd/blockvolume/procedure_gate_integration_test.go
2026-11-22 09:03:07 -08:00
pingqiu b92419e2e3 Merge branch 'pr429' into train/20261122-25 2026-11-22 08:27:30 -08:00
pingqiuandClaude Opus 5.5 4098abca82 test: the procedure gate's captured outputs as fixtures
The move to s2, HEAD reclaimed by s2, the forced move, its dry-run
previews (refused with an admissible time, then admitted) and lost-range,
captured from a passing gate run, are read by the default-build check
test; each check also refuses a neighbouring output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:46:41 -08:00
pingqiuandClaude Opus 5.5 339932cb61 test: fold the procedure gate's test-tier review
- The old host returning after a forced move: the absence checks run only
  while it is alive; it must exit 75 and log a refusal; a supervised
  restart and a start on a fresh local root (a control: no stale root to
  refuse) must do the same. The refusal text that the product never
  prints is dropped.
- The same-host restart is the page's systemctl restart (SIGTERM, a start
  within RestartSec); the crash restart is its own test. Both must serve
  within 15 s, as s1/r1 at the same epoch.
- The barrier wait requires at least one barrier refusal, compares with
  one second of log resolution, and requires the re-grant line.
- Too early: the exit reason assignment_timeout, and the same serving
  predicate as the barrier wait.
- The planned hand-over runs the page's step 1 and reads a never-written
  block as zero (a control).
- The lapsed-lease return must serve within its 30 s authority wait, as
  s1/r1. Comments match the order of the revoke-without-ACK steps.
- Harness ports come from 10000-19999, below weed's range; sw-block output
  can be captured to HANDOFF_CAPTURE_DIR for the fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:33:12 -08:00
pingqiuandClaude Opus 5.5 263fce9fcc test: the gate's owner-endpoint check rejects when either recipient lacks positive evidence
Table for wrongOwnerEndpoints: both positive passes; an unreadable log, a log with no
forced-epoch delivery, an empty log, or another host's endpoints in either recipient
rejects (#425).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:16:27 -08:00
pingqiuandClaude Opus 5.5 870a3d9be0 docs, test: name the spec row, not a seat; say channel capacity, not slots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:03 -08:00
pingqiuandClaude Opus 5.5 10ce25ee9c blockvolume: firstAdmitted reports its own completion; the exit diagram carries the runtime HEAD fence
The stop test now observes the worker's return on its own channel with
bounded joins on both paths (a re-check that ignores the stop fails in 12 s);
agent-workspace-design.md's supervisor diagram adds Serving -> Exit78 on a
runtime HEAD fence (head_fenced), independent of the lease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:03 -08:00
pingqiuandClaude Opus 5.5 50d6d92845 blockvolume: one "may serve" function: AdmitsIO for status and the workspace start gate
V1-SPEC r2.39: StorageBackend.AdmitsIO is the I/O gate itself (the backend
admits I/O AND the guarded projection names this lineage as the healthy
primary). /status FrontendPrimaryReady and NotReadyReason read it through
the provider (lease_not_held stays first; an unopened volume fails closed).

A workspace chunk primary's frontends start once AdmitsIO passes after the
backend first admitted I/O (firstAdmitted: a bounded 50 ms re-check until
first served, workspace primaries only; the backend has no projection-change
signal). Non-chunk volumes and supporting replicas start after open as
before (the #410 design condition, V1-SPEC r2.39), now pinned by a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:02 -08:00
pingqiuandClaude Opus 5.5 33e72fd083 blockvolume: state the fence-to-exit bound as detection plus cleanup; join the fence watcher
INV-FE-PRIMARY-READY-OPERATIONAL-001 keeps the readiness and listen
property; the fence-to-exit bound is its own row, INV-FE-FENCE-EXIT-001,
stated as what is guaranteed: the fence's detection time (a HEAD fence:
50 ms) plus the existing 5 s cleanup bound from the decision. 307 rows,
221 ACTIVE.

Provider Close joins each layer's fence watcher through p.inflight
(counted under p.mu while not closed). C.W lists the two new waits.

The runtime-fence watcher test owns its worker: cleanup registered before
the start, the return joined with a bound on both paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:02 -08:00
pingqiuandClaude Opus 5.5 22a540d34d blockvolume: a runtime HEAD fence exits 78 head_fenced; serve only while the lease is held
A chunk layer that fences after startup (HEAD has another publication
owner) while the lease is still valid now latches the backend not
operational with that evidence, and the process owner chooses the
no-restart exit 78 head_fenced through processExit.choose. I/O is refused
from the fence itself.

The first-grant log line is written only for a reply that grants: a first
reply that revokes fences the guard and logs no grant.

The frontend-gate tests own their workers: cleanup is registered before
each worker starts and every receive is bounded.

docs/design/invariants.md: INV-WS-SERVE-LEASE-HELD-001 (V1-SPEC r2.37);
INV-FE-PRIMARY-READY-OPERATIONAL-001 statement within 300 characters, with
the runtime fence enforcement and tests; M1 diagram and table carry the
lease-held order and the runtime fence exit; C.W names the runVolume
receive of the stop waiter's result. 306 rows, 220 ACTIVE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:02 -08:00
pingqiuandClaude Opus 5.5 34675c0930 blockvolume: no frontend listens and status is not primary-ready until the backend admits I/O
A restarted old holder (G-O2 r8) started its NVMe target unconditionally
at startup and reported FrontendPrimaryReady=true from the authority view
alone, before and after its chunk-layer claim was refused ("fenced, not
serving"). The admit gate refused every command with Namespace Not Ready,
but that status is retried on the same path and then fails to the guest,
and the path advertised ANA optimized, so a listening, ready-looking but
fenced target is not safe.

- status: FrontendPrimaryReady is false while the volume's local durable
  backend admits no I/O (attach pending, fenced, detached), with the
  backend's evidence in the new NotReadyReason; Healthy stays the authority
  view.
- blockvolume: the iSCSI, NVMe and ublk targets start only once the backend
  first admits I/O (awaitBackendAdmitsIO, 10 ms); signals and the workspace
  lease guard now start before that wait, and a stop requested during it
  skips the frontends and goes straight to shutdown.

INV-FE-PRIMARY-READY-OPERATIONAL-001 (304 rows, 218 ACTIVE); M1 Recovering
-> Serving names the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:14:02 -08:00
pingqiu 564c0df27f fix(blockvolume): restore workspace drain diagnostic 2026-11-22 07:12:31 -08:00
pingqiuandClaude Opus 5.5 f557cdfbc8 test: positive per-recipient evidence in the gate; the unknown owner's exact placeholder
Test review of #429 79d5d9f7:
- wrongOwnerEndpoints fails a recipient whose log cannot be read or shows no forced-epoch
  delivery, so each recipient must positively receive the owner's line.
- The unknown-owner unit check requires the volume unsupported or exactly the
  no-observation placeholder (no server, the line's endpoints), so neither s1's nor s2's
  report may supply it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:10:15 -08:00
pingqiu a9ff14e232 test: use explicit external bind and validate readiness response schema 2026-11-22 06:38:53 -08:00
pingqiu 0a01e8156c test: use neutral startup qualification names 2026-11-22 06:34:39 -08:00
pingqiu 4a517ed9ae test: qualify supervised target started before its clean move 2026-11-22 06:29:14 -08:00
pingqiu d7b7f2a432 test: observe retry exit before checking its restarted process 2026-11-22 06:19:50 -08:00
pingqiu e1edfe04da fix: apply zero-lineage retry rule to observed and adopted facts 2026-11-22 06:19:34 -08:00
pingqiu 764a208f4e fix: share supersession comparison across named lineage evidence 2026-11-22 06:05:41 -08:00
pingqiu 2ffcafb11f merge: update startup retry onto Train A identity rules 2026-11-22 06:01:49 -08:00
pingqiuandClaude Opus 5.5 d73acc54e9 test: #425 red: the forced move's epoch-2 lines carry the new owner's endpoints (procedure gate)
Brings the two-process procedure gate (origin/test/procedure-gate, its three test
files) onto main and adds the assertion to TestProcedureForcedMoveWithTheOldHostReturning:
every assignment line delivered at the forced epoch, to s2 and to the returning s1, carries
s2's own data and control endpoints (V1-SPEC r2.40, INV-AUTH-HOLDER-IDENTITY-001).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:00:00 -08:00
pingqiu 9972921e6b Merge #411 + #416 + #423: holder identity (server id + replica id), one server id per host, one line-owner function
# Conflicts:
#	docs/design/invariants.md
2026-11-22 05:23:44 -08:00
pingqiu 6419035850 Merge remote-tracking branch 'origin/main' into test/procedure-gate 2026-11-22 04:31:43 -08:00
pingqiuandClaude Opus 5.5 501d68ea06 test: harness ports below the kernel's ephemeral range
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:01:47 -08:00
pingqiuandClaude Opus 5.5 1ad3218fa9 test: a recorded foreign assignment counts as the old host's refusal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:52:16 -08:00
pingqiuandClaude Opus 5.5 b2ddf6206a test: the barrier-wait start at 40 s; the refusal of another server's assignment counts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:32:08 -08:00
pingqiu 44081b34b4 Merge #406: test the documented standalone planned handover 2026-11-22 03:29:24 -08:00
pingqiu 1da0c2905d fix: use guard fence ownership and one workspace exit decision 2026-11-22 03:22:28 -08:00
pingqiu 3fcbde02a8 test: displaced lower-epoch claim must retry startup 2026-11-22 02:24:47 -08:00
pingqiu f36710e5b5 fix: reject empty supersede identity and bound build pipe cleanup 2026-11-22 02:05:54 -08:00
pingqiu c89e38f5c4 test: empty replica fact cannot suppress workspace restart 2026-11-22 02:04:11 -08:00
pingqiu 9d6b978d83 test: carry holder server in CLI master fixtures 2026-11-22 02:02:31 -08:00
pingqiuandClaude Opus 5.5 53618e5d5b test: a holder started inside the barrier wait, and one started too early
Two procedure tests for a holder that returns after its lease ended but
before the re-grant barrier. Started 35 s after the stop (default flags),
the barrier passes within its 30 s authority wait: it must not serve while
its renewals are still refused for the barrier, then serves at the same
epoch. With --workspace-max-clock-skew 50s and a start 31 s after the
stop, its wait ends first: it does not serve and exits 75, and a
supervised restart that waits past the barrier serves at the same epoch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:57 -08:00
pingqiuandClaude Opus 5.5 e907fbdd55 test: the lifecycle page's procedures on two hosts with distinct server ids
Five tagged binary tests run the procedures of the volume lifecycle page
as written, on two blockvolume processes with server ids s1 and s2 that
share one blockmaster and one SeaweedFS: the planned hand-over to another
host, a same-host restart inside the lease, a return after a lapsed lease
started 65 s after the stop, a forced move with the old host returning,
and a revoke without an ACK followed by a forced move.

The harness takes N hosts (cluster spec nodes s1..sN); the checks that
read each step's output take the host and stay in the default-build
check file with the existing ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:50:25 -08:00
pingqiu bd1c8bdb1d Merge remote-tracking branch 'origin/main' into feat/host-urgent-pending
# Conflicts:
#	docs/design/invariants.md
2026-11-22 01:32:40 -08:00
pingqiu 4814ce613c fix: terminate superseded local roots while retaining move-back diagnostics 2026-11-22 01:29:40 -08:00
pingqiu 4a3a66597a test: superseded existing local holder must exit without retry 2026-11-22 01:28:44 -08:00
pingqiu c2edb7305c fix: carry foreign HEAD claim proof to startup exit classification 2026-11-22 01:26:01 -08:00
pingqiu 6f3aa6090b test: foreign HEAD claim must select no-retry exit 2026-11-22 01:24:06 -08:00
pingqiuandClaude Opus 5.5 8815c82098 test: the old process exits within the 30 s lease; a clean move without the ACK is refused
The planned hand-over waits 30 s for the old blockvolume's own exit, the
lease bound the lifecycle chapter states.

TestStandaloneCleanMoveWithoutTheACKIsRefused makes the chapter's
negative check deterministic: the volume is sealed, its blockvolume is
killed (a signal sends no ACK), the lease is revoked with the sealed
generation, and the clean move exits 1 with the documented refusal while
workspace show keeps no ACK. Its output is captured into the fixtures and
read by the shared checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:07:24 -08:00
pingqiu 7600be4e81 fix: preserve retained startup and planned-drain ownership 2026-11-22 01:01:28 -08:00