635 KiB
Seaweed Block invariants and state machines
This is the protocol contract of Seaweed Block: the state machines the code implements, the invariants each transition must keep, where each invariant is enforced, which test asserts it, and which TLA+ property models it. It is written for people and for coding agents. Before changing a protocol path, find the machine in Part A and the rows in Part B, and follow the change rules in Part C.
This document supersedes the internal ledger internal/docs/protocol/invariant-ledger.md. Every ID from that ledger is kept here and was re-checked against the code; some statements were narrowed to what the tests in this repository actually assert, and each narrowing is noted under its table. The internal file stays for history; new rows go here.
The design is described in three documents, and this one collects their machines and invariants in one place: the core design, the agent workspace design and the Kubernetes block design.
Conventions. These are the same as in the design documents.
- Code references name a file and a function, not a line number. Test references name the test function and its file.
- A TLA+ entry names a specification in
docs/spec/and an invariant or property defined in it. The models check designs at small scale and are mapped to the code by reading (see the limits). - Status:
ACTIVE: a Go test in this repository asserts the statement.STUB: the code enforces the statement (by reading), but no test asserts it yet. A release note must not claim behaviour backed only by aSTUBrow.DORMANT: the code and its test exist, but no production path of this release reaches the code. A release note must not claim behaviour backed only by aDORMANTrow. The list below says what each one waits for.ARCHIVED: a retired row, kept with its reason. The retired v2 converter is archived.
- The rule carried over from the internal ledger still applies: an invariant without a test is a wish, not an invariant.
DORMANTrows in this release, and what each waits for:INV-RESTORE-HYDRATE-001,INV-RESTORE-OWN-BATCH-001:HydrateVolumeandOwnVolumeBatchhave no caller. A restored volume is not made independent of its source snapshot by the product; the rows wait for that driver.INV-CUT-PRECOPY-001,INV-WS-FREEZE-REFUSAL-PRECEDENCE-001: blockvolume refuses--chunk-detach-precopyand/chunk/detachrefusesfrozenbefore any provider call, so neither admission runs.INV-WAL-V3-W-MODE-A-001,INV-WAL-V3-W-SETWMODE-001: no production code sets mode A or callsSetWMode.INV-WAL-V3-RESET-001,INV-WAL-V3-RESET-TWO-SLOT-001,INV-WAL-V3-RESET-HALF-001,INV-WAL-V3-RESET-INVARIANT-001: no production code starts a reset; an open only detects a half reset.INV-PUBLISH-SETTLED-001: no binary setsChunkOnPublishSettled, so the hook is nil.INV-CHUNK-RECORD-V11-001: the draft v1.1 store format runs only in builds with theswblock_v11_formattag and in tests (chunkV11Format), independently of the cap tagswblock_lab_bigvol(TestV11FormatFollowsItsOwnTagAlone); the row waits for the change that declares the format.INV-WAL-V3-BASE-RETIRE-GATE-001, and the chunk layer's attach over a completed BASE: a BASE is installed only by the replica side of replication, and a chunk volume refuses every replica role, so no production path puts a BASE on a chunk store.
Contents
- Part A. State machines
- Part B. Invariant ledger
- Part C. Change rules
- Part D. Wait ownership
- Part E. Quantities
- Part T. Terms bound to code
Part A. State machines
Each machine lists its states, the allowed transitions, the guard that must hold for each transition, where the guard is enforced, and the IDs of the Part B rows that protect it. A state name in code font is a value in the code; the other names describe a condition and are not code types.
Lifecycle record I/O and supervised master recovery
This is the process projection of INV-LIFECYCLE-STORE-DURABLE-001 and
INV-LIFECYCLE-FAILSTOP-001; it adds no record format or authority state.
stateDiagram-v2
[*] --> Recovering: supervisor starts master
Recovering --> Ready: complete records loaded, directory barriers succeed
Ready --> Ready: changed files synced, renamed, directory synced
Ready --> Faulted: record put/import persistence failure
Recovering --> Faulted: recovery directory sync failure
Faulted --> Exited: one ERROR attempt, exit 1 within 1 s
Exited --> Recovering: supervisor restarts
| From | To | Guard | Enforced in | Protects |
|---|---|---|---|---|
| — | Recovering | the supervisor starts blockmaster with a lifecycle store | cmd/blockmaster/main.go run; deploy/systemd/sw-blockmaster.service |
INV-LIFECYCLE-FAILSTOP-001 |
| Recovering | Ready | each node, placement and volume store loads complete records and its records-directory barrier succeeds; the cluster-spec import completes before serving | core/lifecycle/node_inventory.go OpenNodeInventoryStore; core/lifecycle/placement_intent.go OpenPlacementIntentStore; core/lifecycle/store.go OpenFileStore; cmd/blockmaster/main.go run |
INV-LIFECYCLE-STORE-DURABLE-001, INV-LIFECYCLE-FAILSTOP-001 |
| Ready | Ready | a changed put or import: changed files are durable before rename (per-file fsync, or one syncfs on a qualified filesystem) and one directory barrier precedes publication; an unchanged record does no I/O and keeps its SeenAt |
core/lifecycle/record_file.go writeRecordDurably, writeRecordBatchDurably; core/lifecycle/node_inventory.go ImportNodes, registrationLocked; core/lifecycle/placement_intent.go ImportPlans |
INV-LIFECYCLE-STORE-DURABLE-001, INV-NODE-REGISTRATION-FRESHNESS-001 |
| Ready | Faulted | a put or import returns a RecordPersistenceError; the store latches it, so later mutations return ErrLifecycleRecoveryRequired, before calling the process policy; a marshal error before any I/O does not latch |
core/lifecycle/record_file.go latchPersistenceFailure; each store's putLocked, ImportNodes, ImportPlans |
INV-LIFECYCLE-STORE-DURABLE-001, INV-LIFECYCLE-FAILSTOP-001 |
| Recovering | Faulted | a store open's records-directory sync fails; New hands the RecordPersistenceError to the process policy |
core/lifecycle/record_file.go syncRecordDirectory; core/host/master/host.go New |
INV-LIFECYCLE-STORE-DURABLE-001, INV-LIFECYCLE-FAILSTOP-001 |
| Faulted | Exited | the policy arms a one-second exit timer, attempts one ERROR line, then exits 1 | core/host/master/lifecycle_failure.go lifecycleFailStop |
INV-LIFECYCLE-FAILSTOP-001 |
| Exited | Recovering | the supervisor restarts blockmaster (Restart=on-failure) |
deploy/systemd/sw-blockmaster.service |
INV-LIFECYCLE-FAILSTOP-001 |
A store latches the error before calling the process policy. A failed step may
leave a mix of complete old and new files; recovery syncs their directory and
startup reconciles the declarative import before serving. Temporary files are
not records. On Linux >= 5.8 with the records on ext4, xfs, btrfs or tmpfs,
startup import opens the records-directory fd before writing, writes and
closes every changed temp, calls one syncfs, then renames all temps and
syncs the directory before publication. A failed syncfs is never retried
within the step: its writeback error may have been consumed. Recovery writes
fresh temps. Older kernels, other filesystems (overlay, FUSE, NFS: syncfs does
not reach their backing files) and other platforms retain per-file fsync
before rename; startup reports the chosen path for the node and placement
stores, each probed at its own directory. The filesystem-wide sync can
also wait for unrelated writeback on that filesystem.
The executable arms a one-second process-exit timer before logging
and exits immediately after the log returns, rather than waiting for graceful
shutdown behind a writer. Embedders without this process policy must reopen a
failed store before any further mutation. Removal errors do not invoke this
policy: the in-memory record and its published snapshot stay present until
removal succeeds, so a later retirement tick can retry. This is covered by
TestFailedRemoveKeepsRecordForRetry and
TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick.
A successful removal still has the separate directory-sync limitation
recorded below.
M1 walstore: open, recover, serve, fault
The local storage engine and the durable backend in front of it. Diagrams in the core design: the per-I/O gate in §1.1, and the life of one write (appended, synced, in the extent, checkpointed, reusable) in §1.2.
stateDiagram-v2
[*] --> Opened: OpenWALStore / CreateWALStore
[*] --> CreateRefused: CreateWALStore without local headroom (free < size + WAL)
[*] --> CreateRefused: chunk volume, create mode: geometry flags disagree with the volume record, or the record is not read
[*] --> Opened: half-fence marked map integrity failure, same-incarnation other slot valid unmarked and intact; restart legacy recovery
[*] --> OpenRefused: a removed experimental engine's volume (SWAW, or SWPW in either header slot), any selector
Opened --> Recovering: RecoverVolume
Recovering --> Serving: Recover ok, backend operational; workspace primary: lease held, then HEAD claim, then frontends listen, then ready
Serving --> Closed: runtime HEAD fence, exit 78 head_fenced
Recovering --> Serving: v1.1 attach of an unmarked store, the upgrade: whole local chunks HP with HEAD's hash when the clean-stop proof holds (lineage, synced position), else U
Recovering --> RecoveryFailed: Recover error (typed reason)
Serving --> Serving: map prepare refused (prior root released, no latch, retry)
Serving --> FaultLatched: fsync or WAL append fails
FaultLatched --> Closed: Close
RecoveryFailed --> Closed: Close
Serving --> Closed: Close
Closed --> Opened: reopen
| From | To | Guard | Enforced in | Protects |
|---|---|---|---|---|
| — | Opened | v3 A/B descriptors and owned-map dependencies valid (or the selected marked map has an integrity-only failure and the same-incarnation valid unmarked half-fence slot has an intact map); exclusive file ownership acquired; legacy formats refused; backend starts not operational | core/storage/walstore.go OpenWALStoreWithOptions; core/frontend/durable/provider.go openOrCreate |
INV-WAL-OPGATE-001, INV-WAL-V3-ACTIVATION-001, INV-WAL-V3-DESCRIPTOR-001, INV-WAL-V3-MAP-PUBLISH-001, INV-CHUNK-HALF-FENCE-FALLBACK-001 |
| — | CreateRefused | a new volume needs the durable root's free space >= its size + WAL (a lab build, tag swblock_lab_bigvol, only warns), checked before the store, its WAL or its fresh marker is created (the replica floor, written when the assignment arrives, precedes the check and stays); the refusal ends the process with status 1; an existing volume opens and warns when its remaining data growth + WAL exceed the free space |
core/frontend/durable/headroom.go; core/frontend/durable/provider.go openOrCreate |
INV-LOCAL-HEADROOM-001 |
| — | CreateRefused | a chunk volume in create mode (no local store yet): before the provider is built, the geometry flags are compared with the volume record; they disagree, or the record is there but does not decode: exit 78; the filer failed the read: exit 75; nothing is created; an absent record keeps the create path; an existing store is never rechecked against the flags | cmd/blockvolume/main.go (create-mode check); cmd/blockvolume/chunk_remote.go geometryFlagsRefusal |
INV-VOL-GEOMETRY-FLAGS-RECORD-001 |
| — | OpenRefused | the file's header carries a removed experimental engine's magic (smartwal, parallel-walstore): refused typed under every selector, read-only, never modified | core/frontend/durable/provider.go verifyImplOnDisk |
INV-OPEN-REMOVED-ENGINE-REFUSED-001 |
| Opened | Recovering | the volume is open in the provider | core/frontend/durable/provider.go RecoverVolume |
INV-WAL-OPGATE-001, INV-RECOVERY-PROGRESS-WINDOW-001, INV-RECOVERY-SIZED-STEP-SLICES-001, INV-RECOVERY-AUTHORITY-WAIT-PAUSE-001 |
| Recovering | Serving | v3 nonce/cursor-bound physical prefix satisfies its W/BASE gate; rollback fence and rebuilt bounds publish before reuse; Recover aborts/drains an open COW window before lower locks, holds the capture barrier and invalidates proofs at start/end; the frontend targets start, and FrontendPrimaryReady is reported, only once the backend admits I/O (a chunk volume: after its storage claim; attach-pending or fenced reports not ready with the reason); a workspace primary claims HEAD, listens and reports ready only while its lease guard permits now (WorkspaceLeaseGuard.Held; without a grant: NotReadyReason=lease_not_held, exit 75 after the start-time wait); a primary of a replicated line serves only when its own --replication-ack is the profile its assignment names (otherwise not Healthy, NotReadyReason naming both profiles, ahead of the backend's own refusal) |
core/storage/walstore_v3.go recoverV3; core/storage/walstore.go WALStore.Recover; cmd/blockvolume/frontend_gate.go awaitFrontendStart; core/frontend/durable/storage_adapter.go FirstServing; core/host/volume/status_server.go statusProjection; core/host/volume/workspace_lease.go Held; core/host/volume/workspace_startup.go noteAckProfile |
INV-WAL-SYNCED-RECOVERED-001, INV-WAL-REPLAY-LWW-001, INV-WAL-FRONTIER-GAP-001, INV-CUT-RECOVER-BARRIER-001, INV-WAL-V3-W-RECOVERY-001, INV-WAL-V3-FENCE-001, INV-WAL-V3-FENCE-SLICE-001, INV-WAL-V3-MAP-PUBLISH-001, INV-FE-PRIMARY-READY-OPERATIONAL-001, INV-WS-SERVE-LEASE-HELD-001, INV-PRIMARY-ACK-PROFILE-001, INV-ATTACH-ASSIGNMENT-BOUND-001, INV-LAYOUT-REMOTE-CAPABILITIES-001 |
| Recovering | Serving (v1.1 upgrade, clean-stop seed) | the chunk layer attaches an unmarked store on the draft v1.1 format (lab builds only), after Recover and the storage claim: each whole local chunk is written Rebuilt all → U, Hash → HU, Commit → HP with HEAD's hash (a chunk HEAD does not name: the zero chunk's) only when all hold: a clean-stop proof (the HEAD the claim was built on was a committed, idle detach, DetachedBy), its claim id is the store's layout claim id, and its position is the store's synced position the pages are valid through; otherwise each whole local chunk is U (left to the compare pass); partial and absent chunks are classified alike in both; a marked store never seeds |
core/frontend/chunkstore/layout/start.go Start (ReportCleanStop); core/frontend/durable/provider_layout.go startLayoutRoot; core/storage/chunk_record_upgrade.go upgradeChunkRecordSeeded, seedsLineage, cleanStopHashes |
INV-CHUNK-RECORD-SEED-001, INV-CHUNK-RECORD-UPGRADE-001 |
| Recovering | RecoveryFailed | a WAL integrity failure or an I/O error; the backend stays not operational and the host blocks local readiness with wal_corrupt or io_error |
cmd/blockvolume/durable_startup.go openAndRecoverDurable; core/host/volume/recovery_watchdog.go LocalRecoveryHealthReason |
INV-WAL-TYPED-FAILCLOSED-001, INV-WAL-OPGATE-001, INV-WAL-V3-W-RECOVERY-001 |
| Serving | Serving | each Read, Write, Sync passes the operational, chunk-fence and lineage checks; write admission samples the active writer's native pressure before waiting; a write is durable only when a covering Sync returns |
core/frontend/durable/storage_adapter.go gate; core/storage/walstore.go WALStore.Sync |
INV-FE-LINEAGE-GATE-001, INV-WAL-SYNC-FRONTIER-001, INV-FE-FUA-SYNC-001, INV-FE-FLUSH-SYNC-001, INV-WAL-V3-ADMISSION-001, INV-WAL-V3-W-001 |
| Serving | Serving (checkpoint) | the flusher binds its snapshot/materialization to one recovery lifetime; extent and owned COW map are durable before the shared descriptor publisher advances checkpoint/tail; both slot tails pin reuse | core/storage/flusher.go flushOnceInternal, flushCycle; core/storage/walstore_map_checkpoint_v3.go publishCheckpointV3 |
INV-WAL-CHECKPOINT-SNAPSHOT-001, INV-WAL-CHECKPOINT-PREFIX-001, INV-WAL-CHECKPOINT-PRESENT-001, INV-WAL-CHECKPOINT-RETIRE-001, INV-WAL-FLUSH-PASS-001, INV-WAL-REUSE-PERSISTED-TAIL-001, INV-WAL-CKPT-META-FAIL-001, INV-CUT-BITMAP-001, INV-WAL-FLUSH-SYNC-COVERS-WAL-001, INV-WAL-V3-RECLAIM-001, INV-WAL-V3-PUBLISH-NONCE-FLOOR-001, INV-WAL-V3-MAP-PRIOR-LIVE-001 |
| Serving | Serving (map prepare refused) | a map preparer (the flusher's checkpoint, the chunk layer's captured-map publication, BASE complete) captured prior and a publication released it before the prepare's live-set snapshot: the prepare reuses no page, writes nothing, refuses with prior_released without latching, counts it, and the caller's next cycle prepares from the current root |
core/storage/chunk_lsn_map_v3.go prepareLockedV3; core/storage/chunk_map_extents_v3.go liveSnapshotWithPriorV3; core/storage/map_extent_pins.go reserveCoverageV3 |
INV-WAL-V3-MAP-PRIOR-LIVE-001 |
| Serving | FaultLatched | the first failed fsync of the store file, or a WAL append whose write failed |
core/storage/walstore.go noteFsyncFailure, syncFile; core/storage/walstore_v3.go appendWriteV3 |
INV-WAL-FSYNC-STICKY-001, INV-WAL-APPEND-STICKY-001 |
| FaultLatched | FaultLatched | every later Sync, write, checkpoint and Recover on the same open store is refused |
core/storage/walstore.go stickyIOFault |
INV-WAL-FSYNC-STICKY-001 |
| Serving | Closed (process exit 78 head_fenced) |
workspace chunk primary: the attached layer fenced after startup (HEAD has another publication owner); I/O is refused from the fence, the backend latches not operational with the evidence, and the process owner chooses the no-restart exit | core/frontend/durable/provider_startup.go watchChunkFence; cmd/blockvolume/process_exit.go watchChunkRuntimeFence |
INV-FE-FENCE-EXIT-001 |
| any | Closed | Close; a store with a latched fault does not write the final superblock |
core/storage/walstore.go WALStore.Close |
— |
The v2 writer, scanner, checkpoint path, C11 codec/reconciler and in-place converter are retired. Native map and descriptor rules remain enforced; v2 inputs refuse open without mutation. TestNativeReplacementLegacyBytesRefusedWithoutMutation and TestChunkAttachRefusesAnUnmappedNativeStore cover these admission boundaries. The receiver session bitmap is separate and unchanged.
Public walstore Create now selects mapped format v3/impl3 (mode C by default, mode A by create option). Open and offline readonly use A/B slot and owned-map validation; valid legacy formats are refused with ErrUnsupportedLegacyFormat, rather than silently retrofitted. The temporary old-engine/raw-codec test scope and every named native replacement are recorded in the legacy inventory. Native recovery validates nonce/cursor binding and a contiguous physical LSN prefix before applying the mode-specific W rule; an acknowledged-range integrity failure blocks startup. The provider's create geometry, auto probe, capture, HEAD restore and readonly/status controls exercise the public selector (INV-WAL-V3-ACTIVATION-001). Before reading v3 slots, both read/write and offline read-only open acquire an exclusive nonblocking file lock (INV-WAL-V3-OWNER-001). Contention refuses open without changing bytes; descriptor close or process exit releases ownership. The offline converter is retired; legacy volumes refuse open unchanged. The mapped v3 checkpoint also carries a complete-record physical tail through the covered LSN minus the configured retention window; partial batches remain retained. The existing sole publisher then performs metadata-only rollover when the fallback still pins that prefix. Reuse still requires both valid same-nonce slot tails and retirement of checkpointed dirty references under writer exclusion; idle, unchanged-checkpoint and admission paths also settle a pinned fallback. An unlocked catch-up scan revalidates the coherent checkpoint and tail before emitting anything. A failed rollover latches and grants no reuse (INV-WAL-V3-RECLAIM-FAIL-001).
Recovery warnings such as wal_hole_suspected are recorded in Serving without changing health (INV-WAL-WARN-NO-HEALTH-001). The open gaps of this machine (a corrupted synced record mid-history only warns; forged records in user data) are listed in the core known issues and are not ledger rows.
M2 Authority: assignment, epoch, lease
CreateVolume and PlaceWorkspace refuse a new dynamic record or first placement
when the lifecycle product loop is off; recorded retries retain their existing
result and conflict rules. Exact static-topology membership
is the RF1 exception; another static volume does not supply an assignment
producer for this one (INV-AUTH-DYNAMIC-NEEDS-LOOP-001). This is admission on
immutable startup configuration, not another authority writer.
blockmaster's publisher is the only component that mints epochs. Diagrams: the assignment lifecycle in core §1.5, and the workspace lease and move in agent workspace §7.
Heartbeat observations, per server/volume/replica slot.
ObservationStore.ingest compares each reported slot only with that slot's
stored timestamp (slotObservedAt). An older slot is dropped and counted;
an equal or newer slot is accepted. A mixed report merges accepted slots and
retains every other stored slot. An all-superseded nonempty report changes no
observation or health transition. Accepted slots keep their own freshness;
server metadata keeps its newest timestamp without lending it to another slot.
flowchart LR
Report[Receive heartbeat report] --> Compare{Each slot: stored timestamp newer?}
Compare -->|yes| Drop[Drop and count only that slot]
Compare -->|no| Accept[Accept that slot and its health transition]
Drop --> Mixed{Any accepted slots or an empty report?}
Accept --> Mixed
Mixed -->|yes| Merge[Merge accepted slots; retain other slots and newest server metadata]
Mixed -->|no| Keep[Keep stored observations unchanged]
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
| Stored observations | Stored observations (slot refused) | stored timestamp for this server/volume/replica is strictly newer than the report; drop and count only this slot | core/authority/observation_store.go ingest, slotObservedAt |
INV-OBS-SLOT-ORDER-001 |
| Stored observations | Stored observations (mixed report merged) | accept equal/newer slots against their own stored timestamp; merge only accepted slots, preserving other slots and independent freshness | core/authority/observation_store.go ingest, mergeServerSlots |
INV-OBS-SLOT-ORDER-001 |
| Stored observations | Stored observations (no mutation) | a nonempty report has no accepted slot; publish no observation mutation or health transition | core/authority/observation_store.go ingest |
INV-OBS-SLOT-ORDER-001 |
Assignment line, per volume.
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
| Unbound | Bound (epoch 1, endpoint version 1) | IntentBind; no slot of this volume holds a present line (checked per volume, also after a restart); to move to another slot use IntentReassign |
core/authority/authority.go applyWithWorkspaceMove, boundReplicaForVolume; core/authority/controller.go decideVolume (binds only a volume with no line) |
INV-AUTH-ONE-PRIMARY-001, INV-AUTH-PERSIST-BEFORE-PUBLISH-001 |
| Bound | Bound (endpoint version + 1) | IntentRefreshEndpoint; same epoch; new addresses, or the same addresses for another primary process (the line's incarnation differs); a no-op when both are unchanged; refused (ErrExpectedLineMoved) when the ask names the line it was decided against and the volume's line is no longer that one (replica, epoch, addresses) |
core/authority/authority.go applyWithWorkspaceMove; core/authority/directive.go expectedLineMoved |
INV-AUTH-PERSIST-BEFORE-PUBLISH-001, INV-AUTH-RESTART-REISSUE-001 |
| Bound | Reassigned (per-volume maximum epoch + 1) | IntentReassign; some earlier publication exists; an enrolled workspace volume changes only through a guarded move |
core/authority/authority.go applyWithWorkspaceMove, maxPublishedEpochForVolume |
INV-AUTH-EPOCH-MINT-001, INV-AUTH-ONE-PRIMARY-001 |
| any | (store write first) | with an authority store configured, every transition is written to the store before memory changes or subscribers are notified; a failed write publishes nothing; a write whose outcome is unknown (the directory fsync after the rename failed) fail-stops blockmaster, so no caller is told it failed | core/authority/authority.go applyWithWorkspaceMove |
INV-AUTH-PERSIST-BEFORE-PUBLISH-001 |
| any (workspace) | Uncertain | a failed workspace authority write, including a lease extension; later changes for that volume, and renewals that would issue a new or extended grant, are refused until restart (a Revoking lease still gets its bounded drain reply) | core/authority/authority.go applyWithWorkspaceMove; core/authority/workspace.go persistWorkspaceLocked; core/authority/workspace_lease_view.go RenewWorkspaceLease, extendWorkspaceLease |
INV-AUTH-UNCERTAIN-001 |
| Uncertain | Uncertain (move answer) | failed move replies classify uncertainty after local locks release, before any admission refusal; request-context cancellation/deadline remain typed; known successful replay is unchanged | core/authority/workspace.go WorkspaceMoveOutcomeError; core/host/master/workspace_service.go MoveWorkspace |
INV-AUTH-UNCERTAIN-001 |
| Bound | Deleting | a deletion reservation; the id is never created again | core/host/master/services.go MarkVolumeDeleting |
INV-VOL-ID-NO-REUSE-001 |
| any authority line | DeleteReserved (permanent) | the existing lifecycle reservation is committed durably; then mu -> leaseMu publishes the exclusion. Publication, move issue, first grant, expired re-grant and renewal check it under their writer lock. Restart reloads every committed exclusion before serving. Deleting HEAD requires the granted or restart deadline plus skew to have ended, including unclaimed grants; the check returns a refusal rather than waiting |
core/authority/workspace_delete_reservation.go ReserveWorkspaceDeletion, NoLiveWorkspaceLease; core/host/master/volume_delete_authority.go; host.go New |
INV-SNAPK-DELETE-GATE-001 |
| any authority line, stores still awaited (stage 1) | DeleteReserved without the holder's acknowledgement | the master's record is marked first, durably and in the lock that ends the store wait; the mark freezes the record in stage 1 (the wait never ends after it, so the primary, whose assignment keeps awaiting the stores, never serves); the reservation then skips the live-lease refusal. Deleting HEAD waits out the lease as above. Past stage 1, also while the end of creation is unrecorded (the volume may be serving), the live-lease refusal stays | core/host/master/volume_delete_authority.go Reserve; core/host/master/store_attestation.go markDeleteWithoutAck, awaited; core/authority/workspace_delete_reservation.go ReserveNeverCreatedWorkspaceDeletion |
INV-WS-DELETE-WITHOUT-ACK-001 |
| DeleteReserved, removed from the desired spec | Retired metadata (reservation permanent) | no live lease, then a fresh bounded HEAD read proves deleted or absent; unread/live/deleting keeps the records. Remove authority durably, then placement and bindings, then the volume record; a crash retries the remaining removals. A startup lease skip schedules one more pass after the latest observed barrier, also without the product loop; full passes log skips. The store and its resweep inputs are untouched | core/host/master/spec_retirement.go ReconcileDeletedSpecVolumes, startPostFloorRetirement; core/authority/workspace_retirement.go RetireDeletedWorkspace |
INV-SPEC-DELETE-RETIRE-001, INV-SPEC-DELETE-RETRY-001 |
Volume creation phase, in blockmaster's store record (core/host/master/store_attestation.go, decided by inCreationPhase in core/host/master/product_loop.go). Every replacement entry (both promotion gates, the operator's failover and planned move, the rebalance) acts only on Established.
stateDiagram-v2
[*] --> AwaitingStores: first bind of a new volume (record opened with its initial replicas)
AwaitingStores --> AwaitingStores: the write that ends the wait fails (still held, reported as one store awaited)
AwaitingStores --> AwaitingEnd: every current replica's store attested (written durably)
AwaitingEnd --> Established: first of the primary's ready answer, or a survivor's DurableLSN > 0 at the line (written durably)
Established --> Established: later answers reopen nothing
AwaitingStores --> DeleteMarked: delete without the holder's acknowledgement admitted (mark written first)
DeleteMarked --> DeleteMarked: stores attested after the mark (the wait never ends: the primary serves nothing)
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
| (none) | AwaitingStores | the master binds a volume for the first time; the record lists its initial replicas | core/host/master/store_attestation.go openStoreRecord, open |
INV-PROMOTE-CREATION-WAIT-001 |
| AwaitingStores | AwaitingEnd | every current replica has an attested store; Initial is cleared and awaiting_first_ready set in one durable write; a failed write leaves the record as it was and the volume held |
core/host/master/store_attestation.go awaited |
INV-PROMOTE-CREATION-WAIT-001 |
| AwaitingEnd | Established | the line's primary answers ready, or a survivor answers DurableLSN > 0 with its epoch-table row at the current epoch (or none), in any probe; recorded durably and for good | core/host/master/product_loop.go inCreationPhase, firstReadyNow, survivorHoldingAWrite; core/host/master/store_attestation.go noteFirstReady |
INV-PROMOTE-CREATION-WAIT-001 |
| AwaitingStores | DeleteMarked | the delete's reservation, under the lock that ends the wait, while a current replica's store is still unattested; written durably before the reservation; from then on awaited never ends the wait and every record rewrite keeps the mark. AwaitingEnd and Established are never marked (the live-lease refusal stays) |
core/host/master/store_attestation.go markDeleteWithoutAck, awaited, record; core/host/master/volume_delete_authority.go Reserve |
INV-WS-DELETE-WITHOUT-ACK-001 |
| AwaitingStores, AwaitingEnd | (no change) | no replacement decision: no reassign, fencing round, heal, operator move or rebalance; also while the primary's own answer says its assignment at the line's epoch awaits the stores | core/host/master/product_loop.go holdCreating, noteCreating; core/host/master/planned_move.go plannedMoveEvidenceAt, fencedMoveEvidence |
INV-PROMOTE-CREATION-WAIT-001 |
Workspace lease and move, in blockmaster.
TERM-HOLDER-001 uses one owner decision, PublishedLine.Owner (core/authority),
called by Host.workspaceLineOwner and by the snapshot builder's expectOwnerForLine
(a moved line's replica facts come only from its owner, none for an unknown owner). The
stream supplies the PublishedLine captured in its AssignmentInfo; lease/ACK
checks supply the captured leaf view; move source uses a leaf snapshot wrapper.
Publisher.captureAssignmentOwner captures the moved owner under the publication
lock and reloads it from that durable record's workspace journal. A moved line
with unknown owner sends an empty server id; only a move-less line falls back to
placement. Renewal never enters the publisher store-write lock for this lookup.
The stream regression injects an unavailable journal at encoding time; it does
not claim that a pre-issued publication is reachable in the current publisher.
flowchart LR
Reserved[Move reserved] --> Capture[Issue: capture line and moved owner under pub.mu]
Capture --> Durable[Persist line and issuing journal together]
Durable --> Published[Publish assignment and derived lease view]
Published --> Stream[Stream encodes captured line via workspaceLineOwner]
Published --> Lease[Lease and ACK use captured leaf owner]
Stream --> Known[Known moved owner: same server id]
Stream --> Unknown[Unknown moved owner: empty server id]
Stream --> Initial[Move-less epoch: placement owner]
Chunk volume delete and its re-run.
flowchart LR
Ask[MarkVolumeDeleting with token] --> Held{Token holds the reservation, or it is committed?}
Held -->|yes: re-run| Catalog[Catalog step: HEAD compare-and-swap to deleting]
Held -->|no| Verdict{WorkspaceHolderState}
Verdict -->|never started or deleting| Admit[Reservation admitted]
Verdict -->|live, sealed, unknown| Refuse[Refused: volume_in_use]
Admit --> Catalog
Catalog -->|HEAD not held| Mark[HEAD deleting, then purge, then commit]
Catalog -->|a holder claimed HEAD| GiveBack[Refused; reservation given back]
Mark -->|stopped before commit| Ask
Admit -->|stopped before the mark| Ask
Model: NeverStarted r2 exhaustive results.
Model trace: WorkspaceRegrant round 4 pins and simulation results binds the owner-label switch, five configurations and reported results to exact hashes. Captured labels use StreamLabelFromStore=FALSE; the mutant models a lagging send-time owner store. Status is SIMULATION ONLY (3 seeds, 20,000 traces each, depth 120); exhaustive combo10 is pending. No model proof is claimed. The stream regression is an injected fault control; real P5 did not reproduce a pre-issued publication.
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
| none | Granted | RenewWorkspaceLease from the current primary (server id, replica id) at the current epoch; a missing/foreign server is refused by RPC holderMatches (registered server id, gRPC peer on its registered host: refuseWorkspaceHolderHost); no move pending; the first grant is written synchronously and persists the durable horizon now + 1.5·TTL (an epoch issued by a move already has its lease) |
core/authority/workspace_lease_view.go RenewWorkspaceLease, firstWorkspaceGrant; core/host/master/workspace_service.go holderMatches |
INV-WS-LEASE-001, INV-WS-LEASE-HORIZON-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Granted | Granted | current primary server/replica/epoch required by RPC holderMatches (registered server id, gRPC peer on its registered host: refuseWorkspaceHolderHost) (missing server refused); renew from memory (the lease view, leaf lock only) before the durable horizon and the granted deadline; the grant is min(now + TTL, horizon), refused with an error when it would leave no host validity (grant − skew/2 ≤ now); an extender, an ordinary writer under the publisher lock, raises the horizon to trigger + 1.5·TTL |
core/authority/workspace_lease_view.go RenewWorkspaceLease, extendWorkspaceLease; core/host/master/workspace_service.go holderMatches |
INV-WS-LEASE-001, INV-WS-LEASE-HORIZON-001, INV-WS-LEASE-HORIZON-MONO-001, INV-WS-RENEW-NONBLOCKING-001, INV-LEASE-VIEW-001, INV-WS-FORCED-MOVE-REPLY-001, INV-WS-FORCED-MOVE-HALF-SKEW-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Granted | Revoking | BeginWorkspaceRevocation for the matching lease; a renew now returns the revoking lease with the granted expiry, min(horizon, deadline), without extending it |
core/authority/workspace.go BeginWorkspaceRevocation; core/authority/workspace_lease_view.go RenewWorkspaceLease, WorkspaceLeaseReply |
INV-WS-CLEAN-MOVE-001, INV-WS-FORCED-MOVE-REPLY-001 |
| Revoking | Acked | AckWorkspaceRevocation from the primary server/replica at the current epoch, validated by the same RPC holderMatches (registered server id, gRPC peer on its registered host: refuseWorkspaceHolderHost) (missing/foreign server refused), an authoritative detached HEAD matching the ACK epoch/holder/position, for a first ACK, positive granted validity after half the configured/persisted skew on the publisher clock; a matching recorded stop answers before any lease check without writing, while a different second acknowledgement is refused |
core/authority/workspace.go AckWorkspaceRevocation; core/host/master/workspace_service.go holderMatches |
INV-WS-CLEAN-MOVE-001, INV-WS-REVOKE-ACK-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Acked | Moved (clean) | HEAD detached by the expected holder at the expected epoch, and the acknowledgement names that HEAD generation; the target may be the same host, with a newly issued epoch and every binding/collision/isolation check retained | core/authority/workspace.go prepareWorkspaceMoveLocked, validateWorkspaceMoveRequest; core/host/master/workspace_service.go workspaceMoveCheckLocked |
INV-WS-CLEAN-MOVE-001, INV-WS-SAME-HOST-CLEAN-MOVE-001 |
| Acked or Expired | (move refused, nothing written) | blockmaster admits a move only with valid target endpoints (host:port, port 1..65535, data and ctrl distinct), a known source host, a registered target node (including the source host; clean proof or forced-move lease barrier still required), and target endpoints that either match a live per-volume binding or, for a volume without bindings, lie on the target node's registered hosts (any port) and are not owned by another assignment or binding, and, under strict journal isolation, a target node whose durable root does not share the authority store's file system (the retry of an issued move excepted); each refusal names its condition and is logged | core/host/master/workspace_service.go MoveWorkspace, workspaceMoveCheckLocked; core/host/master/journal_isolation.go colocatedTargetRefused |
INV-WS-CLEAN-MOVE-001, INV-WS-FORCED-MOVE-001, INV-MASTER-JOURNAL-ISOLATION-001 |
| Granted or Revoking | Expired | the granted deadline passes | core/authority/workspace_lease_view.go RenewWorkspaceLease; core/authority/workspace.go AckWorkspaceRevocation |
INV-WS-FORCED-MOVE-001 |
| Expired | Granted | Same current primary server/replica/epoch, validated by RPC holderMatches (registered server id, gRPC peer on its registered host: refuseWorkspaceHolderHost) with missing server refused, no pending move or revocation/ACK, store certain; horizon and granted/restart deadline plus full skew both passed (the existing forced-move barrier); a busy authority writer refuses this attempt, otherwise persist the new horizon before its grant. A terminal guard stays terminal; a new process claims HEAD before I/O. |
core/authority/workspace_lease_view.go regrantWorkspaceLease; core/authority/workspace.go forcedMoveBarrierLocked; core/host/master/workspace_service.go holderMatches |
INV-WS-LEASE-REGRANT-001, INV-WS-REOPEN-FENCE-001, INV-WS-CLAIM-BEFORE-SERVE-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Awaiting assignment / fenced | Process exited | Workspace chunk primary only: exhausted startup wait (INV-WS-MASTER-WAIT-001: 30 s of answered contact past the master's barrier time; no bound while the master gives no reply) or lease fence exits 75 after bounded cleanup; a typed master FINAL refusal for a recorded revocation exits 79, while MOVED or DELETED exits 78 at once (an issued moved source may be refused on subscription before any own assignment); a foreign master fact newer than nonzero observed-own lineage or exact foreign HEAD at or above the assigned epoch permits 78. Planned drain retires startup monitoring before cleanup; ACK and signal retain normal exit. Restart follows the unchanged grant and HEAD-claim gates. |
cmd/blockvolume/process_exit.go superviseProcess, watchChunkStartup, waitWorkspaceStop; core/frontend/durable/provider_startup.go endChunkStartup |
INV-WS-STARTUP-RETRY-001 |
| Expired | Moved (forced) | target may be the source host; explicit force; the granted or restart deadline plus the clock-skew bound has passed (this process's own deadline: the latest grant it made, or after a restart the restart floor; no wall value an earlier process wrote is read), for the lease the last move issue started (never a predecessor's); blockmaster reads HEAD only after this admission; HEAD is the expected holder's at the expected epoch or any HEAD at an older epoch (the holder never claimed it, or an earlier holder's late claim landed; the lost range starts at that HEAD's remote LSN); a HEAD at the expected or a higher epoch that is not the expected holder's is refused; the lost range (the HEAD's remote LSN, the barrier as LostUntil, the HEAD's generation via the move record and the HEAD entry's filer mtime read with HEAD, or unknown) is written before the reservation. The OSS operator client sends the explicit force only with --confirm-forced <volume>@<expected epoch>; PreviewWorkspaceMove runs this admission (HEAD read only once admitted) and writes nothing |
core/authority/workspace.go prepareWorkspaceMoveLocked, WorkspaceForcedMoveAdmitted, forcedMoveBarrierLocked, workspaceHeadAdmits, PreviewWorkspaceForcedMove; core/authority/workspace_lost_range.go recordLostRangeLocked; core/host/master/workspace_service.go MoveWorkspace, PreviewWorkspaceMove; core/rpc/wsclient/wsclient.go ForceMove |
INV-WS-SAME-HOST-CLEAN-MOVE-001, INV-WS-FORCED-MOVE-001, INV-WS-LEASE-HORIZON-001, INV-WS-LOST-RANGE-READOUT-001, INV-WS-FORCED-CONFIRM-001 |
| none, Granted, Revoking or Expired | Deleting | the chunk volume delete is admitted with WorkspaceHolderState = never started or deleting (TERM-LIVE-HOLDER-001): HEAD, read by blockmaster before its locks, is below the line's epoch, or already past the fence (deleting, purging, deleted: the rerun of a delete that stopped midway); no move pending. From then on renewals, grants, re-grants, revocations and moves of the volume are refused; the delete's HEAD compare-and-swap to deleting is its linearization point: a claim applied before it makes the delete refuse volume_in_use and give the reservation back, a claim after it fails. The lifecycle DeleteVolume reads no HEAD and keeps the ACK rule |
core/authority/workspace_holder_state.go WorkspaceHolderState; core/authority/workspace.go RecordWorkspaceDeletion; core/host/master/services.go MarkVolumeDeleting, deleteHolderEvidence; core/frontend/chunkstore/volume_delete.go (HEAD to deleting) |
INV-WS-DELETE-NO-LIVE-HOLDER-001, INV-WS-CLAIM-BEFORE-SERVE-001 |
| Moved | epoch issued | the moved owner is captured with the assignment under pub.mu and persisted with the issuing move journal before publication; the stream uses that captured owner, empty when unknown, with placement fallback only for a move-less epoch; a retried request id gets the same epoch; the issue write starts the new holder's lease (horizon issue + 1.5·TTL, granted deadline issue + TTL), published with the epoch in one lease-view section and never lowering a deadline a renewal raised; the new holder is then Granted, and one that dies before its first renewal still expires; the answer to an issued forced move (also a replay) carries its stored lost range, or no range and the reason when that record is missing or fails its checks; a failure after the issue is answered as issued-but-failed (Internal, rerun with the same request id), never as a refusal, and the issue is still logged; an issuing write whose durable outcome is unknown is answered as unknown (Internal, restart then rerun with the same request id) |
core/authority/workspace.go prepareWorkspaceMoveLocked, issueWorkspaceMove, MoveWorkspace; core/authority/assignment_owner.go captureAssignmentOwner; core/host/master/services.go assignmentFact; core/host/master/workspace_binding.go workspaceLineOwner; core/authority/workspace_lease_view.go publishIssuedLeaseLocked; core/host/master/workspace_service.go grantWithLostRange, postIssueError |
INV-AUTH-MOVE-JOURNAL-001, INV-LEASE-VIEW-001, INV-WS-LOST-RANGE-READOUT-001, INV-WS-LOST-RANGE-FAILCLOSED-001, INV-WS-LOST-RANGE-AUDIT-001, INV-WS-LOST-RANGE-UNCERTAIN-001 |
M3 Replica role and peer state
The role a blockvolume takes from each assignment, its replica listener's admission, and the primary's view of each replica. This is the replication engine of core §1.6 (which has the peer-state diagram) as the Kubernetes line uses it; promotion is in Kubernetes §6 (diagram) and the failover sequence in Kubernetes §4.
stateDiagram-v2
[*] --> Unassigned: listener with a floor record, no role yet
Unassigned --> Primary: fact names self (server id + replica, delivered only to its registered host) and its line this process's incarnation, listener fenced at e
Unassigned --> Supporting: fact names another primary, self in peers
Supporting --> Primary: promotion, fact names self at a higher epoch and its line this process's incarnation
Primary --> Supporting: fact names another primary, self in peers
Primary --> Excluded: fact names another primary, self not in peers
Supporting --> Excluded: fact names another primary, self not in peers
Excluded --> Supporting: later fact lists self as a peer
The apply gate retains versions only above its certified contiguous prefix P. Completed recovery plus post-close healthy publication sends an explicit full-lineage certificate; current listener admission and the durable boundary guard it. A catch-up certificate also requires a covered starting image (local R at its lane marker no greater than P); a completed full BASE supplies its own image. A missing certificate retains history. Sync R, ordinary live traffic and session changes do not advance P. This implementation prunes at successful recovery certification only; healthy-run growth remains an RF2 qualification limitation until ordered-live certification is wired (#297). Settled superseded logical sessions release coverage after their admitted frames finish; shared versions and P survive. Seed enumeration and healthy-run growth remain RF2 qualification limits.
Host role and listener admission.
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
| any | (no change) | local readiness blocked (recovery pending or failed): the fact is stored and replayed when readiness clears | core/host/volume/host.go applyFact, replayLocalReadinessFactIfReady |
INV-ROLE-READINESS-BLOCK-001 |
| any | (no change) | a role call below the current desired epoch is refused and does not clear a newer admission failure | core/host/volume/host.go fenceSelfWithPeers, latchRoleAdmission |
INV-ROLE-STALE-REPLAY-001 |
| any | (no change) | a primary fact for this replica whose line names another process (a dead incarnation), or in production none: nothing is recorded or adopted (no self-assignment, watchdog, replica set or role) until the master re-issues it for this process | core/host/volume/host.go applyFact |
INV-AUTH-RESTART-REISSUE-001 |
| Unassigned, Supporting | Primary at e | the primary fact names this process server and replica via assignmentNamesSelf, without comparing endpoint strings (routing data, reported as status/log warning on mismatch); missing/foreign server is refused; refused foreign facts are recorded but fence only an adopted own lineage that IsSuperseded finds strictly older (unassigned and older replay keep waiting); refusePrimaryAssignment rejects a candidate behind a newer foreign line or naming a different server at the same epoch before adapter admission; the replica set is installed; the listener is fenced as primary and its floor e is persisted before the adapter is told; for a workspace volume the master delivers the fact only to a registered server id streaming from its registered host (SubscribeAssignments with refuseWorkspaceHolderHost) |
core/host/volume/host.go applyFact, fenceSelfWithPeers; core/transport/replica.go FenceAsPrimary, raiseFloor |
INV-FENCE-SELF-ON-PROMOTE-001, INV-FENCE-FLOOR-DURABLE-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Unassigned, Primary | Supporting at e | the fact names another primary and lists this replica as a peer; the floor e is persisted first; the frontend stays gated | core/host/volume/host.go applyFact; core/transport/replica.go AdmitAsReplica |
INV-FENCE-FLOOR-DURABLE-001 |
| Primary, Supporting | Excluded | another primary excludes this replica, or IsSuperseded finds a foreign-server fact strictly newer than an adopted own lineage; record the foreign line, close ingress and gate the frontend; unassigned and older/equal foreign replay do not fence; endpoints are not identity; refusePrimaryAssignment rejects any candidate changing a recorded server within the same epoch, regardless of endpoint version | core/host/volume/host.go applyFact, recordOtherLine; core/host/volume/projection_bridge.go projectionWithSupersede |
INV-ROLE-SUPERSEDED-001, INV-FENCE-STALE-PRIMARY-001, INV-AUTH-HOLDER-IDENTITY-001 |
| Excluded | Excluded (no change) | an older recorded foreign fact cannot replace the newer epoch/endpoint-version fence; a stale replay cannot re-enable the frontend | core/host/volume/host.go recordOtherLine, IsSuperseded |
INV-AUTH-HOLDER-IDENTITY-001 |
| any | role admission failed | the listener cannot be fenced or its floor cannot be persisted; the role is not adopted and the projection is not healthy | core/host/volume/host.go latchRoleAdmission |
INV-FENCE-FLOOR-DURABLE-001 |
| (every inbound frame) | — | a mutating frame is refused on a primary, below the floor, or before a role is known; the rebuild port applies the same rules; a failed apply closes the connection | core/transport/replica.go acceptMutationLineage, admitMutation, EnterDualLane, handleConn |
INV-FENCE-SELF-ON-PROMOTE-001, INV-FENCE-FLOOR-DURABLE-001, INV-REPL-REBUILD-PORT-FENCE-001, INV-REPL-APPLY-FAIL-001 |
| Supporting | promotion candidate | no active recovery session; member, reachable, caught up, fenced at the current epoch, post-rebuild durable acknowledgement delivered; for RF=2 and up also a fresh probe and coverage of the required frontier: known, or proven by at least N_peers-K+1 fresh ready peers when it is unknown; on the automatic path also a non-best_effort master profile that every answer of the plain and the fencing round states (a primary of a replicated line serves only under the profile its assignment names) |
core/engine/promotion_ready.go BuildPromotionReadyFact; core/host/master/product_loop.go applyPromotionEvidenceGate, automaticFailoverHold, fencedDecision; core/host/volume/workspace_startup.go noteAckProfile |
INV-REPL-PROMOTION-READY-001, INV-PROMOTE-FRONTIER-001, INV-PROMOTE-FRONTIER-PROBE-001, INV-PROMOTE-FRONTIER-UNKNOWN-001, INV-PROMOTE-FRONTIER-BEST-EFFORT-001, INV-PROMOTE-ACK-PROFILE-MATCH-001, INV-PRIMARY-ACK-PROFILE-001 |
| Primary (unreachable) | another replica Primary at e+1 | the operator's failover (ExecuteFailback) of a line whose primary has no fresh, reachable heartbeat slot: the fence is pending from the attempt; the fencing round fences every other replica at e+1; only fencedDecision's allowed target is published, basis Fenced at e+1, through the line's conditional update (a concurrent promotion-loop decision at the same epoch is refused); a refused or unpublished round is healed by either gate (the line's own primary continued at e+1); best_effort is refused, and a reachable RF3 sync_quorum primary's move stays refused (needs a seal) |
core/host/master/planned_move.go plannedMoveEvidence, primaryUnreachable, fencedMoveEvidence; core/host/master/product_loop.go applyPromotionEvidenceGate, applyUnsupportedPromotionEvidenceGate |
INV-PROMOTE-UNKNOWN-CURRENT-001 |
Recovery observation and apply ordering. A probe publishes its fresh boundaries before reachability, and each emitted recovery is prepared under the adapter mutex before the next event. Same-identity delayed probes retain completed durable R; missing probe boundaries remain unknown until a valid observation arrives. Every lane and session shares one replica-wide per-LBA applied-LSN map under the apply mutex; session close releases coverage only. Recovery skips stale data while advancing its own coverage; stale live data fails without advancing recovery coverage.
Peer state, as the primary sees each replica (type ReplicaState in core/replication/peer.go). A new peer starts Healthy (NewReplicaPeer).
The peer queue owns steady-session exchanges, including reconciliation,
promotion seed barriers and durability-coordinator barriers. Only its worker
invokes the raw ship, barrier, store-learning and fence bodies. Saturation
closes steady admission; reconciliation still uses that same worker so a
successful heal can reopen admission. Closing the peer stops the worker. A barrier request also uses the existing
shipper frame-write mutex because the shipper timer can emit on that connection
outside the peer worker.
See INV-REPL-SESSION-ONE-EXCHANGE-001 (SessionExchange.OwnAnswer).
| From | To | Event and guard | Enforced in | Protects |
|---|---|---|---|---|
Healthy, Unknown |
Degraded or CatchingUp |
ship, barrier or fence failure; or a probe that needs catch-up | core/replication/peer.go ReplicaPeer.SetState, replicaStateTransitionAllowed |
INV-REPL-PEER-TRANSITIONS-001 |
Healthy |
Degraded, then NeedsRebuild |
the promotion seed barrier, or a heal (engine healthy verdict, recovery session done), reconciles the peer by (last data epoch, end) against the epoch table and finds it diverged; a sync barrier counts only a Healthy peer |
core/replication/volume.go seedNewPeerLiveCursorsLocked, reconcilePeer; core/replication/peer.go HealIfInSync; core/replication/peer_work_queue.go |
INV-REPL-DIVERGENT-TAIL-001, INV-REPL-EPOCH-TABLE-001 |
Degraded |
CatchingUp or NeedsRebuild |
the engine decides catch-up when the gap is in the primary WAL, rebuild when it is not | core/engine/apply.go decide |
INV-REPL-CATCHUP-REBUILD-001, INV-REPL-RECOVERY-SESSION-UNIQUE-001 |
CatchingUp |
Healthy, Degraded or NeedsRebuild |
done-acknowledgement; failure; WAL recycled or retries exhausted | core/replication/peer.go ReplicaPeer.SetState |
INV-REPL-PEER-TRANSITIONS-001 |
any but NeedsRebuild |
Healthy |
recovered | core/replication/peer.go replicaStateTransitionAllowed |
INV-REPL-PEER-TRANSITIONS-001 |
NeedsRebuild |
— | no successor through SetState or Invalidate; the rebuild runs as a separate session (single-lane by default, dual-lane with --recovery-mode=dual-lane) |
core/replication/peer.go replicaStateTransitionAllowed |
INV-REPL-PEER-TRANSITIONS-001 |
ReplicaPeer.Invalidate, called on a ship, barrier or fence error, goes through the same gate as SetState (replicaStateTransitionAllowed): Healthy, Degraded and CatchingUp move to Degraded; from NeedsRebuild the state is kept and the reason is still logged (#182). A replicated Sync is judged per durability mode (core/replication/durability.go EvaluateBarrierAcks; INV-REPL-DURABILITY-MODE-001).
M4 Workspace HEAD holder and takeover
One host at a time holds a workspace volume's HEAD in SeaweedFS. The sequence diagram of a clean and a forced move is in agent workspace §7; blockmaster's side of the lease is in M2.
stateDiagram-v2
state "Lease guard (host)" as G {
[*] --> NoLease
NoLease --> Valid: renewal reply for this volume, replica and epoch
Valid --> Valid: renewal before the local deadline
Valid --> StopPending: detach started (renew at once)
StopPending --> StopPending: renewal, then sleep at most 250 ms
StopPending --> Valid: that detach provably aborted, serving resumed
StopPending --> Fenced: deadline passed, invalid reply, or revoking
Valid --> Fenced: deadline passed, invalid reply, or revoking
Fenced --> Drained: frontend and cuts stopped
Drained --> Acked: revocation acknowledged with the HEAD gen
}
state "HEAD holder" as H {
[*] --> Attaching: this process took the volume's host lock
[*] --> Refused: another live process holds the volume's host lock
Attaching --> Claiming: fresh or same-holder local root
Attaching --> Refused: existing root, HEAD published by another holder or above its durable LSN
Claiming --> Cooling: replace generation (or exclusive create), same image
Cooling --> Holder: configured window elapsed (zero for single filer), exact HEAD reread
Cooling --> HolderFenced: publication displaced
Claiming --> HolderFenced: HEAD epoch higher, or another holder at this epoch
Claiming --> Detached: same epoch/holder already sealed; refuse before preparation
Holder --> Detached: Detach final cut, state detached
Holder --> HolderFenced: a superseding HEAD is seen
}
| From | To | Guard | Enforced in | Protects |
|---|---|---|---|---|
| NoLease, Valid | Valid | the reply names this {volume, replica, epoch}, its validity is positive and at most 30 s, and it arrives before the old deadline; the new deadline is anchored to the request start |
core/host/volume/workspace_lease.go Refresh |
INV-WS-LEASE-001, INV-WS-FORCED-MOVE-001, INV-WS-FORCED-MOVE-HALF-SKEW-001 |
| NoLease, Valid, StopPending | Fenced | the local deadline passes (checked on every projection read), the reply is invalid, the lease is revoking, or synchronous host shutdown fences through the guard; first cause is kept and a fenced guard never reopens | core/host/volume/workspace_lease.go permits, Refresh, fenceLocked; core/host/volume/workspace_runtime.go FenceWorkspaceLease |
INV-WS-LEASE-001 |
| Valid | StopPending | a chunk detach of this volume starts (before its drain); the guard renews at once. Scheduling only: StopPending admits, fences and ACKs exactly as Valid | core/frontend/durable/provider_chunk.go DetachVolume; core/host/volume/workspace_runtime.go WorkspaceStopPending; core/host/volume/workspace_lease.go StopPending |
INV-WS-STOP-PENDING-001 |
| StopPending | StopPending | each sleep after a completed renewal is at most stopPendingPoll (250 ms); a renewal already in flight is not interrupted |
core/host/volume/workspace_lease.go renewDelay, Run |
INV-WS-STOP-PENDING-001 |
| StopPending | Valid | only the latest detach attempt, provably not applied, with serving resumed; an applied, fenced or unknown outcome, or an older attempt's resume, leaves StopPending | core/frontend/durable/provider_chunk.go resumeAfterDetach; core/host/volume/workspace_runtime.go WorkspaceStopResumed; core/host/volume/workspace_lease.go ClearStopPending |
INV-WS-STOP-PENDING-001 |
| Fenced | Drained, Acked | the stop callback succeeded; only then, and only when revoked, the acknowledgement is sent; a call that got no answer (DeadlineExceeded, Unavailable) is made again until the lease deadline, any other answer is final |
core/host/volume/workspace_lease.go drain, retryableAckError |
INV-WS-REVOKE-ACK-001, INV-WS-REVOKE-ACK-RETRY-001 |
| (start) | Attaching, Refused | the volume's host lock /run/sw-block/locks/<volume id>.lock is taken before the store opens; held by another live process, or its directory or file cannot be created or opened, refuses (storage.ErrWALStoreLocked, ErrVolumeLockDirUnavailable) |
core/frontend/durable/provider.go DurableProvider.lockVolumeOnHost (from ensureHandle) |
INV-WS-ONE-PROCESS-PER-HOST-001 |
| Attaching | Refused | a local root from another claim or behind HEAD's position (layout.ErrStaleLocalRoot): final typed refusal with a cure, no serving or retry |
core/frontend/durable/provider_layout.go startLayoutRoot; provider_chunk.go recoverChunk, chunkAuthorityWait |
INV-WS-STALE-LOCAL-ROOT-001 |
| (startup) | Refused | The agreed leader lists another filer or several; or all configured masters cannot agree and confirm exactly the target within 60 s (ErrNotSingleFiler) |
core/frontend/chunkstore/single_filer.go CheckSingleFiler; cmd/blockvolume/chunk_remote.go newChunkWiring |
INV-WS-SINGLE-FILER-001 |
| (startup) | (startup), chunk guard on or off | on only if the filer definitely refuses the probe's mismatched chunk-condition update of a disposable HEAD; then every store the catalog opens sends the chunk condition. Any other answer leaves it off (page re-read only) and refuses nothing. sw-block metadata writers run the same probe within their --timeout | core/frontend/chunkstore/startup_head_probe.go checkConditionalHead, probeChunkCondition, ProbeChunkGuard; cmd/sw-block/chunk_b.go bCatalog |
INV-WS-CHUNK-CONDITION-PROBE-001 |
| Claiming | Holder | Start validates the local root against the HEAD it conditionally updates; a fresh root seeds before claim, an ordinary reopen keeps its acknowledged local WAL and HEAD identity; guest I/O waits for assignment and claim | core/frontend/chunkstore/layout/start.go Start; core/frontend/chunkstore/layout/claim.go RunClaim; core/frontend/durable/provider_layout.go startLayoutRoot |
INV-WS-CLAIM-BEFORE-SERVE-001, INV-SNAPK-HEAD-WRITE-001 |
| Claiming | Detached (non-serving) | a same-epoch detached HEAD refuses Start without changing its sealed image; a higher-epoch claimant retains that image | core/frontend/chunkstore/layout/start.go Start; core/frontend/chunkstore/layout/claim.go Claim |
INV-WS-SEALED-REOPEN-001 |
| Claiming | Holder, or not installed | an unknown transition outcome is resolved by its claim/session identity and the current HEAD; no unverified local success | core/frontend/chunkstore/layout/claim.go RunClaim; core/frontend/chunkstore/layout_remote.go LayoutRemote.CASHead |
INV-WS-CAS-UNKNOWN-001 |
| Holder | Holder | every publish is a cut (M5) | core/storage/chunk_layer.go captureLocked |
INV-SNAPK-HEAD-WRITE-001, INV-WS-HEAD-MONOTONE-001 |
| Holder | Detached | Detach publishes the final cut with state detached in one CAS |
core/storage/chunk_layer.go chunkLayerImpl.Detach, captureLocked |
INV-WS-CLEAN-MOVE-001 |
| Holder | HolderFenced | a conflicting HEAD owner (including a regressed epoch) or a displaced publication is observed; local data and an unresolved cut session remain | core/storage/chunk_layer.go supersededBy; core/frontend/chunkstore/layout_remote.go LayoutRemote.CASHead |
INV-SNAPK-HEAD-WRITE-001 |
| Holder | (lazy read) | a block missing locally is fetched from HEAD and installed only if it does not overwrite a newer local extent version; a newer WAL-only write still wins on reads, and HEAD's value may be installed beneath it as the backing value, which is correct if a crash loses that unsynced write; a block that reached the extent while its chunk was absent is already local (a chunk store drains nothing before its chunk layer attaches) | core/storage/chunk_layer.go OnReadMiss, installFetchedBlock; core/storage/flusher.go flushOnceInternal |
INV-CUT-READMISS-001, INV-CHUNK-LOCAL-BEFORE-FETCH-001 |
| Holder | (hydration wait) | one request deadline covers all missing chunks; callers may detach, but bounded per-layer workers retain and join each shared fill; HEAD/generation/local-write checks still govern installation | core/storage/chunk_hydration.go; core/frontend/durable/storage_adapter.go readStorageBlock |
INV-CUT-HYDRATION-WAIT-001, INV-CUT-READMISS-001 |
| Holder | (background hydrate) | an independent restore's walker fills every HEAD-named absent chunk through the same shared fill flights (never a second fetch, never over a local write); it yields while any flight has guest waiters, takes one host fill permit per flight (no cut payload, class BackgroundFill from the caller) and the permit is released only when that flight's I/O is over, also when the walker returns early on cancel, revocation or close |
core/storage/chunk_hydrate_all.go HydrateAll, startWalkerFill, admitFill; core/storage/chunk_hydration.go hydrationFlightLocked |
INV-RESTORE-HYDRATE-001, INV-CUT-READMISS-001 |
M5 The cut pipeline
A cut publishes the local image at a quiesced, synced LSN H as the next HEAD. The steps are described in agent workspace §5, and the figure in §3 shows them against the remote layout. All steps are in core/storage/chunk_layer.go captureLocked unless stated.
stateDiagram-v2
[*] --> Admit
[*] --> Refused: invalid frozen request; invalid_freeze_budget; no provider mutation
[*] --> Refused: valid frozen request; frozen_detach_unsupported; no provider call
Admit --> Refused: budget refused, closed, fenced, detached, base install, or lineage or lease invalid
Admit --> PlainStop: plain detach and idle frontend lock acquired
PlainStop --> Quiesce: idle frontend closed; caller-bounded offline seal
PlainStop --> RemoteProof: repeat plain seal, including after restart
Settled --> RemoteProof: plain seal result needs a fresh filer read
RemoteProof --> SealedReply: exact detached proof and unchanged authority
RemoteProof --> Refused: unreadable, foreign or malformed proof; never use memory
Admit --> FrozenForecast: guest already frozen with an explicit origin
FrozenForecast --> Refused: unknown or non-fitting remaining budget
FrozenForecast --> Quiesce: plausible estimate or explicit final override; skip staging
Admit --> Stage: ordinary cut; budget admitted, earlier unknown CAS settled
Stage --> Quiesce: spill-budget remainder reached or no shrink
Quiesce --> Refused: guest-frozen budget recheck failed; no payload upload
Quiesce --> FinalFreeze: measured admission or explicit frozen final override
FinalFreeze --> OpenWindow: admission stays closed through detached settlement
Quiesce --> OpenWindow: ordinary round; Sync H and D fixed under barrier; release all held admission
OpenWindow --> Copy: release barrier
Copy --> Upload: local entry released, session begun first
Upload --> Copy: next unsent candidate
Upload --> Closed: all workers settled
Copy --> Aborted: error, budget revocation, cancellation, observed fence, recovery or close
Upload --> Aborted: error, cancellation, observed fence, recovery or close
Aborted --> Refused: drain owners, retain reusable uploads, merge candidates
Copy --> Refused: H below HEAD RemoteLSN
Closed --> Manifest: drain owners and cleanup
Manifest --> Readmit
Readmit --> Fenced: superseding HEAD
Readmit --> CAS
CAS --> Settled: CAS ok, or a re-read shows the proposal
CAS --> Pending: outcome unknown and HEAD unchanged
CAS --> Fenced: HEAD moved to a superseding holder
CAS --> Refused: answered pre-write guard, or HEAD moved otherwise (conflict)
CAS --> Fenced: HEAD moved without superseding and changed the chunk root (foreign root)
Pending --> Fenced: its settlement finds a foreign root
Pending --> Admit: next cut settles it first
| Step | Guard | Enforced in | Protects |
|---|---|---|---|
| Admit | optional Budget admitted before staging/barrier; not closed, fenced, detached or installing a base; CaptureAllowed (healthy primary, unchanged lineage, valid lease) |
core/storage/chunk_layer.go admit, captureLocked; core/frontend/durable/provider_chunk.go newChunkLayer (CaptureAllowed) |
INV-WS-LEASE-001, INV-CUT-PAYLOAD-BOUNDED-001 |
| Answered HEAD refusal | the remote proves the conditional write was not sent; preserve the typed cause and reusable uploads, create no pending proposal. A refused re-proposal or confirmation read cannot decide an earlier uncertain write. | core/frontend/chunkstore/layout_remote.go layoutRemoteErr; core/storage/chunk_layer.go captureLocked; core/host/volume/chunk_control.go chunkErrorCode |
INV-WS-CAS-UNKNOWN-001, INV-SNAPK-HEAD-FORMAT-LEVEL-001 |
| Settle pending | an earlier unknown CAS is resolved by re-reading HEAD before any new proposal | core/storage/chunk_layer.go resolvePending |
INV-WS-CAS-UNKNOWN-001 |
| Stage | native remaining bytes above half the COW side cap trigger logical-read pre-copy straight to remote; repeat only while the remainder shrinks; legacy fixtures retain the chunk-count bound; the holder session begins before its first upload | core/storage/chunk_layer.go stage |
INV-CUT-INTENT-FIRST-001, INV-CUT-STAGED-REUSE-001, INV-CUT-PAYLOAD-BOUNDED-001, INV-CUT-READ-LOGICAL-001 |
| Plain detach | plain=true acquires exclusive idle frontend admission (closed handles allowed), then StopIO and caller-bounded seal. Busy requests mutate nothing; publication and settlement retain authority/HEAD checks. | provider_chunk.go DetachVolumePlain; storage_adapter.go stopPlainDetachIfIdle; chunk_control.go handleChunkDetach |
INV-CUT-PLAIN-DETACH-001, INV-WS-HEAD-BELT-001 |
| Plain seal replay | a fresh B HEAD must be detached with the local claim id, exact epoch and holder; idle admission remains closed, authority is checked across the read, and no CAS occurs. A same-epoch detached restart may read the proof without an attached runtime; cache alone never answers success. | provider_seal_replay.go replayPlainSeal, readLayoutSeal |
INV-WS-SEAL-REPLAY-001 |
INV-WS-DETACH-ABORTED-001 |
A detach the layout stop settlement reports aborted (its session aborted, HEAD live at this holder's claim, serving resumed) is never proposed again: the next settlement reads HEAD and proposes nothing, and keeps what the detach staged for the next proposal. | detach settlement → serving | core/frontend/durable/provider_chunk.go resumeAfterDetach; core/storage/chunk_layer.go ForgetAbortedDetach, resolvePending |
| Pre-copy admission | (Not reachable in this release; see the note below.) opt-in: close frontend admission and drain registered operations for at most 100 ms before taking the store barrier; rejected attempts clear the pause and grant every waiter FIFO admission under one lock hold before ordinary uploads; each waiter rechecks the ordinary gate without waiting for another I/O to finish | precopy_admission.go BeginPrecopyPause; chunk_precopy.go PrecopyDetachWithAdmission |
INV-CUT-PRECOPY-001 |
| Quiesce | the capture barrier (captureMu) is held exclusively, then Sync fixes H; Recover and writes hold the barrier shared |
core/storage/chunk_layer.go captureLocked; core/storage/walstore.go WALStore.Recover, WALStore.Write |
INV-CUT-QUIESCED-001, INV-CUT-RECOVER-BARRIER-001 |
| Pre-copy detach | (Not reachable in this release; see the note below.) at most five rolling attempts within a cooperative 60 s context; authoritative candidates and measured costs admit the final cut after the bounded drain; a known estimate may use the declared five-second freeze ceiling when it is at least 90% of the previous comparable known estimate or on the final physical round; frozen commands wait up to the five-second cutover budget and receive FIFO admission grants together after a safe abort, without serializing on I/O completion; each queue bound starts at the command arrival | chunk_precopy.go; precopy_admission.go; DurableProvider.DetachVolume |
INV-CUT-PRECOPY-001 |
| Guest-frozen detach | (Not reachable in this release, except the HTTP400 validation; see the note below.) frozen=true carries a non-future guest freeze origin; invalid freeze options return HTTP400 invalid_freeze_budget before any provider admission or mutation (generic bad_request is not that proof); forecast before staging, recheck authoritative candidates after Sync, and perform at most one cut. Ordinary frozen refusal issues no staging/payload upload and retains dirty bytes. Explicit allowOverBudget=true records over_budget and retains authority, drain and CAS settlement checks; actual whole-guest elapsed still reports a five-second violation. |
chunk_frozen_budget.go; chunk_precopy.go; captureLocked; DetachVolumeFrozen; /chunk/detach |
INV-CUT-PRECOPY-001, INV-WS-FREEZE-ACCOUNTING-001, INV-WS-FREEZE-REFUSAL-001, INV-WS-FREEZE-REFUSAL-INPUTS-001 |
| Checkpoint tail | one cost observation reports remaining bytes, tail cost, frozen admission estimate/known bit, storage limit and quiesce slack after a cut. Same-host duration advice is rechecked at admission before upload. | chunk_precopy.go candidateTail; chunk_frozen_budget.go frozenBudgetEstimate; chunk_control.go ChunkCutResponse |
INV-CUT-PRECOPY-001, INV-WS-FREEZE-ACCOUNTING-001 |
| Pre-copy host drain | (Not reachable in this release; see the note below.) a committed freeze keeps commands held while host storage admission closes; transport teardown cancels held commands before joining the session, without issuing their storage work | storage_adapter.go setOperationalLocked; nvme/session.go serve |
INV-CUT-PRECOPY-001 |
| Copy | every candidate chunk (native owned LSN map relative to HEAD plus retained WAL/in-memory dirt) is read by a bounded upload worker at upload time; a staged copy is reused only if unchanged since staging; native copy occurs after barrier release with pre-publication COW ownership | core/storage/chunk_layer.go captureLocked |
INV-CUT-QUIESCED-001, INV-CUT-STAGED-REUSE-001, INV-CUT-BITMAP-001, INV-CUT-READ-LOGICAL-001, INV-CUT-GUEST-BOUNDED-WAIT-001 |
| LSN guard | refuse when H is below HEAD's RemoteLSN (lsn_behind) |
core/storage/chunk_layer.go captureLocked |
INV-WS-HEAD-MONOTONE-001 |
| Upload | upload only chunks whose SHA-256 differs from HEAD, under content-addressed pool names, after Begin opens or replays the holder session covering the staged objects; an immutable slot retries transient failures under per-call deadlines; a completed payload renews the cut window, while failed calls do not | core/storage/chunk_layer.go captureLocked; core/frontend/chunkstore/layout_remote.go Put |
INV-CUT-INTENT-FIRST-001, INV-CHUNK-WRITE-ONCE-001, INV-CUT-PROGRESS-WINDOW-001 |
| Verify | prove ownership or complete conditional adoption of every object in the cut's own plan; each object completes once per attempt and renews the same window after proof, never on a failed lookup or conflicted adoption. Silence ends the cut with cut_stalled; publication guards remain unchanged | layout.allOwnedBySession; cutVerificationObjects.CommitObjectVerified; storage.ReportCutObjectVerified |
INV-CUT-PROGRESS-WINDOW-001 |
| Manifest | prepare the complete root from changed and reused segments; new objects belong to the open session and are verified before commit | core/frontend/chunkstore/layout_remote.go LayoutRemote.CASHead; core/frontend/chunkstore/layout/objects.go PrepareRoot; core/frontend/chunkstore/layout/commit.go RunCommit |
INV-CUT-SEGMENT-REUSE-001, INV-CUT-INTENT-FIRST-001 |
| No-op cut | when nothing changed since HEAD, no CAS is sent, but HEAD is re-read; a HEAD that moved fences the holder | core/storage/chunk_layer.go captureLocked |
INV-SNAPK-HEAD-WRITE-001 |
| Readmit | admission is checked again right before the CAS; a superseding HEAD fences | core/storage/chunk_layer.go admit, supersededBy |
INV-SNAPK-HEAD-WRITE-001 |
| CAS | conditional update on {gen, epoch}, with RemoteLSN = H; refused for a lower epoch, a lower RemoteLSN, or a HEAD in a delete state |
core/frontend/chunkstore/layout_remote.go LayoutRemote.CASHead |
INV-SNAPK-HEAD-WRITE-001, INV-WS-HEAD-MONOTONE-001, INV-HEAD-DELETE-FROZEN-001 |
| Foreign root | a HEAD that moved past the base without superseding the holder and is not its own proposal must keep the chunk root (only metadata writers move HEAD that way); one that changed it fences the layer, at the CAS conflict and at a pending or detach settlement | core/storage/chunk_layer.go adoptHeadLocked (from captureLocked, resolvePending, SettleDetach) |
INV-CHUNK-FOREIGN-ROOT-FENCE-001 |
| Settled | a landed commit ends its session; settle native map capture tokens, keeping chunks dirtied after the cut; a refused current-lineage point retains its session and reusable uploads until retry, supersession or Close; an unresolved commit keeps its session | core/storage/chunk_layer.go finishCut |
INV-CUT-BITMAP-001 |
| Pending | the outcome is unknown and HEAD still shows the CAS base: keep the proposal and its open session for settlement | core/storage/chunk_layer.go captureLocked |
INV-WS-CAS-UNKNOWN-001 |
Not reachable in this release: the frozen detach and the pre-copy detach. /chunk/detach refuses a valid frozen request with frozen_detach_unsupported before any provider call (INV-CUT-FROZEN-DETACH-REFUSED-001), and blockvolume refuses to start with --chunk-detach-precopy (INV-CUT-PRECOPY-FLAG-REFUSED-001). So the transitions Admit → FrozenForecast, FrozenForecast → Refused, FrozenForecast → Quiesce, Quiesce → Refused (guest-frozen recheck), Quiesce → FinalFreeze and FinalFreeze → OpenWindow, and the rows Pre-copy admission, Pre-copy detach, Guest-frozen detach (apart from its HTTP400 validation) and Pre-copy host drain, are not reached by a released process. Their code is kept and still tested below the HTTP handler; the text above is unchanged.
Periodic HEAD cuts are off by default in blockvolume (--chunk-capture-interval
0; when set, at least 5 minutes); they do not create named snapshots. One five-minute
inactivity window covers a cut, renewed only by completed own-object steps;
individual remote calls have 30-second deadlines. Aborted uploads remain rooted
and reusable only while their chunk version and HEAD generation match.
M6 Chunk lifecycle
B stores snapshots, restore dependencies and the active session in HEAD. The transition tables in M9 below are the canonical guards; the former catalog intent, key-binding and elapsed-TTL transitions have been removed.
| Operation | Guard and outcome | Enforced in | Protects |
|---|---|---|---|
| Begin uploads | Open or replay the holder's session before the first object upload; a failed Begin uploads nothing. | core/frontend/chunkstore/layout_remote.go Begin; core/storage/chunk_cut_payload.go streamCutPayloads |
INV-CUT-INTENT-FIRST-001 |
| Commit snapshot | Verify the complete root and objects written in this session, or adopted from an earlier session of this volume (re-stamped, mark cleared), before the conditional HEAD update installs the image and optional snapshot name, then ends the session. | core/frontend/chunkstore/layout/commit.go RunCommit |
INV-SNAPK-COMMIT-REACH-001 |
INV-SNAPK-COMMIT-ADOPT-001 |
The check before a commit's HEAD update adopts an object of this volume present under its name but written by another session, or marked: one conditional update re-stamps it and clears the mark. An object of another volume, or absent, is refused. | M9 snap → idle (Commit) | core/frontend/chunkstore/layout objects.go ownedOrAdopted, commit.go CheckCommitObjects (not the HEAD step's lookups); layout_remote.go prepareCommitLocked opens a session no upload opened and checks against the HEAD its begin wrote |
INV-SNAPK-CLEAN-HOLD-001 |
The holder's cleaning is refused (busy) while an upload of this process awaits a commit: a cut over several requests, HEAD idle between them, keeps what it staged for its commit to adopt. That commit, or the engine dropping its staged uploads (Abort), releases it. | M9 idle → clean (Begin) | core/frontend/chunkstore/layout_remote.go Clean, PutPaced, CASHead, Abort (uncommitted) |
| Abort or settle | Keep reusable uploads in their session; retain an unresolved proposal for settlement. Dropped work aborts the open session; a landed commit has already ended it. | core/storage/chunk_layer.go discardStaged, captureLocked, Close; core/frontend/chunkstore/layout_remote.go AbortOpenSession |
INV-CUT-INTENT-CLOSE-001, INV-WS-CAS-UNKNOWN-001 |
| Restore | Record the target as a source dependent before creating its root and unclaimed HEAD; owner-qualified references resolve in the source pool. | core/frontend/chunkstore/catalog_b.go BCatalog.Restore; core/frontend/chunkstore/layout/create.go |
INV-SNAPK-COMMIT-REACH-001 |
| Remove snapshot | Remove the name through a conditional HEAD transition; its objects remain governed by the roots and dependents still recorded. | core/frontend/chunkstore/catalog_b.go DeleteSnapshot; core/frontend/chunkstore/layout/snapshots.go |
INV-SNAPK-HEAD-WRITE-001 |
| Clean | Cleaning excludes an open snapshot session. Read tags, validate HEAD, then conditionally mark/delete unreferenced roots, segments and chunks in that order. | core/frontend/chunkstore/layout/clean.go; core/frontend/chunkstore/layout/remove.go Cleaner.removePlanned |
INV-SNAPK-CLEAN-EXCL-001, INV-SNAPK-REMOVE-MARK-001, INV-SNAPK-REMOVE-STOP-001 |
| Background cut/clean ordering | New staging retries promptly; zero progress backs off. Dirty-start cleaning waits for a completed store attempt or one interval. After K=3 admitted stalls, guarded discard releases the session and kicks cleaning; request progress resets the streak. | core/frontend/durable/provider_chunk.go; core/storage/chunk_periodic_cut.go |
INV-CUT-RETRY-FAIRNESS-001 |
| Delete volume | Reserve deletion, check no live lease inside the deleting transition, release the reservation, remove objects and mark deleted. | core/frontend/chunkstore/catalog_b.go DeleteVolume; core/frontend/chunkstore/layout/delete.go |
INV-WS-DELETE-NO-LIVE-HOLDER-001 |
Local WAL-pressure durability progress
A serving v3 store at the soft WAL watermark may perform an internal local
sync from its existing flusher, before snapshotting dirty work. This transition
uses the ordinary A/C physical-sync and final fault gate under one syncMu
interval; it takes neither captureMu nor lifecycleMu. It is ineligible while
BASE is installing or the store is closed. The leader is released before extent,
map and checkpoint publication. Client Flush acknowledgements keep their own
covering durability and observer requirements. Recovery invalidates the existing
snapshot lifetime; local persistence does not bypass it.
-
INV-WAL-V3-PRESSURE-001: I1, within a recovery/reset lifetimewackadvances only after covering local persistence; I2, checkpoint remains at mostwackand the active-session pin floor; I3, record reuse remains below the durable checkpoint, both-slot floor and dirty-reference retirement; I4, with healthy local progress and no guest Sync, the reuse floor advances. Enforced bysyncWALBatchV3Internal,persistOwnedMapCheckpointV3and the existing reclaim publisher. Tests:TestWALStoreV3NoClientSyncSixRings,TestWALStoreV3PressureSyncFaultDoesNotPublishFrontiers,TestWALStoreV3PressureSyncSkipsInstalling,TestWALStoreV3PressureProgressWithPendingCutOrCloseandTestWALStoreV3PressureWaitBudgetAndPin. Model correspondence:WALReclaim.tlaI1/I2/I3 andAllWritten/NoStuckWaiterinREC_safe/REC_safe_big; the no-internal-sync mutant violates liveness. Prior authored LIGHT receipts are referenced indocs/spec/README.md; this change does not claim a new TLC execution. -
Store Write/WriteBatch uses no ticket when there is room and no waiter. The append lock retains that space through the append; the queue lock atomically checks no waiter exists, then releases before file I/O. Otherwise admission queues pending invocations by command arrival. A later batch of an older command precedes younger waiters, while an already admitted append cannot be preempted. Equal arrivals use a stable command order. The oldest ticket remains held through the append-capacity decision and is released by the existing post-write Release. A cancelled or refused invocation removes its ticket and wakes the next. No queue mutex is held while sampling pressure, waiting, or appending. Each store call releases its ticket before returning to the adapter; it never spans an RMW read or a replica acknowledgement.
-
An NVMe WAL frontend command carries one arrival-based hold identity through adapter batches. Each queued store call rejoins admission at its original command position and only its head consumes append capacity. Queue-head changes invalidate a prior pressure sample before a capacity grant. Command observations finish after all its store calls return. Caller cancellation and an earlier deadline stay effective. Successful reclaim/extent counter increases renew the per-command inactivity window, never its absolute cap. Other backends keep the four-second cooperative WriteCommandBudget. Already-started physical I/O and short locks are not preempted; no detached worker appends after an expiry answer. Permanent storage faults win over pressure/refusal timing.
-
Every frontend I/O error completion uses one shared retry class (
INV-FE-ERROR-RETRY-CLASS-001, the shared backend-error classification rule): (a) a known permanent cause anywhere in the wrapped/joined tree wins: EIO, ENOSPC, EROFS, counter exhaustion, WAL integrity, prior fsync/append failure, invalid chunk maps, or RecoveryFailure with SubstrateIO/WALIntegrity kind (any cause). Bare short-read EOF is not permanent evidence; local faults carry an integrity/I/O envelope; (b) otherwise a deliberate busy, not-ready, stale, closed or pure expired command-deadline marker decides. Unknown causes under markers do not override them; pressure/hydration/observer causes are not frontend classification atoms; (c) no marker and no known permanent cause retains the permanent default, logged once per unknown leaf error type. Backend owners must classify any unclassified type seen in a gate before GO. Both frontend mappers consume ClassifyBackendError; no storage/authority state changes on completion. -
A flusher cycle sorts native snapshot entries by record offset and reuses at most one fully validated record (bounded by WALSize). Every block still checks its LBA/data offset/LSN/nonce; the cache is local to the snapshot recovery generation and cannot publish or materialize after that lifetime changes.
TestWALStoreV3FlushBatchCacheIsBoundToRecoveryLifetimecovers one batch decode and refusal after Recover. Missing map coverage still forbids checkpoint advancement; the earlier unmapped dark fixture is not a production geometry.
M7. Host background-cut admission
free -> [waiting] -> admitted -> draining -> joined -> released; process death releases its OS locks (slots, tickets, the pending hold). Configuration is published by temporary-file sync and rename under its OS lock; a killed initializer leaves no partially visible configuration. Admission precedes staging/barrier; a hold is revoked only after its no-progress window (NoProgress, default 60 s) passes with no progress of its work (a chunk compared, staged or uploaded by the cut; INV-HOST-HOLD-NO-PROGRESS-001), and revocation cancels the cut but keeps its slot until workers join. Chunk fetches (a guest read miss, a hydrate-all fill) hold one of the host's FetchSlots (default 64) across their remote read only, after the limiter's first fetch checked the host's configuration; with all held they wait, unordered and bounded by the read's own timeout (a read miss answers pending) (INV-HOST-FETCH-CAP-001). A Normal hold at least YieldAfter old (default 5 min) yields its slot at its cut's next staging batch while another cut on the host holds a live ticket (INV-HOST-CUT-YIELD-001): the attempt ends as yielded, keeps what it staged, and its next attempt takes a ticket at the back; a lone hold never yields. Urgent can borrow normal slots; normal cannot borrow urgent. Unavailable pools skip background work with an alarm; urgent move-final and named seals may use per-process fallback with no coordinated host-cap claim. Guest COW only accounts locally; guest I/O and WAL reclamation never acquire slots.
Waiting (timer cuts). A timer cut waiting for a slot holds a ticket: a file in tickets/ named by its due time on the host monotonic clock, locked while it waits; it is taken by create, lock, and a re-check that the path still names the locked file. It is admitted only when no earlier ticket is live: an earlier ticket whose lock can be taken (its process exited) is removed by lock, re-check, unlink, unlock; a live one is passed only after the waiter has seen it stay ahead for 2 s of time with a normal slot free and no urgent work pending, summed across polls (a busy period pauses the count; the skip rule; it can be wrong about a slow holder: ticket order is fairness only, the slot lock is the exclusion). Only the earliest live earlier ticket not yet judged stalled is observed; a process keeps its judgement, for its later tickets too, until that ticket's file disappears, so one stalled ticket costs one skip, not one per hand-off. Admission consumes the ticket; a success elsewhere, fencing, Close, exit, not attempting (backoff, spacing, reconciling), or a refusal that waiting cannot fix drop it (the reason is reported). A refusal for held slots, pending urgent work, an earlier ticket or a held configuration lock is a wait. A timer cut that meets another capture holding the capture lock waits for it and is then skipped (that capture restarted the timer); while it waits, other waiters judge its ticket stalled after the skip time, once.
Urgent-pending. Urgent work holds urgent-pending shared for its lease, taken with a bounded 200 ms wait and otherwise not taken (counted): the hold only keeps new Normal admissions away. A waiter probes it exclusively from just before its slot try-lock until that try-lock is made. Urgent work is a seal, a detach, a named or scheduled snapshot and a cut with a minimum LSN. An explicit cut without one is Normal: it takes no ticket, is not ordered with timer cuts, and takes no urgent fallback when the pool is unusable. The configuration lock is taken with a bounded wait (50 ms); held longer, the answer is ErrSlotsHeld, a wait.
Pacing. Payload uploads are paced at the budget divided by the normal and urgent slots held on the host, counted by shared non-blocking probes once per PayloadBytes of a process's uploads; after a change of the held count each process may send one payload at its old rate. Fallback leases keep a per-process divisor.
Premise. A live process that holds a lock runs its timers; M7 cannot break a kernel lock held by a live process. A stopped or hung slot holder keeps its slot, and a stalled holder of urgent-pending (a hung stop) keeps Normal admissions refused, until it exits; both are removed by their supervisor. Status reports since when each slot file and urgent-pending have been seen held.
M8. Attached-volume maintenance
PendingAttach -> Armed -> Due -> Running -> Armed; elapsed ticks coalesce.
A stable volume phase staggers the one-hour retention schedule. A kick (a
snapshot deleted through the holder's control route) also moves Armed -> Due;
kicks coalesce, and a kicked pass the volume refused as busy (a cut session
open) re-arms after 30 s instead of the interval. The cleaning is on by default
(owner decision, 2026-11-25; --chunk-maintenance-gc=false turns it off).
Tests: TestMaintenanceKickRunsAPassNow, TestMaintenanceKickedBusyPassRetriesSoon,
TestDefaultConfigCleansAfterEachSnapshotDelete. Detach/fence/Close cancels and joins before
catalog/storage release; only a still-current handle may re-arm after safe abort.
A pass has no total deadline. Its one-minute no-progress window renews only on a strict advance of this pass's finite (phase, cursor) work position; a stalled pass answers no_progress. Each remote request has a separate 30 s deadline; request attempts never renew the window. The existing cursor resumes later; retention failure skips cleaning.
The scheduled-snapshot worker runs beside it under the same owner and join, on
in-process monotonic time: Armed -> Due -> Running -> Armed. A success sets the
next slot; a new attachment seeds the last success and next due time from
HEAD's newest scheduled snapshot (the next per-volume grid slot after its creation time),
or attempts immediately when no scheduled history exists. The grid is the Unix
epoch plus the volume's deterministic phase and whole configured periods,
converted once to this process's monotonic time. A future creation time is
clamped to now. A missed due time stays due; a failure keeps
its typed code and retries after a backoff doubling from 1 min to 1 h; a
restoring volume (absent chunks) is skipped, counted, and retried within 1 h.
A re-armed loop on the same handle keeps this state; a restart reseeds from HEAD,
so it does not reset overdue history. No scheduled metadata is written by seeding.
Tests: TestSnapshotSchedule_SlotsAreOffsetPerVolume, _FailureIsTypedAndBacksOff,
_RestoringIsSkippedAndCounted, TestScheduledSnapshotLoop_TakesEachSlotOnMonotonicTime,
_RearmKeepsTheSchedule, TestScheduledSnapshotRestartsStillTakeTheDueSnapshot,
TestScheduledSnapshotRestartPreservesOverdueFromHEAD.
M9 Snapshot kernel: HEAD transactions over the content-named layout
After CommitPendingSnapshot attempts RunCommit, the adapter's read-back keeps its engine view for that uncertain snapshot-only session if the committed image and owner are unchanged and no payload was uploaded. Ending that marked session alone invalidates no engine staging. Earlier preparation failures keep ordinary session invalidation; an uncertain abort there is not covered. A changed image or holder, or any uploaded payload, retains the existing view invalidation; no write's publication outcome is inferred from cancellation.
A library, core/frontend/chunkstore/layout, with no production caller yet. A volume's HEAD holds its epoch and holder, one activity (idle, snap(s) or clean(c)), the current root and position, and the named snapshots with their dependents. Every transition is one conditional update of HEAD through runTransition; no transition creates a HEAD, and an absent HEAD is refused. Objects (chunks, segments, roots) are written first under content names; the commit is the only step that makes them reachable.
stateDiagram-v2
[*] --> idle: master mints durable layout id; HEAD created outside this package
idle --> snap: Begin(s)
snap --> idle: Abort(s)
snap --> idle: Commit(s, root)
snap --> detached: Commit(s, root, detached)
detached --> idle: Claim at higher epoch, old lease ended
detached --> deleting: MarkDeleting (no holder, no dependents)
idle --> idle: Claim(e, claim id)
snap --> idle: Claim(e, claim id), s void
clean --> idle: Claim(e, claim id), c void
idle --> clean: BeginClean(c)
clean --> idle: EndClean(c)
snap --> snap: PublishList (durable session pages, base CAS)
idle --> idle: DeleteSnapshotWithIntent (adoption chunk-conditioned when the guard is on, pages read again, one CAS)
snap --> snap: DeleteSnapshotWithIntent (adoption chunk-conditioned when the guard is on, pages read again, one CAS)
clean --> clean: AdvanceList (effects then cursor CAS)
clean --> clean: roots, segments, chunk shards and unreached list pages (mark chunk-conditioned when the guard is on, conditional removal)
idle --> deleting: MarkDeleting (no holder, no dependents)
deleting --> deleted: MarkDeleted (after release and pool)
| From | To | Guard | Enforced in | Protects |
|---|---|---|---|---|
| no lifecycle record | named volume with immutable layout id | master lifecycle create mints the id once; a lost directory-sync reply settles the same record on retry. Lookup resolves the durable name/id without creating one; workload launch carries both and selects a local directory keyed by id | core/lifecycle/store.go CreateVolume; master CreateVolume, GetVolume; core/rpc/lifecycleclient ResolveVolume; launcher blockVolumeArgs; blockvolume parseFlags |
INV-SNAPK-VOLUME-DIR-001 |
| pending ordinary create with a proved id8 collision | pending create with a fresh durable layout id | rejected exclusive VOLUME create, valid foreign full identity belongs to the selected name/id8 directory; not ready, not attached, not a restore; persist replacement before retry, settle unknown rename on replay; never modify the colliding volume | LayoutStore.CreateVolumeRecord; FileStore.RedrawPendingLayoutID; master createLifecycleVolume |
INV-CREATE-DIR-COLLISION-001 |
| any version-1 HEAD with reserved lists | same reserved lists after any existing HEAD transition | at most three additional checked cursors, no repeated Ref across list/lists; deep clone and exact preservation; never consumed or a reason to refuse serving | head.go check, clone, runTransition; remove.go Cleaner.Page retains list metadata |
INV-LIST-RESERVED-001 |
| snap(s), list slot empty | snap(s), list cursor published | same full holder, open session and original base generation; every page durable; full slot returns queue_full without replacing work; unknown reply retains protection | list_chain.go StageListPage, RunPublishList |
INV-LIST-PUBLISH-001 |
| clean(c), current list page | clean(c), next continuation or none | exact observed cursor CAS only after authenticated page effects succeed; failed reads and failed effects leave cursor unchanged | list_chain.go RunAdvanceList |
INV-LIST-CURSOR-001 |
| clean(c), stored list page | clean(c), unreached page removed | tags before HEAD; current clean session; spare all current-chain pages; conditional mark (with the chunk guard on, also on unchanged chunk fids) then delete | remove.go Cleaner.Page; layout_store.go changeMeta |
INV-LIST-RETIRE-001, INV-LAYOUT-META-CHUNKS-001 |
| idle/snap, retained snapshot | same activity, row removed and intent published | one CAS removes only captured name/gen and names its durable chain; each page present, this attempt's tag, unmarked, then read and authenticated again after adoption; with the chunk guard on, an adoption also needs the page's looked-up chunk fids unchanged; clean activity refuses | delete_intent.go RunDeleteSnapshotWithIntent; layout_store.go changeMeta |
INV-SNAPSHOT-DELETE-INTENT-001, INV-SNAPSHOT-DELETE-ADOPT-001, INV-SNAPSHOT-DELETE-ADOPT-002, INV-LAYOUT-META-CHUNKS-001 |
| idle live/detached, persisted delete intent | idle live/detached, next intent page or none | receipt-independent continuation from current HEAD; live-root and conditional effect guards; cursor follows completed effects | delete_intent.go RunConsumeSnapshotDeleteIntent; BCatalog.CleanSnapshotDeletePage; LayoutRemote.Clean |
INV-SNAPSHOT-DELETE-CONSUME-001 |
| idle | snap(s) | caller is the holder at HEAD's epoch (epoch, server and claim id); HEAD present; snap(s) again is a replay, any other activity is refused | head.go Head.Begin, runTransition |
INV-SNAPK-HEAD-WRITE-001, INV-SNAPK-BEGIN-001 |
| snap(s) | idle | holder at HEAD's epoch (epoch, server and claim id); activity is snap(s); over idle it succeeds without a write and means only that no activity remains; before resuming a failed stop, abort its still-open session and re-read HEAD: only matching live/idle resumes, detached goes Down, absent/unknown stays stopped | head.go Head.Abort; durable/provider_layout.go settleLayoutStop |
INV-SNAPK-ABORT-001 |
| snap(s) | idle, current = root | holder at HEAD's epoch (epoch, server and claim id); activity is snap(s); the previous manifest builds to HEAD's current root; the new own chunks, every segment and the root are present; a new snapshot name records bounded retention facts once, while replay preserves them | commit.go Head.Commit, RunCommit |
INV-SNAPK-COMMIT-REACH-001, INV-SNAPK-TXN-INTERRUPT-001, INV-SNAPK-SNAPSHOT-META-001 |
| detached | idle at higher epoch | same-epoch holder operations and Start refused; Claim waits for the old lease | claim.go Head.Claim; head.go holderErr; start.go Start |
INV-SNAPK-DETACHED-001 |
| snap(s) | detached, current = root | ordinary Commit preparation checks; caller closed writes and captured its synced L; position = L | commit.go Head.Commit, RunCommit |
INV-SNAPK-DETACHED-001 |
| any (Start) | idle at epoch e, claim id k | Start only: at HEAD's epoch it continues on the root carrying HEAD's claim id at or above HEAD's position, else refuses; above, a fresh root or the continuing lineage claims, validated against the HEAD the claim updates | start.go Start; claim.go RunClaim |
INV-SNAPK-START-ROOT-001, INV-SNAPK-START-LINEAGE-001, INV-SNAPK-START-POSITION-001, INV-SNAPK-START-ACTIVITY-001 |
| idle | clean(c) | holder at HEAD's epoch (epoch, server and claim id); activity idle (clean(c) again is a replay) | clean.go Head.BeginClean |
INV-SNAPK-CLEAN-EXCL-001 |
| clean(c) | idle | holder at HEAD's epoch (epoch, server and claim id); activity clean(c); over idle it succeeds without a write | clean.go Head.EndClean |
INV-SNAPK-CLEAN-EXCL-001 |
| clean(c) | clean(c), names removed | holder at HEAD's epoch, server and claim id with clean(c) open; candidate tags precede each HEAD validation; unreachable roots, then segments, then chunks; mark conditional on the planned tag (with the chunk guard on, also on unchanged chunk fids), delete conditional on its own mark | remove.go Cleaner.removePlanned; layout_store.go changeMeta |
INV-SNAPK-REMOVE-MARK-001, INV-CLEAN-METADATA-001, INV-CLEAN-CURSOR-001, INV-LAYOUT-META-CHUNKS-001 |
| idle (live or detached) | deleting | the master reserved the volume for delete (no line granted after), then no line holds a live lease, checked between the HEAD read and the update; no open activity, no snapshot with dependents; deleting again is a replay | delete.go Head.MarkDeleting, RunMarkDeleting (DeleteAuthority) |
INV-SNAPK-DELETE-ORDER-001 |
| absent | deleted (tombstone) | the operator's remove-dependent, for a restore target without HEAD (never created, or a restore died between its two creates); one exclusive create, so a later HEAD create of the restore fails; a HEAD appearing first refuses | delete.go OperatorReleaseDependent (TargetStore.CreateDeletedHead) |
INV-SNAPK-TOMBSTONE-001, INV-SNAPK-HEAD-WRITE-001 |
| source: any live | source: target released | by the target's volume id, from every snapshot: from DeleteVolume once the target's HEAD is deleting, or from the operator's command once the target is deleted, of another id, no longer naming the source, or tombstoned; an absent target writes nothing | delete.go Head.ReleaseDependent, RunReleaseDependent, OperatorReleaseDependent |
INV-SNAPK-RELEASE-001, INV-SNAPK-RELEASE-CALLERS-001, INV-SNAPK-RELEASE-OPERATOR-001 |
| deleting | deleted | after this volume is released from every source it names and its objects are deleted; deleted again is a replay; a live HEAD is refused | delete.go Head.MarkDeleted, DeleteVolume |
INV-SNAPK-DELETE-ORDER-001 |
M9 operation-receipt refinement (implementation in progress)
Delete admission fixes the target's publishing generation in its durable receipt and canonical intent commitment (SnapDelete rows 241–245). A retained receipt is read before resolving the name; a torn admission may re-resolve only to verify the same committed target. The resolver must finish the legacy stamp before returning an entry generation. The CLI admits a retained target only after the holder has stamped its generation; unstamped legacy entries refuse with a retryable diagnostic. Its executor uses the catalog/kernel atomic unlink-and-intent adapter; native qualification of the public command remains pending, so delete rows remain STUB.
A request ID and canonical intent identify a durable receipt under the immutable volume directory. A compact CAS index admits at most 4096 sequences and binds each request key to its full intent commitment. Each 73-byte slot carries a sequence and terminal eligibility flag; the 48-byte header carries the volume, revision and next sequence. Receipts follow index admission. The immutable operation instance derives from volume plus sequence; an owner token changes on worker readmission. Both are distinct from the volume ID. HEAD's version-1 snapshot metadata binds the instance, sequence, fingerprint and exact publication generation/epoch in the create transition. The common transition guard reads that observed HEAD, then the receipt, before the conditional HEAD write. Every removal settles a retained binding's outcome first; an already terminal, retired binding needs no new receipt. The same guard refuses a terminal or differently owned publisher. Re-admission first settles an existing binding. A receipt alone never grants holder authority.
stateDiagram-v2
[*] --> accepted: CAS index, then create receipt
accepted --> accepted: same intent repairs missing receipt
accepted --> running: conditional start
running --> stalled: interrupted or retryable attempt
stalled --> running: conditional readmission, fresh owner
accepted --> succeeded: reconcile existing HEAD binding
running --> succeeded: settle published binding or logical delete
stalled --> succeeded: removal/readmission settles binding
accepted --> refused: definite refusal
running --> refused: definite refusal
succeeded --> retired: file persisted, terminal flag, retirement CAS
refused --> retired: file persisted, terminal flag, retirement CAS
retired --> [*]: conditional orphan cleanup
Terminal outcomes do not change. Their terminal flag follows the persisted receipt, and admission retires the oldest flagged terminal slot only. Pending states never retire; a full all-pending index refuses retryably. A missing receipt is repaired from its issued intent or settles from a matching HEAD binding; an unindexed file is garbage. Details and resource costs are in the index design. The codec bounds each receipt to 8192 bytes, including a result of at most 4096 bytes and refusal detail of at most 512 bytes. Process-owned asynchronous create is wired, but asynchronous catalog delete and the full native crash/concurrent-worker qualification remain owed before these STUB rows become ACTIVE. No complete-unit acceptance is claimed.
Operation metadata lives under its full VolumeID and immutable creation generation (first HEAD generation 1); display-name reuse cannot select that namespace. Deleting/deleted HEAD fences index and receipt readers. Admission checks live HEAD again after its INDEX and receipt writes before answering. Late remote writes can land in the dead incarnation, but cannot re-admit work or affect a replacement. Its receipt bytes remain immutable until collected. After ordered volume deletion, GC conditionally removes receipts before INDEX; interrupted or late garbage is collected by a later pass. HEAD and VOLUME stay. No elapsed-time window or absence of bytes after GC returns grants safety.
The CLI-owned delete attempt stages immutable candidate pages and delegates to
RunDeleteSnapshotWithIntent: removing the retained (name, gen) and naming
its durable reclamation intent are one HEAD CAS. Only then, or after proving
the retained target already absent/replaced, does the receipt settle. Physical
intent consumption needs HEAD/pages, never the receipt; receipt retirement
cannot strand it. Lost publication or settlement replies resume the same target.
Name-only snapshot deletion is a legacy-format transition only: it refuses a v1.1 HEAD before publication. Incarnation-qualified deletion uses the admitted target and atomic unlink/intent transition; a retry never resolves a replacement by name.
Cut CLI observation (Draft projection)
| From | To | Trigger / guard | Code | Invariant |
|---|---|---|---|---|
| Start | Admission | POST once; the explicit deadline is fixed once | chunkCut, chunkObserveCut |
INV-CLI-CUT-PROGRESS-WINDOW-001 (STUB: native qualification owed) |
| Admission | Polling / Busy | Keep the server's in-memory cut ID; cut_busy exits retryable without starting another cut | chunkObserveCut |
INV-CLI-CUT-PROGRESS-WINDOW-001 |
| Polling | Polling | GET status for the same ID. Only a strictly higher sequence for that ID renews Wc; errors, unchanged or foreign progress do not | chunkObserveCut |
INV-CLI-CUT-PROGRESS-WINDOW-001 |
| Polling | Success / Failed | A valid result / cut_stalled answer ends observation; an explicit foreign cut ID cannot settle it | chunkObserveCut |
INV-CLI-CUT-PROGRESS-WINDOW-001 |
| Polling | Unknown | Wc with no observed rise, unanswered transport, holder restart losing the ID, explicit deadline, or terminal outcome_unknown after settlement silence | chunkObserveCut |
INV-CLI-CUT-PROGRESS-WINDOW-001, INV-CUT-PUBLISH-SETTLE-001 |
| Admission / Polling | Local protocol refusal | reply version is neither N nor N-1; only a valid unversioned initial synchronous 200 is the legacy fallback; typed unsupported_api_version names both versions; all unsupported responses exit unknown (3); HTTP status cannot establish non-admission; never re-POSTs or establishes a cut outcome | chunkObserveCut | INV-CUT-API-VERSION-001 |
Cut polling handle refinement
| From | To | Guard / action | Enforced in | Invariant |
|---|---|---|---|---|
| No manual handle | Running | every manual POST uses a handle; below four retained handles, capture acquired immediately; otherwise cut_busy (capture_held with owner ID, or handles_full); no queue | chunkControl.startManualCut; AdmitManualChunkCut | INV-CUT-HANDLE-LIFETIME-001 |
| Running | Terminal retained | work joins, fixed terminal response recorded; initial POST returns within W_cut; GET reads same ID and completed-step sequence | manual_cut.go | INV-CUT-HANDLE-LIFETIME-001 |
| Running | Running | settle inherited proposal before own capture; report one completed step; only a proposal tagged with this invocation can supply its result | captureManualCut; captureInvocationLocked | INV-CUT-PUBLISH-SETTLE-001 |
| Running | Settling | publication answer lost; keep capture and the original proposal; read HEAD inside W | captureManualCut; resolvePendingWithProgress | INV-CUT-PUBLISH-SETTLE-001 |
| Settling | Settling / Terminal retained | own-proposal read renews while authority remains; foreign HEAD terminates without renewal; invocation tag binds the result; completed inherited recovery renews once then takes its own barrier; silence ends unknown | captureManualCut | INV-CUT-PUBLISH-SETTLE-001 |
| Terminal retained | Terminal retained | sending or losing a reply never retires or replaces the handle | writeManualCut | INV-CUT-HANDLE-LIFETIME-001 |
| Terminal retained | Retired | at least this handle's Wc since its end; next admission or poll scans bounded table | retireManualCutsLocked | INV-CUT-HANDLE-LIFETIME-001 |
Part B. Invariant ledger
The "Machine / transition" column refers to Part A. Notes under a table record what a row does not cover and, for kept rows, what was narrowed from the internal ledger.
B.1 Core: storage, durability and the frontend gate
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-REBUILD-SNAPSHOT-COMPLETE-001 |
A rebuild snapshot returns all readable nonzero blocks or an error, never a partial success. The sender propagates snapshot failure before shipping blocks or RebuildDone. | M3 NeedsRebuild (base enumeration) | core/storage/logical_storage.go AllBlocks; storage implementations; core/transport/rebuild_sender.go doRebuild |
TestChunkHydration_SnapshotFailsOnReadError, TestRebuildSnapshotErrorNeverShipsPartialImage |
Existing fail-closed recovery contract; error propagation only | ACTIVE |
INV-WAL-SYNCED-RECOVERED-001 |
After a crash without media corruption, Recover returns every write that a Sync acknowledged. |
M1 Recovering → Serving | core/storage/walstore_v3.go recoverV3; core/storage/walstore.go WALStore.Recover |
TestNativeReplacementTornWrapKeepsAcknowledgedSuffix (core/storage/legacy_replacement_v3_test.go) |
WALRecovery I1 |
ACTIVE |
INV-RECOVERY-PROGRESS-WINDOW-001 |
Startup reports recovery_stalled only after a window without a new fixed-order phase/count frontier; repeated preparation cannot renew it. Progress never grants readiness or ownership. | M1 Recovering | core/host/volume/recovery_watchdog.go; cmd/blockvolume/durable_startup.go; core/storage/recovery_progress.go |
TestDurableStartup_LocalRecoveryWorkIsOutsideFixedDeadline (cmd/blockvolume/durable_startup_budget_test.go); TestRecoveryProgress_CountingEntriesOutliveTheTotalWindow, TestRecoveryProgress_RepeatedAttachPreparationDoesNotRenew (core/host/volume/recovery_progress_test.go); observation: TestRecoveryStatusReportsOnlyCompletedFrontiers (core/host/volume/recovery_status_test.go); C3: TestRecoveryPrimaryWaitUsesProgressNotTotalTime, TestRecoveryPrimaryWaitRejectsRepeatedSamplesAndStall, TestRecoveryPrimaryWaitAuthorityPauseAndCeilingUnknown, TestRecoveryPrimaryWaitLateProgressCannotHideSilence, TestRecoveryPrimaryWaitUnavailableSamplePreservesPause, TestRecoveryPrimaryWaitPhaseChangeIsNotProgress, TestRecoveryPrimaryWaitDoesNotCountPreReplayWork, TestRecoveryPrimaryWaitExitNeedsTimelyWitness, TestRecoveryPrimaryWaitMissingCounterTimeIsUnknown (cmd/blockvolume/recovery_primary_wait_test.go); diagnostic shutdown isolation: TestWALStoreCloseDoesNotWaitForDiagnosticOutput (core/storage/close_blocked_output_test.go); attach: TestAttachReportsItsVolumeSizedLocalWork, TestAttachReportsTheCreatedThisStartScan, TestAttachProgressFlushesSlowWorkAboutEverySecond (core/storage/chunk_attach_progress_test.go), TestAttachProgressCountsEachAttemptFromZero, TestAttachRemoteCallsCarryTheirOwnBound, TestAttachManifestReadCarriesThePerFetchRule (core/frontend/durable/attach_progress_test.go), TestAttachManifestReadBoundsEachFetch (core/frontend/chunkstore/layout_attach_fetch_test.go) |
— (joint recovery+attach Linux qualification: 7495 PASS, 0 FAIL, race x5 including the attach tests); C.L | ACTIVE |
INV-RECOVERY-SIZED-STEP-SLICES-001 |
A sized startup step (a new store's prezero, the WAL fence) reports its bytes as recovery progress only after their sync, prezero one 1 MiB slice at a time. | M1 Recovering | core/storage/recovery_progress.go syncedSlices; core/storage/data_sync.go prezeroNewStore; core/storage/walstore_v3.go fenceV3 |
TestSyncedSlicesCountOnlySyncedSlices, TestPrezeroReportsEachSyncedSlice, TestRecoveryReportsTheSyncedFence, TestRecoveryFenceHeldSyncReportsAfterRelease, TestPrezeroReportsAfterEachSyncAndStopsAtAFailedOne, TestCreateRecoveryReportsTheFenceThroughTheOptions (core/storage/recovery_create_progress_test.go); TestRecoveryStalled_CreateSlicesRenewTheWindow (core/host/volume/recovery_authority_wait_test.go) |
— | ACTIVE |
INV-RECOVERY-AUTHORITY-WAIT-PAUSE-001 |
The recovery_stalled window pauses while a recovered volume awaits master authority and restarts at the grant, before local attach work; silence that filled the window before the wait is latched at its start. The master bounds the wait. | M1 Recovering | core/host/volume/recovery_watchdog.go ReportAuthorityWait; core/frontend/durable/provider_chunk.go chunkAuthorityWait |
TestRecoveryStalled_FullAuthorityWaitDoesNotStall, TestRecoveryStalled_SilentStepBeyondTheWindowIsCaught, TestRecoveryStalled_SilenceBeforeTheWaitIsLatchedAtItsStart, TestRecoveryStalled_HeldAttachAfterTheGrantStalls (core/host/volume/recovery_authority_wait_test.go); TestAuthorityWaitIsReportedAndShowsItsGap, TestAuthorityWaitEndsAtTheGrantBeforeTheAttach, TestAuthorityLostAfterAGrantPausesAgain (core/frontend/durable/authority_wait_hook_test.go) |
— | ACTIVE |
INV-OPEN-REMOVED-ENGINE-REFUSED-001 |
A volume whose header carries a removed experimental engine's magic (smartwal SWAW; parallel-walstore SWPW at offset 0 or 4096) is refused typed (copy the data to a walstore volume with v1.0.x first) under every selector, read-only and never modified. |
M1 [*] → OpenRefused | core/frontend/durable/provider.go verifyImplOnDisk |
TestDurableProvider_RefusesRemovedEngineVolumes (byte-identical file after each refusal; core/frontend/durable/provider_auto_impl_test.go); TestWALStoreChunk_SelectorRules (core/frontend/durable/provider_chunk_test.go) |
— | ACTIVE |
INV-OPEN-REMOVED-ENGINE-NAME-REFUSED-001 |
A selector naming a removed experimental engine (smartwal, parallel-walstore) is refused typed, with the same advice, by blockvolume, the provider and the Kubernetes launcher before any volume is touched. |
M1 [*] → OpenRefused | core/frontend/durable/provider.go RemovedEngineName, NewDurableProvider; cmd/blockvolume/main.go parseFlags; core/launcher/k8s_renderer.go |
TestDurableProvider_RefusesRemovedEngineNames (core/frontend/durable/provider_auto_impl_test.go); TestBlockvolumeRefusesRemovedEngineNames (cmd/blockvolume/durable_impl_default_test.go); TestK8sRendererRefusesRemovedEngines (core/launcher/k8s_renderer_test.go) |
— | ACTIVE |
INV-WAL-OPGATE-001 |
A durable backend refuses Read, Write and Sync until RecoverVolume succeeds; a failed recovery leaves it refused. |
M1 Opened → Serving; Recovering → RecoveryFailed | core/frontend/durable/storage_adapter.go readyCheck; core/frontend/durable/provider.go RecoverVolume |
TestT3b_DurableProvider_Open_StartsNotOperational (core/frontend/durable/provider_test.go); TestT3b_Recovery_CleanRecover_FlipsOperational (core/frontend/durable/recovery_test.go); TestWALStoreChunk_MoveBackOntoAnOldRootIsRefused (core/frontend/durable/provider_chunk_moveback_test.go) |
— | ACTIVE |
INV-FE-NVME-READY-001 |
A read or write on a successfully recovered chunk volume awaiting attachment waits for attachment readiness, before storage admission, for at most 3 s or until an earlier caller deadline, on the local monotonic clock. | M1 Opened / Recovering → Serving | core/frontend/durable/storage_adapter.go admitAfterAttachUnqueued, awaitAttachAdmission, readyCheck |
TestWALStoreChunk_PendingReadWaitIsBounded; TestWALStoreChunk_PendingReadHonoursEarlierDeadline; TestWALStoreChunk_TakeoverWriteWaitsForAttach; TestReadReadinessWaitDoesNotHoldAdmissionAndCloseWakesIt (core/frontend/durable/read_ready_wait_test.go); also in core/frontend/durable/takeover_read_ready_test.go |
— | ACTIVE |
INV-FE-NVME-READY-STATUS-001 |
An NVMe read or write whose attachment-readiness wait times out or is refused completes with Namespace Not Ready (SC 0x82), DNR=0, without reading or mutating storage. | M1 Opened / Recovering → Serving | core/frontend/durable/storage_adapter.go attachReadyTimeout; core/frontend/nvme/io.go mapBackendError |
TestWALStoreChunk_TakeoverReadBeforeAttachIsRetryable; TestSessionReadNotReadyIsRetryable (core/frontend/nvme/read_ready_retry_test.go); TestWALStoreChunk_PendingAttachBeyondHostRetryBudget (core/frontend/durable/takeover_read_ready_test.go) |
— | ACTIVE |
INV-FE-NVME-READY-ANA-001 |
An I/O that ends during the attachment-readiness wait because the backend closed or its lineage went stale keeps its ANA error, and a physical I/O fault keeps Internal Error. | M1 Opened / Recovering → Serving | core/frontend/durable/storage_adapter.go attachReadyTimeout; core/frontend/nvme/io.go mapBackendError |
TestSessionReadNotReadyIsRetryable (core/frontend/nvme/read_ready_retry_test.go); TestReadReadinessWaitDoesNotHoldAdmissionAndCloseWakesIt (core/frontend/durable/read_ready_wait_test.go) |
— | ACTIVE |
INV-FE-NVME-CANCEL-001 |
Closing an NVMe target cancels connection readiness waits before joining workers. Attach-pending reads and writes honour caller cancellation without accessing storage. | M1 Opened / Recovering; frontend shutdown | core/frontend/nvme/target.go handleConn; session.go serve; core/frontend/durable/storage_adapter.go awaitAttachAdmission |
TestTargetCloseCancelsPendingProviderReadiness, TestNVMeReadinessCancelProcess (core/frontend/nvme/target_cancel_test.go); TestAttachReadinessReadAndWriteHonourCallerCancellation (core/frontend/durable/read_ready_wait_test.go) |
NONE (frontend cancellation plumbing; no durable state transition) | ACTIVE |
INV-NVME-RETRY-DELAY-001 |
A negotiated ACRE controller returns retryable Namespace Not Ready with CRD=2 (CRDT2=1 s), DNR clear; permanent and successful completions do not gain retry delay. | M1 I/O completion encoding | Session.completionStatus; read/write/flush session handlers; buildIdentifyController |
TestReadinessRetryDelayNegotiation, TestSessionRetryDelayOnEveryRetryableIO |
NONE (wire encoding; no authority transition) | ACTIVE |
INV-NVME-HOST-BEHAVIOR-001 |
ACRE accepts only a supported 512-byte Host Behavior payload, is scoped to its controller and clears on controller reset; an invalid update preserves its prior value. | M1 controller capability negotiation | handleSetFeatures, handleGetFeatures, adminController.setCC |
TestHostBehaviorRejectsUnsupportedPayloadWithoutChangingACRE, TestRetryDelayControllerIsolationAndReset |
NONE (volatile capability; no authority transition) | ACTIVE |
INV-FE-PRIMARY-READY-OPERATIONAL-001 |
FrontendPrimaryReady is reported only while the local durable backend admits I/O, and the frontend target listens only after it first does; attach-pending, fenced or no durable status reports not ready with the reason. | M1 Opened / Recovering → Serving; M2 process exit | core/host/volume/status_server.go statusProjection; core/frontend/durable/storage_adapter.go FirstServing; cmd/blockvolume/frontend_gate.go awaitFrontendStart (the iSCSI, NVMe and ublk targets in cmd/blockvolume/main.go runVolume start after it); cmd/blockvolume/process_exit.go waitWorkspaceStop |
TestStatusServer_ReadyOnlyWhileBackendOperational, TestStatusServer_NotReadyAlwaysHasAReason (core/host/volume/status_server_test.go); TestFrontendGateWaitsForTheStorageClaim, TestFrontendGateStopsWithoutStartingTheFrontends (cmd/blockvolume/frontend_gate_test.go); TestDurableProvider_NonChunkVolumeServesRightAfterOpen (core/frontend/durable/first_serving_test.go) |
— | ACTIVE |
INV-FE-FENCE-EXIT-001 |
A workspace chunk primary whose backend fences after its target listens ends the process within detection plus the 5 s cleanup bound: a lease expiry at the guard's own deadline, a HEAD fence within 50 ms. | M1 Serving → Closed; M2 process exit | core/frontend/durable/provider_startup.go watchChunkFence (HEAD fence: not operational with the evidence within 50 ms; I/O refused from the fence); cmd/blockvolume/process_exit.go watchChunkRuntimeFence (78 head_fenced) and waitWorkspaceStop (lease fence: 75 lease_expired); superviseProcess (the 5 s cleanup bound from the decision) |
TestWALStoreChunk_RuntimeHeadFenceLatchesNotOperational (core/frontend/durable/runtime_fence_test.go); TestRuntimeHeadFenceChoosesHeadFencedExit (cmd/blockvolume/runtime_fence_exit_test.go); real-binary case C (lease expiry after listening: exit 75) |
— | ACTIVE |
INV-WS-SERVE-LEASE-HELD-001 |
A workspace primary claims HEAD, listens, reports ready and admits I/O only while its lease guard permits now; without a granted lease it holds at the gate and exits 75 when the startup wait runs out (INV-WS-MASTER-WAIT-001). |
M1 Recovering → Serving; M2 process exit | core/host/volume/workspace_lease.go WorkspaceLeaseGuard.Held / permits (the one deciding function: the guarded projection gates the chunk claim, the per-I/O admit and); core/frontend/durable/storage_adapter.go AdmitsIO (the one "may serve" function, the I/O gate: backend admits AND guarded projection names this lineage; shared readiness rule); core/host/volume/status_server.go statusProjection (FrontendPrimaryReady from AdmitsIO; NotReadyReason=lease_not_held first); cmd/blockvolume/frontend_gate.go frontendStartSignal / awaitFrontendStart (a workspace primary's frontends start once AdmitsIO passes; non-chunk and supporting replicas start after open as before); cmd/blockvolume/process_exit.go (exit 75 assignment_timeout); cmd/sw-block/shell_check.go FrontendPrimaryReady |
TestStatusServer_WorkspacePrimaryNotReadyWithoutHeldLease, TestWorkspaceLeaseGrantIsLoggedOnceAfterRefusedRenewals, TestWorkspaceLeaseFirstRevokingReplyIsNotLoggedAsAGrant (core/host/volume/workspace_lease_held_test.go); TestStorageBackend_AdmitsIOIsTheIOGate (core/frontend/durable/admits_io_test.go); TestFrontendStartSignal_WorkspacePrimaryWaitsForAdmitsIO, TestFrontendStartSignal_OtherVolumesStartAfterOpenAsBefore, TestFirstAdmittedStopEndsTheWorker (cmd/blockvolume/frontend_start_signal_test.go); real-binary cases B-late (restart before the forced-move barrier, re-granted inside the wait: no claim, listen or ready before the re-grant), B75 (no grant inside the wait: no claim, listen or ready, exit 75; a restart after the barrier serves) and B0 (restart inside the lease serves at once) |
— | ACTIVE |
INV-WAL-REPLAY-LWW-001 |
Replay of the validated native prefix retains the highest admitted LSN per LBA; invalid cursor, nonce or LSN order is refused. | M1 Recovering | core/storage/dirty_map.go putAtIfNewer |
TestWALLSNOrderV3_RefusesDuplicateAndLower (core/storage/wal_lsn_order_v3_test.go) |
WALRecovery ReplayLastWriter |
ACTIVE |
INV-WAL-REUSE-PERSISTED-TAIL-001 |
The WAL writer reuses only bytes that the both durable descriptor slots has already released. | M1 write lifecycle: Checkpointed → Reusable | core/storage/wal_io_v3.go append; core/storage/walstore_map_checkpoint_v3.go publishCheckpointV3 |
TestWALIOV3_FloorAndPwriteFailureRefuse (core/storage/wal_io_v3_test.go); TestNativeReplacementCallerPublicationFaults (core/storage/legacy_replacement_v3_test.go) |
WALRecovery I1 |
ACTIVE |
INV-WAL-CHECKPOINT-SNAPSHOT-001 |
A checkpoint never passes a synced write that is not yet in the extent. | M1 write lifecycle: InExtent → Checkpointed | core/storage/flusher.go flushOnceInternal |
TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime (core/storage/walstore_map_recovery_lifetime_v3_test.go); TestNativeReplacementCheckpointSIGKILL (core/storage/legacy_checkpoint_replacement_v3_linux_test.go) |
WALRecovery I1 |
ACTIVE |
INV-WAL-CHECKPOINT-PREFIX-001 |
A flusher cycle drains the LSN prefix of the synced dirty entries that fits in a sixteenth of the WAL, cut at a record boundary: a native batch (one record, consecutive LSNs) stays whole, as does a first record larger than the bound. | M1 write lifecycle: InExtent → Checkpointed | core/storage/flusher.go flushCycle, boundCycleBatch |
TestBoundCycleBatchCutsOnlyAtARecordBoundary, TestWALStoreV3SlowExtentKeepsReclaimMoving (core/storage/walstore_bounded_flush_v3_test.go) |
FlushCkpt CkptMeaning | ACTIVE |
INV-WAL-CHECKPOINT-PRESENT-001 |
A cycle's checkpoint is its highest present LSN; reclaim releases only whole records at or below it, and recovery replays the kept records whole. | M1 write lifecycle: InExtent → Checkpointed | core/storage/flusher.go flushCycle; core/storage/wal_io_v3.go reclaimThroughV3 |
TestWALStoreV3BoundedCheckpointReplaysANewerRecordAfterACrash (core/storage/walstore_bounded_flush_v3_test.go) |
FlushCkpt CkptMeaning, ReadsLatest | ACTIVE |
INV-WAL-CHECKPOINT-RETIRE-001 |
Setting the checkpoint and retiring every dirty entry at or below it are one step on every path (the owned map's publication and rollover, the map candidate's, the cycle's), so no dirty entry stays at or below the checkpoint. | M1 write lifecycle: InExtent → Checkpointed | core/storage/walstore_v3.go checkpointedV3Locked |
TestWALStoreV3HeldThenJumpRetiresEveryEntryBelowTheCheckpoint (core/storage/walstore_bounded_flush_v3_test.go) |
FlushCkpt DirtyInWAL | ACTIVE |
INV-WAL-FLUSH-PASS-001 |
A flusher pass writes every dirty entry once even under a held checkpoint: each cycle starts after the previous batch's last LSN, within one recovery lifetime; a full drain runs cycles until its first frontier is drained. | M1 write lifecycle: InExtent → Checkpointed | core/storage/flusher.go flushPass, cycle, flushOnceInternal |
TestWALStoreV3HeldCheckpointEndsTheDrain, TestWALStoreV3FullDrainRunsBoundedCyclesToTheEnd (core/storage/walstore_bounded_flush_v3_test.go) |
FlushCkpt CkptMeaning (pass cursor) | ACTIVE |
INV-WAL-FRONTIER-GAP-001 |
A durable BASE anchor and its contiguous synced install-lane suffix survive recovery; an unpersisted frontier jump is not admitted. | M1 Recovering | core/storage/walstore_v3.go recoverV3 |
TestBaseInstallV3CompleteServesTheImageAcrossACrash (core/storage/base_install_v3_test.go) |
WALRecovery I1 |
ACTIVE |
INV-WAL-CKPT-META-FAIL-001 |
A failed checkpoint metadata write neither publishes the new checkpoint nor releases WAL space. | M1 write lifecycle: InExtent → Checkpointed (refused) | core/storage/walstore_map_checkpoint_v3.go publishCheckpointV3 |
TestNativeReplacementCallerPublicationFaults (core/storage/legacy_replacement_v3_test.go) |
— | ACTIVE |
INV-WAL-FSYNC-STICKY-001 |
After the first failed fsync of the store file (WAL, extent, superblock, or the chunk layer's presence save), the open store refuses every later Sync, write, checkpoint and presence save without calling fsync again; only a reopen and Recover clear it. |
M1 Serving → FaultLatched | core/storage/walstore.go noteFsyncFailure, syncFile, stickyIOFault |
TestNativeReplacementDataFsyncFailureIsSticky (core/storage/legacy_replacement_v3_test.go); TestNativeReplacementCallerPublicationFaults (core/storage/legacy_replacement_v3_test.go); TestWALStoreV3SyncRechecksTheFaultAtTheAckBoundary (core/storage/walstore_v3_test.go); TestAPresenceSaveIsRefusedAfterAFailedFsync, TestAPresenceSavesFailedFsyncStaysFailed (core/storage/chunk_presence_fsync_test.go) |
— | ACTIVE |
INV-WAL-APPEND-STICKY-001 |
A WAL append whose write failed latches the store fault; writers already queued behind it are refused. | M1 Serving → FaultLatched | core/storage/walstore_v3.go latchV3, appendWriteV3 |
TestNativeReplacementQueuedApplyAfterFailedAppend (core/storage/legacy_replacement_v3_test.go); TestWALStoreV3AppendWriteErrorLatchesTheStore (core/storage/walstore_v3_test.go) |
— | ACTIVE |
INV-WAL-SYNC-FRONTIER-001 |
Sync never reports an uncovered write durable: it returns the global synced frontier, which is at least the caller's own write and is covered by a completed fsync. It may include later writes whose covering fsync completed before the caller resumed. |
M1 write lifecycle: Appended → Synced | core/storage/walstore.go WALStore.Sync |
TestWALStore_SyncDoesNotClaimConcurrentWrite (core/storage/walstore_test.go); TestNativeReplacementSyncCallerReturnOrdering (core/storage/legacy_sync_replacement_v3_test.go) |
— | ACTIVE |
INV-WAL-TYPED-FAILCLOSED-001 |
A corrupt replay at startup is reported as wal_corrupt at once and keeps local readiness blocked. |
M1 Recovering → RecoveryFailed | cmd/blockvolume/durable_startup.go openAndRecoverDurable; core/host/volume/recovery_watchdog.go LocalRecoveryHealthReason |
TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness (cmd/blockvolume/durable_startup_slotcrc_test.go); TestLocalRecoveryFailure_CorruptWALReportsWALCorruptAtOnce (core/host/volume/recovery_typed_reason_test.go) |
— | ACTIVE |
INV-WAL-WARN-NO-HEALTH-001 |
Recovery warnings (for example wal_hole_suspected) appear in status without changing health or eligibility. |
M1 Serving | core/host/volume/status_server.go statusProjection |
TestStatusServer_StatusCarriesRecoveryWarningsWithoutChangingHealth (core/host/volume/status_warnings_test.go) |
— | ACTIVE |
INV-WAL-V3-ACTIVATION-001 |
Public create produces an owned-map v3/impl3 volume with the requested chunk geometry, in mode C unless mode A is requested. | M1 open/create/readonly | core/storage/walstore.go CreateWALStoreWithOptions; core/storage/walstore_v3.go createWALStoreV3Configured |
TestWALStoreProductionSelectorCreatesMappedV3, TestWALStoreProductionCreateOptions (core/storage/walstore_activation_test.go) |
Selector wiring only; native protocol remains the accepted composed format model, not a new model proof | ACTIVE |
INV-WAL-V3-ACTIVATION-FALLBACK-001 |
When descriptor slot A is damaged without being a valid legacy superblock and slot B is valid, writable and read-only open select slot B. | M1 open/create/readonly | core/storage/walstore_v3.go refuseLegacyWALStore, openWALStoreV3File; core/storage/walstore_readonly_v3.go openReadOnlyV3; core/storage/superblock_v3.go selectSlotV3 |
TestWALStoreProductionFallsBackWhenDamagedSlotOnlyLooksLegacy (core/storage/walstore_activation_test.go) |
— | ACTIVE |
INV-WAL-V3-ACTIVATION-PROVIDER-001 |
The durable provider's capture, HEAD restore and status paths probe, open and create volumes through the public v3 selectors (ProbeWALStoreV3, OpenWALStore, CreateWALStoreWithOptions). |
M1 open/create/readonly | core/frontend/durable/provider.go openOrCreate |
TestDurableProviderV3_HEADRestorePreservesRemoteImageAndNextLSN, TestDurableProviderV3_StatusTracksRecoverSyncAndCapture (core/frontend/durable/provider_format_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-LEGACY-FIXTURE-ISOLATION-001 |
No default-build production code calls a legacy fixture constructor, and no legacy fixture is in the transitive import closure of the production storage packages. | M1 open/create/readonly | build layout: legacy fixtures outside the default production import closure | TestLegacyFixtureIsolation (core/storage/legacy_fixture_isolation_test.go) |
— | ACTIVE |
INV-WAL-V3-FLUSH-PROFILE-001 |
Native flusher header/full-record/decode counters describe actual reads and validation; I/O failure is distinct from validation failure and only successfully materialized blocks count validated. | M1 checkpoint instrumentation | walstore_v3.go readWholeRecordProfiledV3, readDirtyRecordV3 |
TestFlusherV3ProfileCountsRealRecordStages |
Observability; no durability transition change | ACTIVE |
INV-WAL-V3-WRITE-AHEAD-001 |
No extent byte reaches the disk before its WAL record is durable: the flusher writes an extent only from dirty entries at or below the synced (acknowledged) WAL frontier; Recover and the install log fsync their records before raising it. | M1 Serving (flusher extent write) | core/storage/flusher.go flushOnceInternal; walstore_v3.go recoverV3 (descriptor publish fsync before wack); install_log_v3.go |
TestRedCrashKeepingAnUnsyncedExtentWriteLeavesLocalAndHEADApart (core/storage/chunk_u1_reorder_test.go); TestFlusherWriteAheadNeverFlushingGuestReachesExtentAtPressure (core/storage/flusher_write_ahead_test.go) |
A checkpoint may pass a synced record superseded by an unsynced newer one only because the cycle's sync covers the whole file, WAL included (one file, one descriptor: INV-WAL-FLUSH-SYNC-COVERS-WAL-001); separating WAL and extent, or a range sync, must first change the checkpoint bound |
ACTIVE |
INV-WAL-V3-CAPTURE-CANDIDATES-001 |
A retained WAL entry already covered by HEAD is not dirt since HEAD. New post-HEAD WAL entries, UNKNOWN map chunks and map max-LSN above HEAD remain capture candidates, except as INV-WAL-V3-CAPTURE-COMPARED-001. |
M5 candidate selection | chunk_layer.go captureCandidates |
TestChunkLayerV3CapturedUncheckpointedWALIsCleanUntilRewritten, TestChunkLayerV3_CaptureUsesOwnedMapAfterCheckpoint, TestBaseInstallV3CompletePersistsTheMapUnknownOfBaseWrites |
Conservative reachability unchanged; narrower redundant work | ACTIVE |
INV-WAL-V3-CAPTURE-CANDIDATES-TOUCHED-001 |
The barrier's candidate step judges only a touched set (a chunk bitmap with a word summary) with INV-WAL-V3-CAPTURE-CANDIDATES-001's predicate, never every chunk; the set covers every chunk whose answer may have changed since the barrier took it. The cut syncs before the barrier, outside the pause. | M5 candidate selection (CandBitmap: NoBitLost, SummaryCovers) | chunk_layer.go candidatesFrom, takeTouched, seedTouched, touch, OnMapEntryChange, noteMutation, setHeadLocked, applyCommitLocked; walstore_map_checkpoint_v3.go recordMapWriteV3; base_install_v3.go markMapUnknownV3; chunk_record_candidates.go candidateSet |
TestIdleCutCandidateWorkIsFlatInS, TestOneChangedChunkCutVisitsNoFullScan, TestCutSyncsBeforeItsBarrier, TestUnknownCommitOutcomeLosesNoChunk, TestCandidateSetOrBackKeepsTheSummary (chunk_cut_candidate_set_test.go); TestEveryLocalWriteAfterACleanFillMakesTheChunkACandidate, TestACleanFillRecordEndsWithItsHeadRef (chunk_fresh_readback_candidates_test.go); TestSpacePerChunkAt1TiBShape (chunk_space_baseline_test.go) |
The candidate set is the same; an idle cut's candidate work no longer grows with S | ACTIVE |
INV-WAL-V3-TOUCH-FILLED-ORDER-001 |
Every fill a request still owes at a barrier's start is covered by that cut (by the request or by its touches); a reader clears a request only after its touches are in the set, by a CAS on its own generation; a barrier takes it before the set, and an aborted cut reissues it. | M5 candidate selection | core/storage/chunk_layer.go resolveTouchFilled, requestTouchFilled, captureLocked |
TestAReaderMidResolveDoesNotHideARecoveryFromACut, TestAReaderResolvingInsideTheBarrierDoesNotHideARecovery, TestANewerRecoveryRequestOutlivesAnOlderReader, TestACutThatAbortsAfterTakingTheRequestReissuesIt (core/storage/chunk_cut_candidate_set_test.go) |
TouchFilled CutSeesRequest, NoLostRequest | ACTIVE |
INV-WAL-V3-CAPTURE-COMPARED-001 |
A chunk known equal to HEAD is neither staged nor compared again while its mutation version and HEAD ref match; own-batch chunks remain candidates. An interrupted or refused cut retains these proofs and requeues only unproven chunks. All candidate paths use one predicate. | M5 candidate selection | core/storage/chunk_layer.go knownEqualToHeadLocked, captureCandidates, captureLocked, recordCapturedEqualMarks, stage, requeueCut; chunk_cut_payload.go markEqualNow |
TestFreshFromHeadReadBackLeavesNoCutCandidates, TestFreshFromHeadFilledThenWrittenIsACandidate, TestEveryLocalWriteAfterACleanFillMakesTheChunkACandidate, TestABaseInstallAfterCleanFillsEndsTheirRecords, TestACleanFillRecordEndsWithItsHeadRef, TestARestoreTargetThatOnlyReadCutsNothing, TestARerunAfterAFailedCutComparesOnlyWhatDiffers, TestWithoutAFailedCutEveryUnknownChunkIsCompared, TestACutOffCompareKeepsItsWorkAndTheRerunComparesOnlyTheRest, TestFilledChunksAreFirstCutCandidatesAfterARestart, TestEveryDirtyMapInsertNotesTheChunkMutation, TestOwnBatch_BoundedBatchesReplaceEveryForeignKey; TestRefusedFullCutStagesOnlyTheUnmarkedChunk (core/storage/chunk_staging_equal_test.go); TestCopyErrorKeepsCapturedEqualMarks, TestInterruptedStagingKeepsEqualWork (core/storage/chunk_copy_error_equal_test.go); TestTimedOutRequestsThenRefusedCommitKeepEqualWork (core/frontend/chunkstore/layout_staging_retry_test.go); also in core/storage/chunk_fresh_readback_candidates_test.go, core/frontend/durable/first_cut_known_zero_test.go, core/storage/chunk_compare_progress_test.go, core/storage/chunk_mutation_note_guard_test.go, core/storage/chunk_own_test.go |
EqualMarks.MarkSound, EqualMarks.NoRecompare (must-violate rows 102-104); conservative reachability unchanged | ACTIVE |
INV-CHUNK-STATE-UPGRADE-FENCE-001 |
The chunk-state upgrade fence succeeds only after both descriptor slots are fsynced and read back with the format marker and local-work epoch; matching reopened slots require a fresh sync; uncertain writes or readback latch until reopen. | M1 format upgrade (caller not wired) | core/storage/chunk_state_upgrade.go WALStore.FenceChunkStateUpgrade |
TestChunkStateUpgradeFencesBothSlotsBeforeCompletion, TestChunkStateUpgradeUncertainSecondSlotRequiresReopen, TestChunkStateUpgradeFailureNeverCompletesUntilReopen, TestChunkStateUpgradeOldReaderPublicationRestartsTheFence, TestChunkStateUpgradeReopenedCachedPairNeedsFreshSync, TestChunkStateUpgradeRejectsSuccessfulWrongReadback (core/storage/chunk_state_upgrade_test.go; single-publication and unlatched-readback mutant controls) |
CHUNK-STATE-r3 section 18; SlotFence rows 146-149 |
STUB |
INV-STORE-FORMAT-NEWER-001 |
An intact descriptor slot naming a store format newer than this binary reads is refused typed (ErrStoreFormatNewer), never as an invalid descriptor; an open refused at slot selection removes no file. |
M1 open | core/storage/superblock_v3.go decodeSlotV3, selectSlotV3; core/storage/walstore_v3.go openWALStoreV3File |
TestANewerStoreFormatIsRefusedTypedAndUntouched (core/storage/superblock_v3_format_newer_test.go; refusal without the typed check and discard-before-select controls) |
SlotFence2 OpenNew |
ACTIVE |
INV-WAL-V3-DESCRIPTOR-001 |
A v3 descriptor slot is used only if it is valid: a matching CRC32C (Castagnoli), every reserved byte zero, an accepted impl, a nonzero slotGen at most 2^64-2, a nonzero nonce, and geometry consistent under checked arithmetic. | M1 Opened (v3 descriptor selection) | core/storage/superblock_v3.go decodeSlotV3, descriptorV3.validate, checkedAddV3 |
TestSlotV3VectorsDecodeAsExpected, TestSlotV3CounterExhaustion (core/storage/superblock_v3_test.go) |
— | STUB |
INV-WAL-V3-DESCRIPTOR-BASE-001 |
A valid v3 descriptor slot has CheckpointLSN ≤ mapCoveredCheckpoint ≤ W, and BASE fields that follow the rules of its BASE state. | M1 Opened (v3 descriptor selection) | core/storage/superblock_v3.go descriptorV3.validate |
TestSlotV3VectorsDecodeAsExpected, TestSlotV3InstalledMayHaveCursorBelowTail (core/storage/superblock_v3_test.go) |
— | STUB |
INV-CHUNK-RECORD-PAGES-CURRENT-001 |
An unfinished chunk record is used, and its header written, only when every page passes its check and is valid through exactly the store's synced position after recovery (behind: missed writes; ahead: not durable); an unmarked store discards it; the header follows the two-slot fence. | M1 Opened (chunk record load, v1.1 upgrade) | core/storage/chunk_record.go loadChunkRecord, completeChunkRecord |
TestUnfinishedRecordPagesBehindTheStoreAreNotTrusted, TestUnfinishedRecordAfterAnOldCheckpointIsDiscarded, TestStalePagesAreNeverCompleted, TestUnfinishedPagesAheadOfTheStoreAreNotTrusted, TestCompleteRecordAheadOfTheStoreIsNotTrusted, TestCompleteRecordPagePositions, TestRecordHeaderWaitsForTheFence, TestRecordHeaderIsNotWrittenAheadOfTheSyncedStore, TestDamagedPage (core/storage/chunk_record_test.go) |
SlotFence PagesCurrent, FenceHolds; pages carry chunk-kernel/2 states (the per-chunk state models are not in this repository) |
STUB |
INV-CHUNK-RECORD-UPGRADE-001 |
The v1.0.x upgrade seeds the bitmap from the presence file only on an unmarked store; marked at this epoch it rebuilds pages from the store's bitmap, at another epoch it refuses; pages precede the fence, the header follows it, the presence file goes last. | M1 Opened (v1.1 upgrade at open) | core/storage/chunk_record_upgrade.go upgradeChunkRecord, writeChunkRecordPagesFrom |
TestUpgradeChunkRecordFromLegacyPresence, TestUpgradeChunkRecordCrashBeforeTheFence, TestUpgradeChunkRecordCrashAfterTheFence, TestUpgradeChunkRecordCrashAfterTheHeader, TestUpgradeChunkRecordAfterTheMarkerIgnoresThePresenceFile, TestUpgradeChunkRecordAtAnotherEpochIsRefused (core/storage/chunk_record_upgrade_test.go) |
UpgradeWide3 (pages, field, header, presence removed); ChunkUpgrade row 118; chunk-kernel/2 Rebuilt (the per-chunk state models are not in this repository) |
STUB |
INV-CHUNK-RECORD-SEED-001 |
The v1.0.x upgrade seeds a whole local chunk as published with HEAD's hash only on an unmarked store, with a clean stop read on the HEAD the claim was built on (an idle detach of the store's lineage) at the store's synced position; otherwise it is unknown. | M1 Recovering → Serving (v1.1 upgrade at attach, after a clean stop) | core/frontend/chunkstore/layout/start.go Start (ReportCleanStop); core/storage/chunk_record_upgrade.go upgradeChunkRecordSeeded, seedsLineage, cleanStopHashes |
TestStart_ReportsTheCleanStopItClaimedFrom, TestStart_TheCleanStopIsTheClaimsOwnRead, TestStart_NoCleanStopWithoutADetachOfThisLineage (core/frontend/chunkstore/layout/start_cleanstop_test.go); TestUpgradeSeedsAfterACleanStop, TestUpgradeSeedNeedsTheStoreAtTheProofPosition, TestUpgradeSeedNeedsTheStoresLineage, TestUpgradeSeedNeedsAProofHEADStillShows, TestUpgradeSeedCrashAtEachStep (core/storage/chunk_record_seed_test.go); TestV11AttachSeedsFromTheCleanStopInItsConfig (core/storage/chunk_record_v11_seed_test.go); TestStartLayoutRootReportsTheCleanStop (core/frontend/durable/provider_layout_cleanstop_test.go) |
UpgradeWide3 rows 122 and 123 (Proof, SameEpoch judged on the HEAD the claim is built on; the claim is a stutter on image and position), 126 to 128 (the per-chunk state models are not in this repository) |
STUB |
INV-CHUNK-UPGRADE-PASS-CURSOR-001 |
Upgrade pass: rewinds only at open, before Run; a failed rewind latches it until reopen; the persisted cursor is only ever min(earliest unpublished rewind, last written-through position); a restart resumes there; while it runs, a request needing every hash answers in_progress. | M1 Opened (v1.1 upgrade compare pass) | core/storage/chunk_upgrade_pass.go upgradePass.Run, advance, Rewind, Admit |
TestUpgradePassCursorFollowsThePagesBehindIt, TestUpgradePassRestartContinuesAtTheCursor, TestUpgradePassRefusesWithProgress, TestUpgradePassRewindAtOpenAfterARebuiltPage, TestUpgradePassPauseAndHurry, TestUpgradePassFailedRewindLatchesUntilReopen, TestUpgradePassRewindOnlyBeforeRun, TestUpgradePassKeepsItsCountAcrossRuns, TestUpgradePassCursorRuleUnderInterleavings (core/storage/chunk_upgrade_pass_test.go) |
UpgradePass BehindCursorKnown, NoWorkTwice; UpgradeWide3 rows 119 to 124, rewinds at restart only (the per-chunk state models are not in this repository) |
STUB |
INV-CHUNK-RECORD-RUNTIME-001 |
While serving: state only via the kernel, a hash only with its evidence; a page dirties only on a state or hash change and is written by its count or age (an evict's at once), in snapshot order, after the WAL is synced through the position it shows; G <= min(applied, dirty-from, WAL synced). | M3 Serving (chunk record runtime) | core/storage/chunk_record_runtime.go chunkRecordRuntime.Apply, Due, WriteDue, WriteThrough, Flush, writeSegmentLocked (syncThrough), writeHeaderLocked (durable) |
TestRecordRuntimeAppliesTheKernel, TestRecordRuntimeEvictWritesThePageFirst, TestRecordRuntimeSchedulePerPage, TestRecordRuntimeFlushIsLoadedBack, TestRecordRuntimeWriteThrough, TestRecordRuntimeAnUnchangedStateWritesNothing, TestRecordRuntimeHeaderMovesUnderWrites, TestRecordRuntimeEvictDuringAFlushLandsLast, TestRecordRuntimePageWritesFollowChangesNotSize, TestRecordRuntimePageWritersPublishInOrder, TestRecordRuntimeHashEvidence, TestRecordRuntimeCopiesItsInputs, TestRecordRuntimeAPageChangedAtOpenHoldsG (core/storage/chunk_record_runtime_test.go); the WAL bound: TestV11NoPageClaimsMoreThanTheDurableWAL, TestV11APageNeverShowsAWriteTheWALCanLose (core/storage/chunk_record_v11_review_test.go, chunk_record_v11_hold_test.go) |
chunk-kernel/2; ChunkPages rule 1 (pages before the header) and rule 3 (an evict writes its page first) (the per-chunk state models are not in this repository) | STUB |
INV-CHUNK-RECORD-SHADOW-001 |
While serving, the chunk record follows the engine's events via the kernel; an event bound to a captured version is skipped, never refused, after a write; at each barrier every chunk the engine captures is a record candidate. It decides nothing; on v1.0 it writes no page. | M3 Serving (chunk record shadow) | core/storage/chunk_record_shadow.go newChunkRecordShadow, chunkRecordShadow.check; core/storage/chunk_layer.go noteMutation, fillOnce, EvictChunk, recoveredLocked, BeforeCheckpointAdvance, shadowCommit, shadowCommitCaptured (also from resolvePending, SettleDetach); core/storage/chunk_cut_payload.go markEqualNow; core/storage/chunk_record_runtime.go ApplyIf |
TestShadowWriteCoverageFollowsTheStoreBitmap, TestShadowFillRacedByAWriteEndsUnknown, TestShadowCutOfAPartialChunkKeepsItPartial, TestShadowCommitAfterAChunkLandedSinceItsScratchCaptureIsSkipped, TestShadowExtentWritesLandAnAbsentChunkOnlyOnV10, TestShadowAttachKeepsACheckpointedWriteACandidate, TestShadowWriteRacingHashAndCommitIsSkippedNotRefused, TestShadowEvictEdges, TestShadowRecordWritesNoPage, TestShadowCheckerIsExactAndCatchesAMissingWrite, TestShadowRecoverChangesOnlyTheRecoveredChunks, TestShadowBaseInstallCompletingChangesEveryChunk, TestShadowDelayedSettlementCommitsTheCapturedChunks, TestShadowProductionCheckDoesNotScanTheRecord, TestShadowScratchExemptionIsBoundToItsCapturedVersion (core/storage/chunk_record_shadow_test.go); every test of the package runs with the shadow strict, misses and extra record candidates both (TestMain, core/storage/chunk_record_shadow_main_test.go) |
chunk-kernel/2 (the per-chunk state models are not in this repository) | ACTIVE |
INV-CHUNK-RECORD-V11-001 |
On the draft v1.1 format a layer upgrades its store once at attach and opens from its record; a fill's page claims no local block before one durable mark (partial fills and later writes too); an evict clears the store's bits only after its absent page is durable, retries too. | M1 Opened, M3 Serving (draft v1.1 format) | core/storage/chunk_record_open.go openChunkRecordV11, loadChunkRecordV11, markFills; core/storage/chunk_record_upgrade.go upgradeChunkRecordWith; core/storage/chunk_record_runtime.go holdFills, PersistSegmentOf; core/storage/chunk_record_shadow.go evict; core/storage/chunk_layer.go EvictChunk, Close |
TestV11AttachUpgradesTheStoreOnce, TestV11ReopenJudgesAWriteAfterThePageAsChanged, TestV11CleanStopWritesOnlyTheDirtyPages, TestV11UpgradeRecoversFromACrashAtEachStep, TestV11DamagedPageIsRebuiltFromTheStoreBits, TestV11FillsAreMarkedInOneBatchBeforeTheirPagesClaimThem, TestV11EvictSurvivesARestart (core/storage/chunk_record_v11_test.go); TestV11CloseDuringTheUpgradeRefusesTheAttach, TestV11EvictWithoutItsAbsentPageClearsNothing, TestV11ParkedFillBatchCannotOverwriteAnEvict, TestV11MalformedLeftoverPresenceDoesNotRefuseTheAttach, TestV11FinalPageFailureIsTheCloseResult (core/storage/chunk_record_v11_review_test.go); TestV11PartialFillWaitsForTheDurableMark, TestV11WriteAfterAHeldFillKeepsTheHold, TestV11EvictRetryStillWritesItsAbsentPage (core/storage/chunk_record_v11_hold_test.go); TestV11AbsentChunkSurvivesALostHeader, TestV11LogOnlyWriteSurvivesTheUpgrade (core/storage/chunk_record_v11_upgrade_test.go) |
chunk-kernel/2; CoverageDurable row 199 (the WAL is durable through a published position) (not in this repository) | DORMANT |
INV-CHUNK-FORMAT-LEVEL-001 |
An attach raises a volume to v1.1 only at the assigned format level 1 (absent = 0); at level 0 it runs v1.1 only over a version-1 HEAD (reported), refuses a v1.1 store over a version-0 HEAD, and a v1.1 attach refuses a remote without the HEAD format. | M-format gate (holder) | core/storage/chunk_v11_format.go attachLevelV11, levelZeroFormat; core/storage/chunk_layer.go attachChunkLayerImpl; core/frontend/chunkstore/layout/format_level.go checkFormatLevel (in runTransition); core/frontend/chunkstore/layout_remote.go SetHeadFormat, HeadV11; core/host/volume/host.go applyFact; core/frontend/durable/provider_chunk.go attachFormatLevel |
TestAttachFormatFollowsTheAssignedLevel, TestAttachAtLevelZeroOfAnUpgradedStore, TestAttachAtLevelZeroOfAV11HeadOverAnUnmarkedStore, TestAV11AttachRefusesARemoteWithoutTheHeadFormat, TestALevelOneCrashBeforeTheFirstCutReattachesAsV11, TestAV11AttachRefusesARemoteThatDeclinesTheHeadFormat (core/storage/chunk_format_level_test.go); TestLayoutRemoteHeadFormatFollowsItsLayer, TestALevelZeroCommitCannotRaiseHeadToVersionOne (core/frontend/chunkstore/layout_manifest_size_test.go); TestNoHeadWriteRaisesTheVersionBelowFormatLevelOne (core/frontend/chunkstore/layout/format_level_test.go); TestTheWrappedRemoteForwardsTheHeadFormatBothWays, TestAttachFormatLevelFromTheAssignment (core/frontend/durable/format_level_test.go); TestTheAssignedLevelDecidesTheStoredHeadAcrossARestart (core/frontend/durable/format_level_layout_test.go); TestTheSelfAssignmentsFormatLevelReachesTheProjection (core/host/volume/format_level_test.go) |
none | ACTIVE |
INV-HOLDER-FORMAT-ADOPT-001 |
A serving holder adopts the cluster format level its next successful lease renewal carries, when its binary reads it, with no restart; neither a renewal nor a re-delivered assignment fact lowers it; /status, snapshot and cut HEAD writes run at it. | M-format gate (holder renewal) | core/host/master/workspace_service.go leaseFact; core/host/volume/workspace_lease.go Refresh; core/host/volume/workspace_startup.go adoptFormatLevel, raiseFormatLevel; core/host/volume/host.go applyFact; core/frontend/chunkstore/layout_remote.go SetFormatLevelSource, atFormatLevel; core/frontend/durable/provider_chunk.go newChunkLayer |
TestARunningHolderAdoptsTheFinalizedLevelAtItsNextRenewal, TestAReDeliveredFactDoesNotUndoTheAdoptedLevel (core/host/volume/format_adopt_test.go); TestALeaseAnswerCarriesTheClustersFormatLevel (core/host/master/workspace_lease_format_level_test.go); TestAHeadWriteFollowsTheHoldersLiveFormatLevel (core/frontend/chunkstore/layout_manifest_size_test.go) |
FormatGate r10 Renew, CutPublish / AdoptOnRenewal, EffNotAboveLevel (mutations no_adopt, fact_lowers); the provider's level-source and the runtime's adoption wiring are one-line hookups covered by review, not by their own test |
ACTIVE |
INV-MASTER-FORMAT-LEVEL-001 |
A master whose stores (authority, attestations, lifecycle) are all empty starts at format level 1, written before it serves; existing state keeps its level; above level 0 placement refuses only a known-old host and a grant needs the holder process's own report. | M-format gate (master) | core/host/master/host.go New; core/host/master/store_attestation.go newClusterAtStart; core/host/master/format_gate.go FormatLevel, awaitingFirstReport, formatRefusal; core/host/master/observation_snapshot.go ObservationSnapshot |
TestOnlyANewClusterStartsAtLevelOne, TestANewClusterStartsAtTheCurrentFormatLevel, TestANewClusterPlacesAnUnreportedNodeAndGrantsAfterItsReport, TestAnEmptyAuthorityStoreOverAnExistingInventoryStartsAtLevel0, TestTheGrantReadsTheHoldersOwnReportNotASiblings (core/host/master/format_level_new_cluster_test.go); TestFormatLevelIsAViewersRead, TestANewClustersFailedLevelWriteReleasesTheStore (core/host/master/format_level_auth_test.go); TestClusterFormatLevel (cmd/sw-block/cluster_format_test.go) |
none | ACTIVE |
INV-CHUNK-FOREIGN-ROOT-FENCE-001 |
A HEAD that moved past the holder's base without superseding it and is not its own proposal must keep the chunk root; one that changed it fences the layer (errChunkForeignRoot), so no chunk is held clean against a root that no longer names it. |
M5 Commit (head conflict, settlement) | core/storage/chunk_layer.go adoptHeadLocked (from captureLocked, SettleDetach, resolvePending) |
TestShadowForeignRootWithoutSupersedeFences (core/storage/chunk_record_shadow_test.go) |
HeadWriters (only metadata writers move HEAD without superseding; not in this repository) | ACTIVE |
INV-CHUNK-RECORD-PAYLOAD-001 |
Persisting and loading a chunk record preserves every entry's state and hash, including entries on either side of a segment boundary. | M1 chunk record codec (caller not wired) | core/storage/chunk_record.go encodeChunkRecordPage, decodeChunkRecordPage |
TestRecordEntryPayloadRoundTripsAcrossSegments (core/storage/chunk_record_test.go; state-zero and one-entry hash-drop controls) |
Encoding fidelity; no state transition change | STUB |
INV-CHUNK-COVERAGE-INIT-POSITION-001 |
Coverage initialization rechecks the captured append position under the final store lock before publishing a fence or replacing live entries; a changed position refuses the candidate. | M1 coverage initialization | core/storage/chunk_coverage.go InitializeChunkCoverage |
TestChunkCoverageInitializationRefusesAnAppendDuringPagePreparation, TestChunkCoverageInitializationCaptureBarrierExcludesPublicWrites (core/storage/chunk_coverage_initialization_append_test.go) |
SlotFence.Publish; capture barrier remains the public-write exclusion | ACTIVE |
INV-CHUNK-COVERAGE-RETAINED-001 |
A coverage-map baseline is installed by recovery only when every chunk position is at or below the retained WAL frontier; a discarded suffix cannot regain local bits through later LSN reuse. | M1 recovery (caller not wired) | core/storage/walstore_v3.go WALStore.recoverV3; core/storage/walstore_map_checkpoint_v3.go prepareOwnedMapCheckpointV3 |
TestChunkCoverageBaselineCannotOutliveItsRetainedWAL, TestCoveragePublicationSyncsItsSpeculativeWALBeforeMap, TestCoveragePublicationRefusesWALSyncFailureBeforeMap |
SlotFence2 position-check premise; WAL before bitmap pages | STUB |
INV-CHUNK-LOCAL-COVERAGE-001 |
Coverage returns local none/some/all and the chunk position from one observation; it is unavailable until successful recovery and bitmap initialization. | M1 chunk bitmap (caller not wired) | core/storage/chunk_coverage.go WALStore.Coverage, WALStore.InitializeChunkCoverage |
TestChunkCoverageBaselineCannotOutliveItsRetainedWAL, TestChunkCoverageAdmissionPrecedesSeed, TestChunkCoverageInitializesEmptyWithoutFabricatingLocalBlocks, TestChunkCoverageAcknowledgedWriteSurvivesReplay, TestChunkCoverageCheckpointKeepsAllAcrossAPageBoundary, TestChunkCoverageRequiresSuccessfulRecovery (core/storage/chunk_coverage_test.go) |
MoveWide2 durable per-block map premise; SlotFence publication | STUB |
INV-CHUNK-LOCAL-MUTATION-001 |
A successful local clear or mark has synced its map publication; marking all-local syncs extent bytes first. A failed publication grants no permission to drop bytes or persist an all-local record. | M1 chunk bitmap mutation (caller not wired) | core/storage/chunk_local_mutation.go ClearChunkLocal, MarkChunksLocal, publishChunksLocal |
TestCrashAfterAbsentPageBeforeClearKeepsBytesAndLaterWrite, TestMarkChunksLocalPublishesOncePerRestoreBatch, TestClearChunkLocalIsDurableBeforeReturn, TestMarkChunkLocalSyncsBytesBeforePublishingCoverage, TestMarkChunkLocalRefusesFailedExtentSyncBeforeMapIO, TestChunkLocalMutationRefusesUnavailableBoundsAndMapFailure |
MoveWide2.Fill/Evict/Drop; caller admission and page-before-drop remain caller obligations | STUB |
INV-CHUNK-LOCAL-EPOCH-001 |
After a format marker, initialization never reads legacy presence: the same epoch rebuilds pages from the bitmap; another epoch is refused without changing storage. | M1 bitmap initialization (caller not wired) | core/storage/chunk_coverage.go WALStore.InitializeChunkCoverage |
TestChunkCoverageLegacyFenceCannotRelabelAnInitializedEpoch, TestChunkCoverageMarkedEpochNeverReseedsPresence, TestChunkCoverageMarkerWithoutBitmapCannotReadPresence (core/storage/chunk_coverage_test.go) |
SlotFence marker authority; UpgradeWide3 | STUB |
INV-CHUNK-HALF-FENCE-FALLBACK-001 |
A damaged selected marked map may fall back only on integrity-only errors, to an intact valid unmarked slot of the same store incarnation; two marked slots never authorize fallback. Each successful fallback reports a typed event and one process-local counter increment. | M1 half-fence open (caller not wired) | core/storage/walstore_v3.go openWALStoreV3File, coverageHalfFenceFallbackEligible |
TestChunkCoverageHalfFenceReusedMapOpensTheIntactLegacySlot, TestChunkCoverageBothMarkedDamagedMapNeverFallsBack (core/storage/chunk_coverage_test.go) |
SlotFence2.OpenNew | STUB |
INV-WAL-V3-DESCRIPTOR-SELECT-001 |
Of the two v3 descriptor slots, open selects the valid selectable slot with the higher slotGen, and never a prepared migration slot. | M1 Opened (v3 descriptor selection) | core/storage/superblock_v3.go selectSlotV3 |
TestSlotV3Selection (core/storage/superblock_v3_test.go); TestWALStoreV3CloseKeepsTheNewestSlotAAndItsW (core/storage/walstore_close_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-DESCRIPTOR-CONFLICT-001 |
Open is refused when both v3 descriptor slots are valid but carry the same slotGen with different bytes, or disagree on the UUID or the geometry. | M1 Opened (v3 descriptor selection) | core/storage/superblock_v3.go selectSlotV3, sameGeometryV3 |
TestSlotV3Selection (core/storage/superblock_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-RECORD-001 |
An impl-3 WAL record has a fixed 62-byte prefix, 70 bytes of overhead in all, a CRC32C (Castagnoli) and an explicit EntrySize. | M1 v3 record framing | core/storage/wal_entry_v3.go encodeWALEntryV3, payloadSizeV3 |
TestWALEntryV3_CanonicalBarrierBytes, TestWALEntryV3_TypeFootprints |
WALRecovery abstract record validity; physical byte rules are code-test obligations |
ACTIVE |
INV-WAL-V3-RECORD-REFUSE-001 |
The impl-3 codec refuses unknown types or flags, a zero nonce, invalid per-type geometry, overflowing spans and truncation before allocating a payload; the scanner reads a record only after those checks bound its size, and refuses nonzero padding, a bad CRC or a bad footer before using its bytes. | M1 v3 record framing | core/storage/wal_entry_v3.go payloadSizeV3, decodeWALEntryV3; core/storage/wal_io_v3.go scanWALV3Accepted |
TestWALEntryV3_RefusesInvalidEncode, TestWALEntryV3_RefusesMalformedWire, FuzzWALEntryV3_DecodeNeverPanics |
— | STUB |
INV-WAL-V3-LSN-ORDER-001 |
A v3 writer accepts only a first LSN above its highest consumed LSN; a batch consumes its whole validated range. Equal/lower requests return ErrWALLSNOrder before any pwrite or cursor change. Constructor coverage and a recovered kept frontier count as consumed; a fenced-away suffix does not. | M1 v3 append | core/storage/wal_io_v3.go append, newWALWriterV3, restoreScanV3 |
TestWALLSNOrderV3_RefusesDuplicateAndLower, TestWALLSNOrderV3_BatchConsumesFullRange, TestWALLSNOrderV3_RestoreUsesKeptNotDroppedFrontier, TestWALLSNOrderV3_DescriptorFloorIsAlreadyConsumed, TestWALIOV3_ValidatedFrontierIntervals, TestWALIOV3_ConcurrentAppendsHaveUniqueCursors |
Physical LSN-strict prefix is a contract constraint; r16 model correspondence is pending | ACTIVE |
INV-WAL-V3-ADMISSION-001 |
v3 write admission measures WAL pressure from the active v3 writer's physical head minus the both-slot reuse floor, as a fraction of WALSize. | M1 Serving (write admission) | core/storage/walstore.go openInitializedV3, WALStore.walUsedFraction; core/storage/write_command_budget.go WALStore.writePressureSample |
TestWALStoreV3AdmissionUsesNativeOccupancy (core/storage/walstore_admission_v3_test.go); TestWALStoreV3WritePressureSampleMatchesOccupancy (core/storage/write_command_budget_test.go); liveness under pressure: TestWALStoreChunkV3_SequentialBurstFlush (public provider and NVMe handler, default 64 MiB WAL, 320 MiB literal readback), TestWALStoreChunkV3_BurstPatternBindsFullLBA (32/64/256 MiB alias controls) (core/frontend/durable/provider_chunk_burst_test.go) |
Existing reuse/durability rules unchanged; pressure/liveness is not a new model claim | ACTIVE |
INV-WAL-V3-ADMISSION-FIFO-001 |
Room with no waiter is reserved atomically without a ticket. Otherwise tickets keep command-arrival order across batches. Admitted appends cannot be preempted. Release precedes RMW/peer ACK waits; cancellation removes a waiter. | M1 Serving (write admission) | core/storage/wal_admission.go acquireContext, Release; core/storage/wal_admission_fifo.go; core/storage/wal_admission_fast.go lockFastWALAppend |
TestWALAdmissionFastReservationExcludesCompetingAppend, TestWALAdmissionFastPathHasNoTicket, TestWALAdmissionFastPathCannotPassAWaiter, TestWALAdmissionFastReservationKeepsAppendLock, TestWALAdmissionFIFOOwnsCapacityThroughAppend, TestWALAdmissionFIFOCancelledWaiterDoesNotBlockNext, TestWALStoreAdmissionFIFOOrdersRealAppends, TestWALHoldOlderBatchReentersBeforeYoungerPressureWaiter, TestWALHoldLargeWriteBatchesKeepCommandArrivalUnderPressure, TestWALAdmissionResamplesAfterOlderBatchChangesHead, TestWALAdmissionActiveAppendPinsReorderedCancellation, TestWALHoldReleasesAdmissionBeforeObserverAck, TestWALHoldDoesNotOwnAdmissionWhileWaitingForRMW |
WALHold r2 rows 325-333; WALHold r3b two-batch ordering (batch_to_tail); WALHold r3c fast path (fast_ignores_waiters); model qualification complete, native/performance gates separate |
ACTIVE |
INV-WAL-HOLD-WINDOW-001 |
A command's WAL-pressure inactivity window starts no earlier than its own hold; a host retry gets a fresh window. Successful same-store reclaim or extent-byte increments renew it. | M1 Serving (write admission) | core/storage/wal_write_hold.go start, check; wal_hold_window.go |
TestWALWriteHoldStallIsTypedAndFreshPerCommand, TestWALWriteHoldMovingReclaimOutlastsOldAdmissionBudget, TestWALHoldWindowRetryGetsOwnStallWindow, TestWALHoldSamplerRenewsOnlySuccessfulByteProgress, TestWALHoldSamplerFixedNonzeroProgressExpires |
WALHold r2 rows 325-333, StallHoldsOwnWindow, ErrorOnlyOnStall | ACTIVE |
INV-WAL-HOLD-CAP-001 |
Progress does not renew a command's arrival-based hold cap. Startup refuses a non-positive network cap or a cap leaving less than five seconds before the declared host timeout. | M1 Serving (write admission) | core/storage/wal_hold_window.go; core/frontend/wal_hold_config.go |
TestWALWriteHoldCapWhileProgressMoves, TestWALHoldRealWALAgedBatchKeepsCapAndEarlierDeadline, TestWALHoldConfigHostTimeoutMargin, TestParseFlagsWALHoldHostTimeout |
WALHold r2 rows 325-333, NoHostTimeout, RetryOnlyAtCap | ACTIVE |
INV-WAL-HOLD-DEGRADED-001 |
Five seconds of WAL pressure without progress marks reclaim diagnostically degraded; it does not change authority or frontend readiness. | M1 Serving (diagnostics) | core/storage/wal_write_hold.go check; wal_hold_status.go; core/host/volume/status_server.go |
TestWALWriteHoldDegradedBeforeFinalStallAndCancellationJoins, TestWALHoldDegradedDoesNotChangeReadiness, TestWALHoldReleasesAdmissionBeforeObserverAck, TestWALHoldDoesNotOwnAdmissionWhileWaitingForRMW |
WALHold r2 window; diagnostic projection only | ACTIVE |
INV-WAL-HOLD-OBSERVE-001 |
The hold status and metrics routes read atomic progress without requiring general frontier locks and preserve the status listener's access policy. | M1 Serving (diagnostics) | core/host/volume/wal_hold_metrics.go; DurableProvider.WALHoldStatuses |
TestWALHoldMetricsAtomicSourceAndAccess, TestWALHoldAtomicStatusDoesNotReadFrontiers |
NONE (read-only observation) | ACTIVE |
INV-WAL-HOLD-TRANSPORT-SCOPE-001 |
ublk, NBD and serial iSCSI explicitly retain the legacy write budget and cannot install a retryable WAL hold; ublk/NBD apply it to Write only, while FUA Sync and flush retain the caller context; final-error extended holds remain deferred. | M1 Serving (write admission) | core/frontend/write_budget.go WithLegacyWriteBudget; core/frontend/durable/storage_adapter.go WriteCommandContext; ublk, NBD and serial iSCSI write dispatch |
TestDeviceWriteKeepsLegacyBudget (core/frontend/ublk/device_write_budget_test.go, core/frontend/nbd/device_write_budget_test.go); TestDeviceLegacyBudgetDoesNotInstallARetryableWALHold (core/frontend/durable/device_write_scope_test.go); TestSerialISCSIWriteKeepsLegacyBudget |
WALHold r2 rows 325-333; final-error activation deferred | ACTIVE |
INV-WAL-V3-ADMISSION-FAULT-001 |
A terminal I/O fault latched while a v3 write waits on WAL pressure or for an admission slot ends that wait with the fault's original typed cause, also when the deadline has expired at the same check. | M1 Serving (write admission) | core/storage/wal_admission.go walAdmission.acquireContext, walAdmission.terminalFault; core/storage/write_command_budget.go WALStore.writeBudgetError |
TestWALStoreV3AdmissionReturnsFaultLatchedDuringPressureWait (Write and WriteBatch); TestWALStoreV3WriteBudgetKeepsTerminalFault (core/storage/write_command_budget_test.go); also in core/storage/wal_admission_fault_v3_test.go |
— | ACTIVE |
INV-WAL-V3-ADMISSION-DEADLINE-001 |
A command keeps any earlier caller deadline across adapter batches. Retryable WAL commands use their arrival-based cap; explicit legacy device transports and other backends keep WriteCommandBudget. An expired command starts no new append. | M1 Serving (write admission) | core/frontend/write_budget.go WithWriteBudget; core/frontend/durable/storage_adapter.go StorageBackend.Write, writeBytes; core/storage/write_command_budget.go WALStore.writeAdmissionDeadline, WALStore.acquireWriteLock; core/storage/walstore.go WALStore.WriteContext, WALStore.WriteBatchContext; core/storage/wal_write_hold.go |
TestStorageBackendWriteKeepsOneDeadlineAcrossBatches, TestWALStoreV3WriteContextDeadlineIncludesCaptureWait, TestWALStoreV3WriteBudgetIncludesPostAdmissionWait, TestSessionWriteBudgetIncludesDispatchQueue, TestWALHoldBudgetSurvivesNestedNVMeDispatch, TestWALHoldReleasesAdmissionBeforeObserverAck, TestWALHoldDoesNotOwnAdmissionWhileWaitingForRMW |
— | ACTIVE |
INV-WAL-V3-ADMISSION-SHORTLOCK-001 |
A v3 write takes the store, descriptor and WAL writer locks blocking, never by polling, so RWMutex writer preference holds, and its command deadline is checked once they are held. | M1 Serving (write admission) | core/storage/walstore.go WALStore.WriteContext, WALStore.WriteBatchContext; core/storage/write_command_budget.go WALStore.writePressureSample; core/storage/wal_io_v3.go walWriterV3.append |
TestWALStoreV3ExpiredWriterRefusesAfterShortLockWait, TestWALStoreV3WriteKeepsWriterPreferenceUnderReaders, TestWALStoreV3WriteBudgetRefusesAfterDescriptorWaitBehindSync |
— | ACTIVE |
INV-WAL-V3-ADMISSION-NOPAYLOAD-001 |
A v3 write whose command deadline has passed starts no new payload WAL write: the deadline is checked again after a checkpoint rollover and inside the WAL writer after its descriptor snapshot, lock wait and encoding, before the first payload write. | M1 Serving (write admission) | core/storage/walstore_v3.go WALStore.appendWriteV3, WALStore.writeBatchV3Locked, WALStore.v3BudgetAfterRollover; core/storage/wal_io_v3.go walWriterV3.append |
TestWALStoreV3WriteBudgetRefusesNewPayloadAfterRollover, TestWALStoreV3WriteBudgetRechecksAfterRollover |
— | ACTIVE |
INV-WAL-V3-ADMISSION-EXPIRY-STATE-001 |
A v3 write refused for an expired deadline before its append leaves the WAL bytes, nextLSN and the dirty map unchanged. | M1 Serving (write admission) | core/storage/walstore.go WALStore.WriteContext, WALStore.WriteBatchContext |
TestStorageBackendExpiredWriteDoesNotAppend |
— | ACTIVE |
INV-WAL-V3-ADMISSION-PREFIX-ERR-001 |
A write batch that returns a committed prefix with a storage error keeps that error in the error set the frontend classifies. | M1 Serving (write admission) | core/frontend/durable/storage_adapter.go writeFullBlockBatch, withStorageCause, observeWriteCause |
TestStorageBackendPartialBatchPhysicalFaultSurvivesObserverDeadline |
— | ACTIVE |
INV-WAL-V3-ADMISSION-RETRYABLE-001 |
A write that fails only because the caller's deadline expired is reported retryable, also through a required write observer and on NVMe; a write whose error carries a physical cause is reported terminal. | M1 Serving (write admission) | core/frontend/write_budget.go IsWriteDeadline; core/frontend/durable/storage_adapter.go StorageBackend.Write, replicationWriteError; core/frontend/nvme/io.go mapBackendError; core/frontend/nvme/session.go Session.handleWrite |
TestStorageBackendRequiredObserverDeadlineStaysRetryable, TestStorageBackendPartialBatchPhysicalFaultSurvivesObserverDeadline; TestSessionWriteBudgetDeadlineIsRetryableIncludingFUA (core/frontend/nvme/write_command_budget_test.go); also in core/frontend/durable/write_command_budget_test.go, core/frontend/durable/write_command_budget_p1_test.go |
— | ACTIVE |
INV-FE-ERROR-RETRY-CLASS-001 |
A backend error's retry class is decided once and every frontend reports it with its protocol's retryable form; only permanent errors become medium errors. | M1 I/O error completion (shared frontend classifier) | core/frontend/error_class.go ClassifyBackendError; core/frontend/iscsi/scsi.go, core/frontend/nvme/io.go mapBackendError |
TestBackendErrorClassesAcrossFrontends (core/frontend/iscsi/backend_error_class_test.go); TestBackendRetryClassClearsWireDNR, TestSyncAndFUALatchedFaultOverridesBusy (core/frontend/nvme/backend_error_class_test.go); TestUnclassifiedBackendErrorIsPermanentAndLoggedOncePerType (core/frontend/iscsi/backend_error_class_test.go); TestSessionWriteBudgetDeadlineIsRetryableIncludingFUA (core/frontend/nvme/write_command_budget_test.go) |
Protocol output only; existing backend states, no new automaton state | ACTIVE |
INV-WAL-V3-RECLAIM-001 |
A mapped v3 checkpoint at cp moves retainedTail only to the end of a complete validated record whose last LSN is at most cp minus the retention window, and, while a BASE is installing, never past BaseCursor. | M1 checkpoint / existing two-slot retirement | core/storage/walstore_map_checkpoint_v3.go WALStore.publishCheckpointV3; core/storage/wal_io_v3.go walWriterV3.reclaimThroughV3 |
TestWALStoreV3CheckpointReclaimsAcrossRingLaps, TestWALStoreV3ReclaimKeepsPartialBatchAndRetention, TestWALStoreV3ReclaimAfterInstallingPhysicalReopen |
Existing dual-slot retirement and nonce/cursor contract; concrete index/recovery/caller wiring is a code-test obligation | STUB |
INV-WAL-V3-RECLAIM-INDEX-001 |
A physical v3 recovery rebuilds the writer's volatile record-boundary index only from trusted write records of the kept scan; an installing reopen indexes them without moving the writer's cursor. | M1 checkpoint / existing two-slot retirement | core/storage/wal_io_v3.go walWriterV3.restoreScanV3, walWriterV3.rememberReclaimScanV3, walWriterV3.indexReclaimScanLockedV3; core/storage/walstore_v3.go WALStore.recoverV3 |
TestWALStoreV3ReclaimRebuildsIndexAfterPhysicalRecovery, TestWALStoreV3ReclaimAfterInstallingPhysicalReopen |
— | STUB |
INV-WAL-V3-RECLAIM-PUBLISH-001 |
A mapped v3 checkpoint publishes retainedTail, retainedHead, the map root, CheckpointLSN and W in one slot publication, followed by a metadata-only rollover when the fallback slot still pins a lower tail. | M1 checkpoint / existing two-slot retirement | core/storage/walstore_map_checkpoint_v3.go WALStore.publishCheckpointV3; core/storage/descriptor_v3.go descriptorPublisherV3.rolloverIfPinned |
TestWALStoreV3CheckpointReclaimsAcrossRingLaps, TestWALStoreV3ReclaimSecondSlotFailureKeepsOldPin |
— | STUB |
INV-WAL-V3-RECLAIM-FAIL-001 |
When a v3 checkpoint publication or its rollover fails, no WAL byte is released for reuse and the dirty entries at or below the checkpoint stay unchanged for retry. | M1 checkpoint / existing two-slot retirement | core/storage/walstore_map_checkpoint_v3.go WALStore.publishCheckpointV3, WALStore.rolloverCheckpointV3Locked; core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedCoreV3 |
TestWALStoreV3ReclaimSecondSlotFailureKeepsOldPin, TestWALStoreV3_UncertainMapCheckpointPinsDependencies; TestNativeReplacementCallerPublicationFaults (core/storage/legacy_replacement_v3_test.go); also in core/storage/walstore_reclaim_v3_test.go, core/storage/walstore_map_checkpoint_v3_test.go |
— | ACTIVE |
INV-WAL-V3-RECLAIM-EXCL-001 |
No v3 writer is admitted between a checkpoint's slot publication and the end of both its rollover and its retirement of the dirty entries at or below the checkpoint. | M1 checkpoint / existing two-slot retirement | core/storage/walstore_map_checkpoint_v3.go WALStore.publishCheckpointV3, WALStore.retireCheckpointDirtyV3Locked |
TestWALStoreV3ReclaimRetiresReferencesBeforeReuse |
— | STUB |
INV-WAL-V3-RECLAIM-SETTLE-001 |
A pending v3 rollover (the fallback slot pinning a lower tail) is settled without a new checkpoint by the idle refresh, by a flusher cycle whose checkpoint does not advance, and by write admission. | M1 checkpoint / existing two-slot retirement | core/storage/walstore_map_checkpoint_v3.go WALStore.rolloverCheckpointV3Locked, WALStore.persistOwnedMapCheckpointV3; core/storage/walstore_v3.go WALStore.refreshW, WALStore.appendWriteV3 |
TestWALStoreV3ReclaimRolloverProgressWithoutNewCheckpoint |
— | ACTIVE |
INV-WAL-V3-OWNER-001 |
v3 read/write open and offline readonly open acquire the same exclusive nonblocking OS file lock before reading slots or changing bytes. Contention refuses with volume locked; descriptor close releases it, allowing retry. | M1 open admission | core/storage/volume_lock*.go; walstore_v3.go; walstore_readonly_v3.go |
TestWALStoreV3CreatorKeepsOwnershipThroughPublication (core/storage/volume_lock_v3_test.go); TestWALStoreV3OwnerExcludesOpenAndReadOnly (core/storage/volume_lock_v3_test.go); TestNativeReplacementLegacyBytesRefusedWithoutMutation (core/storage/legacy_replacement_v3_test.go) |
OS mutual exclusion is a caller obligation, outside the abstract crash model; existing open states unchanged | STUB |
INV-WAL-V3-CATCHUP-001 |
A v3 catch-up source that is installing refuses with ErrBaseInstalling and emits nothing, also for an empty request at the head. |
M1 BASE lifecycle / M3 CatchingUp | core/storage/walstore_recovery.go WALStore.ScanLBAs, WALStore.scanLBAsV3 |
TestCatchUpV3InstallingAtHeadRefuses (tag swblock_format_v3_test, actual catch-up sender) |
Existing BASE and catch-up transitions unchanged; this physical scan/source-lifetime obligation is covered by deterministic caller tests | STUB |
INV-WAL-V3-CATCHUP-BASE-001 |
A v3 catch-up request covered by an installed BASE (fromLSN at or below BaseLSN) fails with typed WALRecycled: the peer needs a rebuild. |
M1 BASE lifecycle / M3 CatchingUp | core/storage/walstore_recovery.go WALStore.scanLBAsV3 |
TestCatchUpV3CompletedBASEUsesRebuild, TestCatchUpV3CompletedBASESuffix (tag swblock_format_v3_test) |
— | STUB |
INV-WAL-V3-CATCHUP-DAMAGE-001 |
Damage in the retained v3 WAL makes a catch-up fail with a typed WAL integrity error and emit nothing. | M1 BASE lifecycle / M3 CatchingUp | core/storage/walstore_recovery.go v3CatchUpEntries |
TestWALStoreV3ScanLBAsIsAllOrNothing (core/storage/walstore_batch_v3_test.go; default suite, asserts both clauses for a damaged first and middle record); also TestCatchUpV3CorruptFirstRecordFails, TestCatchUpV3CorruptMiddleRecordFails (tag swblock_format_v3_test, not run by CI); also in core/transport/catchup_format_v3_test.go |
— | ACTIVE |
INV-WAL-V3-CATCHUP-REVALIDATE-001 |
A v3 catch-up emits entries only from a scan whose recovery generation, nonce, BASE state and ID, install epoch, retainedTail and CheckpointLSN are unchanged after the scan. | M1 BASE lifecycle / M3 CatchingUp | core/storage/walstore_recovery.go WALStore.scanLBAsV3 |
TestCatchUpV3InstallRetireABARefusesOldScan, TestCatchUpV3AfterCheckpointRingReuse, TestCatchUpV3ScanOverlappingCheckpointReuseIsRecycled (tag swblock_format_v3_test) |
— | STUB |
INV-WAL-V3-BINDING-001 |
Every record and padding the v3 writer emits carries the selected nonce and its own absolute logical cursor and fits within WALSize of the both-slot reuse floor; an append that does not fit is refused. | M1 Recovering | core/storage/wal_io_v3.go walWriterV3.append, walSnapshotV3 |
TestWALIOV3_RealWriterReopenScan, TestWALIOV3_WrapPaddingAndSlack, TestWALIOV3_FloorAndPwriteFailureRefuse (core/storage/wal_io_v3_test.go) |
Record/lap admission is abstracted in composed WALFormatR5; physical framing/wrap boundaries remain code-test obligations | ACTIVE |
INV-WAL-V3-SCAN-BINDING-001 |
The v3 scanner checks a record's nonce and exact expected cursor before it uses the record's Length or count, and trusts the record only after the whole record validates again. | M1 Recovering | core/storage/wal_io_v3.go scanWALV3Accepted |
TestWALIOV3_StopsAtBindingBeforeEmbeddedRecord, TestWALIOV3_EmbeddedRecordInPayloadIsNotScanned (core/storage/wal_io_v3_test.go) |
— | STUB |
INV-WAL-V3-SCAN-STOP-001 |
The v3 scanner skips only geometric end-of-ring slack and stops at the first untrusted record, never searching inside a payload for a later record. | M1 Recovering | core/storage/wal_io_v3.go scanWALV3Accepted |
TestWALIOV3_WrapPaddingAndSlack, TestWALIOV3_EmbeddedRecordInPayloadIsNotScanned, TestWALIOV3_StopsAtBindingBeforeEmbeddedRecord (core/storage/wal_io_v3_test.go) |
— | STUB |
INV-WAL-V3-MAP-CLOSE-ERROR-001 |
A failed map validation returns both its validation cause and any failure closing the owned map handle; cleanup cannot hide operational failure. | M1 map open refusal | core/storage/chunk_lsn_map_v3.go openChunkLSNMapV3Progress; core/storage/chunk_map_publication_v3.go openDescriptorMapV3Progress |
TestChunkMapValidationKeepsTheCloseFailure |
Error preservation only; no state transition change | ACTIVE |
INV-WAL-V3-MAP-PUBLISH-001 |
Once a v3 store has bound a validated map, every descriptor publication carries the bound map tuple or a prepared candidate's, with merged CheckpointLSN ≤ map coverage C ≤ merged W. | M1 Serving (v3 map publication) | core/storage/chunk_map_publication_v3.go validateMapPublicationV3, sameMapTupleV3; core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedWithMapV3 |
TestMapPublicationV3_IsolatedMergedCoverageAndWPositive, TestMapPublicationV3_CoverageWAndNoUnpreparedRoot, TestWALStoreV3_AutomaticMapCheckpoint, TestWALStoreV3_AutomaticCheckpointMetadataOrderAndRetry; TestDescriptorV3MergeIsMonotonicAndRefusesForbiddenChanges (core/storage/descriptor_v3_test.go); also in core/storage/chunk_map_publication_v3_test.go, core/storage/walstore_map_checkpoint_v3_test.go |
WALFormatR5 map coverage / volatile proof epoch; physical caller wiring remains a code obligation | ACTIVE |
INV-WAL-V3-MAP-PUBLISH-REPLACE-001 |
A prepared v3 map candidate is published only with a higher map generation, coverage not below the bound map's, and the same sidecar and proof domain with its epoch and mutation token unchanged since preparation; a stale candidate writes no slot. | M1 Serving (v3 map publication) | core/storage/chunk_map_publication_v3.go validateMapPublicationV3, prepareMapPublicationV3, mapPublicationProofV3.validV3 |
TestMapPublicationV3_ProofEpochAndMutationRefusal, TestMapPublicationV3_ProofChangedDuringPersistenceRefuses, TestMapPublicationV3_HeldPublicationsBothOrders, TestWALStoreV3_PreparedCheckpointRefusesChangedProof, TestCheckpointV3_EffectiveBaseWriteStillInvalidatesProof, TestCheckpointV3_DefiniteCutClearInvalidatesHeldProof, TestCheckpointV3_ExhaustedMutationCounterStillRefusesAppend |
— | STUB |
INV-WAL-V3-MAP-PUBLISH-ROLLOVER-001 |
A v3 publication without a prepared map candidate (a W-only publication or a rollover) carries the bound map root unchanged. | M1 Serving (v3 map publication) | core/storage/chunk_map_publication_v3.go validateMapPublicationV3 |
TestMapPublicationV3_CoverageWAndNoUnpreparedRoot, TestCheckpointV3_AppendRolloverAfterPrepareKeepsRetainedSuffix |
— | STUB |
INV-WAL-V3-FLUSH-LIFETIME-001 |
A v3 flusher binds its dirty snapshot and extent materialization to the original even Recover generation. A cycle spanning Recover/reset publishes no checkpoint/map and retires no reused dirty entry. | M1 Recovering / checkpoint publication | core/storage/flusher.go; walstore_map_checkpoint_v3.go; walstore_v3.go flushLifetimeValidV3 |
TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime |
Existing recovery/map proof lifetime; implementation correspondence | STUB |
INV-WAL-V3-MAP-BYTES-001 |
A v3 map candidate names immutable pages and root in the store's owned sidecar, checked against the descriptor's identity and geometry. | M1 (map preparation) | core/storage/chunk_lsn_map_v3.go prepareLockedV3, encodeMapPageV3, encodeMapRootV3 |
TestChunkLSNMapV3_PersistReloadAndReuse, TestChunkLSNMapV3_OrderOwnedOpenAndClippedPage, TestChunkLSNMapV3_CorruptionAndBounds |
WALFormatR5 abstract map dependency; physical encoding/digest/order are code obligations | ACTIVE |
INV-WAL-V3-MAP-CANDIDATE-IMMUTABLE-001 |
A prepared map candidate retains immutable entry values; later writes or source-slice changes cannot change an earlier candidate. | M1 map preparation | core/storage/map_entry_snapshot.go snapshotMapEntries; core/storage/map_entry_builder.go capture, set; core/storage/chunk_lsn_map_v3.go prepareEntriesLockedV3 |
TestChunkMapEntrySnapshotsKeepOldValuesAcrossPageBoundaries, TestOwnedMapCandidatesFreezeCapturedVersions, TestMapEntryOwnerRolloverKeepsOldSnapshots, TestChunkMapCheckpointOneChangedPageDoesNotCopyTheWholeMap |
PageReuse.Prepare / Publish / Abandon; selected root is the durable version baseline | STUB |
INV-WAL-V3-MAP-LARGE-COVERAGE-001 |
After create, an owned-map checkpoint above 256 GiB requires the coverage format; the initial unmarked all-Unknown map remains the valid empty representation. | M1 map preparation | core/storage/walstore_map_checkpoint_v3.go prepareOwnedMapCheckpointV3 |
TestOwnedMapCheckpointRefusesAnOversizedLegacyMap, TestCoverageOneTiBStoreStopsWithAnEmptyDirtyTail |
PageReuse bounded legacy path; upgrade order unchanged | STUB |
INV-WAL-V3-MAP-VALIDATE-001 |
A v3 map read returns no entry before the root and every page pass their domain-separated body digests, zero reserved and unused bytes, exact page counts, file bounds and non-aliasing page intervals. | M1 (map preparation) | core/storage/chunk_lsn_map_v3.go readChunkLSNMapV3, mapReadAtV3 |
TestChunkLSNMapV3_CanonicalVectors, TestChunkLSNMapV3_CorruptionAndBounds, TestChunkLSNMapV3_RejectsRehashedMalformedRecords, TestChunkLSNMapV3_EntryBoundBeforeRootIO, TestChunkLSNMapV3_WholePageHashIsNotBodyDigest |
— | STUB |
INV-WAL-V3-MAP-PERSIST-ORDER-001 |
A v3 map candidate exists only after its new pages are written and fsynced, then its root is written and fsynced, then the sidecar's directory is fsynced. | M1 (map preparation) | core/storage/chunk_lsn_map_v3.go prepareLockedV3 |
TestChunkLSNMapV3_OrderOwnedOpenAndClippedPage |
— | ACTIVE |
INV-WAL-V3-MAP-PERSIST-FAIL-001 |
An error inside a v3 map persistence transaction yields no candidate and latches the store against later I/O; a preflight or Stat error latches nothing. | M1 (map preparation) | core/storage/chunk_lsn_map_v3.go prepareLockedV3 |
TestChunkLSNMapV3_FailureDoesNotPublishOrReuse, TestChunkLSNMapV3_PreflightErrorDoesNotLatch, TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore |
— | STUB |
INV-WAL-V3-MAP-EXTENT-REUSE-001 |
A v3 sidecar extent is reused only when no live root references it: neither slot's root, no in-flight candidate, and, until reopen, no candidate whose publication outcome is uncertain. | M1 (map preparation) | core/storage/chunk_map_extents_v3.go slotsPublishedV3, abandonCandidateV3, liveSnapshotV3, registerRootV3; core/storage/map_extent_pins.go root, reserveCoverageV3; core/storage/chunk_map_publication_v3.go publishMapV3, openDescriptorMapV3 |
TestCoverageReferencePinsKeepBothSlotsAndHeldCandidates, TestChunkMapExtentsV3FallbackRootIsNeverReused, TestChunkMapExtentsV3NewerInFlightCandidateIsNotReused, TestChunkMapExtentsV3CrashBeforePublicationOfAReusedExtent, TestChunkMapExtentsV3UncertainCandidateStaysPinned, TestChunkMapExtentsV3DurableButRefusedPublicationStaysPinned, TestChunkMapExtentsV3ReopenRegistersTheFallbackRoot (core/storage/chunk_map_extents_v3_test.go); TestMapPublicationV3_UncertainFinalResponsePinsCandidate, TestWALStoreV3_UncertainMapCheckpointPinsDependencies; also in core/storage/chunk_map_publication_v3_test.go, core/storage/walstore_map_checkpoint_v3_test.go |
— | ACTIVE |
INV-WAL-V3-MAP-PRIOR-LIVE-001 |
A map prepare reuses pages only of a prior root that is live in the same section that snapshots the live set; otherwise it is refused, not latched, and retried from the current root. | M1 Serving → Serving (checkpoint) and Serving → Serving (map prepare refused) (ORDER: capture of prior, then the live-set snapshot) | core/storage/chunk_lsn_map_v3.go prepareLockedV3; core/storage/chunk_map_extents_v3.go liveSnapshotWithPriorV3; core/storage/map_extent_pins.go reserveCoverageV3 |
TestChunkMapExtentsV3ReleasedPriorIsRefused, TestChunkMapExtentsV3ReleasedPriorIsRefusedInsideThePrepare, TestChunkMapExtentsV3InFlightCandidatePinsItsReusedPages (core/storage/chunk_map_extents_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-MAP-ALLOCATOR-TRANSITION-001 |
A format1-to-coverage transition synchronizes allocator geometry with legacy file growth or truncation; allocation never returns a pinned page. | M1 map preparation | core/storage/map_extent_pins.go syncFileSize, reserve; core/storage/chunk_lsn_map_v3.go prepareEntriesLockedV3 |
TestCoverageUpgradeAfterLegacyGrowthKeepsBothOldRoots |
PageReuse.FreeExt; same dependency pins across formats | STUB |
INV-WAL-V3-MAP-TRUNCATE-001 |
When the v3 sidecar exceeds four times its live bytes, its free tail is truncated to the end of the highest live page and no lower. | M1 (map preparation) | core/storage/chunk_lsn_map_v3.go prepareLockedV3 |
TestChunkMapV3FileStaysBoundedUnderSteadyCheckpoints (core/storage/chunkmap_bounded_v3_test.go); TestChunkMapExtentsV3TruncationKeepsAFallbackAtTheTail, TestChunkMapExtentsV3TruncationFaultKeepsTheSlotRoots, TestChunkMapExtentsV3RejectedPublicationsStayBounded, TestChunkMapExtentsV3ProofStalePreparesStayBounded, TestChunkMapExtentsV3StatsAfterReopen (core/storage/chunk_map_extents_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-001 |
Every v3 descriptor slot write after create's initial slot A goes through the one publisher, which writes the fallback slot with slotGen + 1 while holding descMu. |
M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.publish, descriptorPublisherV3.publishLockedCoreV3; create: core/storage/walstore_v3.go createWALStoreV3Configured |
TestDescriptorV3PublishAlternatesSlotsAndReopenSelectsNewest, TestDescriptorV3ConcurrentPublishersNeverRegress (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-LOCKORDER-001 |
Every v3 descriptor publication locks in the order syncMu, WALStore.mu, descMu, fileSyncMu and fsyncs the slot in that leaf. W publications hold no store lock during slot I/O; recovery, BASE transitions, checkpoint publication and rollovers hold WALStore.mu across it to exclude writers. |
M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.publishWithMapV3; core/storage/walstore.go WALStore.syncFile |
TestDescriptorV3LockOrderRecorder (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-MERGE-001 |
A v3 publication rebases onto the authoritative descriptor: W and CheckpointLSN are max-merged, and a change of identity, geometry or (outside a reset) nonce, a retainedTail regression, or a map root change without a higher map generation is refused. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go mergeDescriptorV3, mergeDescriptorV3Mode |
TestDescriptorV3MergeIsMonotonicAndRefusesForbiddenChanges, TestDescriptorV3ConcurrentPublishersNeverRegress (core/storage/descriptor_v3_test.go); TestResetV3OrdinaryPublicationsCannotChangeTheNonce (core/storage/reset_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-PUBLISH-BASE-EDGE-001 |
A v3 publication whose BASE state change is not a DESIGN 8.5 edge (none → installing, installing → installing under a new ID, installing → installed under the same ID and BaseLSN, installed → none) is refused; installed → installing is refused. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go baseTransitionAllowedV3 |
TestDescriptorV3BaseTransitionTable (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-FAIL-001 |
A failed slot write (full or partial) or slot fsync publishes nothing: the authoritative descriptor stays, the store fault is latched, the candidate stays pinned as uncertain, and every later publication, rollover and WAL reuse is refused until reopen. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedCoreV3, descriptorPublisherV3.rolloverIfPinned, descriptorPublisherV3.reuseFloorLocked |
TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing, TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate, TestDescriptorV3RolloverFsyncFailureKeepsTheFloorPinned (core/storage/descriptor_v3_test.go); TestCheckpointV3_AppendRolloverFaultRefusesHeldCandidate; also in core/storage/checkpoint_append_progress_v3_test.go |
— | STUB |
INV-WAL-V3-PUBLISH-LATCH-LEAF-001 |
A descriptor slot write error latches the store fault inside the fsync leaf, before fileSyncMu is released, so a store Sync queued on fileSyncMu cannot acknowledge through the uncertain slot. |
M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedCoreV3; core/storage/walstore.go WALStore.syncFile, noteFsyncFailure |
TestDescriptorV3QueuedStoreSyncCannotAckAfterSlotWriteError (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-SUCCESS-BOUNDARY-001 |
A store fault latched while a v3 publication is in flight makes that publication fail at its success boundary, without advancing the authoritative descriptor. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedCoreV3 |
TestDescriptorV3FaultLatchedDuringPublicationRefusesAtSuccessBoundary (core/storage/descriptor_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-PUBLISH-COUNTER-001 |
A v3 publication whose slotGen, W, CheckpointLSN, retainedTail, retainedHead, map generation, map coverage, BaseLSN or BaseCursor would exceed 2^64-2 is refused with ErrCounterExhausted before any write. |
M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go checkCountersV3; core/storage/superblock_v3.go nextSlotGenV3 |
TestDescriptorV3PublicationCounterExhaustion (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-ROLLOVER-001 |
When the fallback slot's retainedTail is below the selected slot's under the same nonce, a metadata-only rollover republishes the current descriptor unchanged into it, so the reuse floor rises to the selected tail. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.rolloverIfPinned |
TestDescriptorV3FullRingRolloverAdvancesTheFloorWithoutAnyChange (core/storage/descriptor_v3_test.go) |
— | STUB |
INV-WAL-V3-PUBLISH-NONCE-FLOOR-001 |
No v3 WAL reuse floor is computed across nonces: while the two descriptor slots carry different nonces there is no floor, and no WAL byte is reused. | M1 Serving (v3 descriptor publication) | core/storage/descriptor_v3.go descriptorPublisherV3.reuseFloor, descriptorPublisherV3.reuseFloorLocked |
TestDescriptorV3MixedNoncesNeverYieldAReuseFloor (core/storage/descriptor_v3_test.go); TestWALStoreV3HalfResetRefusesWritesUntilRecover (core/storage/reset_store_v3_test.go) |
— | ACTIVE |
INV-WAL-V3-W-001 |
A v3 Sync acknowledges a write only after an fsync that covers the write's WAL record has completed. | M1 write lifecycle: Appended → Synced (v3) | core/storage/walstore_v3.go WALStore.syncWALBatchV3, WALStore.syncWALBatchV3Internal; core/storage/walstore.go WALStore.Sync |
TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes (core/storage/walstore_v3_test.go) |
WALFormat composed model |
STUB |
INV-WAL-V3-W-MODE-C-001 |
In mode C (the default) a Sync batch publishes W = the previous batch's acknowledged W, and that publication's one fsync covers both the batch's WAL records and the slot. | M1 write lifecycle: Appended → Synced (v3) | core/storage/walstore_v3.go WALStore.syncWALBatchV3Internal |
TestWALStoreV3ModeCWindowIsExactlyTheNewestBatch (core/storage/walstore_v3_test.go) |
WALFormat composed model |
STUB |
INV-WAL-V3-W-MODE-A-001 |
In mode A a Sync batch fsyncs the WAL first and only then publishes the slot with W = H, the highest LSN appended when the batch began. | M1 write lifecycle: Appended → Synced (v3) | core/storage/walstore_v3.go WALStore.syncWALBatchV3Internal |
TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes, TestWALStoreV3SetWModeCrashCases (core/storage/walstore_v3_test.go) |
WALFormat composed model |
DORMANT |
INV-WAL-V3-W-RECOVERY-001 |
Recovery of a non-installing v3 descriptor fails with wal_corrupt when the contiguous LSN prefix R above max(CheckpointLSN, BaseLSN) is below W* = max(slot W, highest DurableLSN of a trusted record). |
M1 Recovering → Serving | RecoveryFailed | core/storage/recovery_v3.go decideRecoveryV3, contiguousPrefixV3, replayFloorV3; core/storage/walstore_v3.go WALStore.recoverV3 |
TestRecoveryV3Decision, TestRecoveryV3ContiguousPrefix (core/storage/recovery_v3_test.go); TestWALStoreV3TornUnsyncedTailIsNeverAFalseCorrupt (core/storage/walstore_v3_test.go) |
WALFormat composed model |
STUB |
INV-WAL-V3-W-REFRESH-001 |
When the slot W lags the acknowledged W, the flusher's idle refresh and SetWMode each publish W = the acknowledged W. |
M1 write lifecycle: Appended → Synced (v3) | core/storage/walstore_v3.go WALStore.refreshW, WALStore.SetWMode |
TestWALStoreV3RefreshAndSetWModeCloseTheWindow, TestWALStoreV3FlusherCycleRunsTheIdleRefresh, TestWALStoreV3FlusherEmptyCycleRunsTheIdleRefresh (core/storage/walstore_v3_test.go) |
— | STUB |
INV-WAL-V3-W-CHECKPOINT-CLAMP-001 |
A v3 checkpoint never exceeds the acknowledged W; entries the flusher wrote to the extent above the published checkpoint stay retry work, so a later Sync and flusher cycle advance the checkpoint and map coverage together. | M1 write lifecycle: InExtent → Checkpointed (v3) | core/storage/walstore_v3.go WALStore.persistCheckpointV3; core/storage/walstore_map_checkpoint_v3.go WALStore.persistOwnedMapCheckpointV3; core/storage/flusher.go flushOnceInternal |
TestWALStoreV3FlusherCheckpointIsClampedToTheAcknowledgedW, TestWALStoreV3FlusherWritesTheExtentButHoldsTheCheckpointUntilTheMap (core/storage/walstore_v3_test.go); TestWALStoreV3_FlushedProgressRetriesAfterLaterSync (core/storage/walstore_flushed_progress_v3_test.go) |
— | STUB |
INV-WAL-V3-W-SETWMODE-001 |
SetWMode first syncs every write admitted before it under the old mode, then publishes the new mode while holding the v3 leader role, so no Sync batch acknowledges under a mode other than the descriptor's. |
M1 write lifecycle: Appended → Synced (v3) | core/storage/walstore_v3.go WALStore.SetWMode, WALStore.syncWALBatchV3Internal |
TestWALStoreV3SetWModeWaitsForAHeldBatch, TestWALStoreV3NoBatchAcksUnderAStaleModeAfterSetWMode, TestWALStoreV3SetWModeCrashCases (core/storage/walstore_v3_test.go) |
— | DORMANT |
INV-WAL-V3-W-RECOVER-STRADDLE-001 |
No v3 W publication or Sync acknowledgement straddles a recovery: a Sync whose completion sees a changed recovery generation is refused, and recovery sets the acknowledged W to its recovered prefix R. | M1 Recovering → Serving | core/storage/walstore_v3.go WALStore.recoverV3, WALStore.refreshW, WALStore.syncWALBatchV3Internal; core/storage/walstore.go WALStore.syncWithPhases |
TestWALStoreV3SameOpenRecoverResetsTheAcknowledgedFrontier, TestWALStoreV3RecoverWaitsForABatchAckAndNothingRevivesTheCut, TestWALStoreV3OuterSyncCompletionIsRefusedAcrossARecovery, TestWALStoreV3RefreshDuringRecoverWaitsAndPublishesNothing (core/storage/walstore_v3_test.go) |
— | STUB |
INV-WAL-V3-FENCE-SLICE-001 |
The fence zero-writes its range in 1 MiB slices, aligned bytes O_DIRECT where allowed, each fdatasynced and only then counted as progress; a recovery skips the fence only when the same range was fenced and fsynced in this open by the same writer with no WAL write since. | M1 Recovering → Serving (v3) | core/storage/walstore_v3.go WALStore.fenceV3; core/storage/wal_io_v3.go writeCountV3 |
TestWALStoreV3FenceCountsAndSkipsARepeat, TestWALStoreV3SameOpenRecoveryAfterWritesStillFences, TestWALStoreV3FenceSlicesCountAfterEachSync, TestWALStoreV3FenceSliceFailureCountsOnlyCompletedSlices (core/storage/walstore_fence_slice_v3_test.go); TestWALStoreV3FenceSlicesAreSmallAndBypassThePageCache, TestWALStoreV3FenceSliceFlushFaultAfterADirectWriteIsNotCounted, TestWALStoreV3FenceNeverWritesAFileThatReplacedTheStorePath (core/storage/walstore_fence_direct_v3_test.go) |
WALFormat NoResurrection |
ACTIVE |
INV-WAL-V3-FENCE-001 |
Before any append after a v3 recovery, the store zeroes the logical WAL interval [E, floor + WALSize), floor being the both-slot same-nonce reuse floor, fsyncs it through the leaf, and only then publishes retainedHead = E. | M1 Recovering → Serving (v3) | core/storage/walstore_v3.go WALStore.recoverV3, WALStore.fenceV3; core/storage/recovery_v3.go fenceRangesV3 |
TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash, TestWALStoreV3NoFenceResurrectsInBothModes (core/storage/walstore_v3_test.go) |
WALFormat NoResurrection |
STUB |
INV-WAL-V3-FENCE-EXACT-001 |
The v3 drop fence changes only the bytes of [E, floor + WALSize) mapped modulo WALSize, in at most two ranges split at the physical wrap; no byte before E or outside the interval changes. | M1 Recovering → Serving (v3) | core/storage/recovery_v3.go fenceRangesV3; core/storage/walstore_v3.go WALStore.fenceV3 |
TestWALStoreV3FenceTouchesNoByteBeforeTheHead, TestWALStoreV3RecoversAHistoryEndingAtTheLastRepresentableCursor (core/storage/walstore_v3_test.go); TestRecoveryV3FenceRangesAreExact (core/storage/recovery_v3_test.go) |
— | STUB |
INV-WAL-V3-NO-RESURRECTION-001 |
A WAL record dropped by one v3 recovery is never replayed by a later recovery, also after a second crash. | M1 Recovering → Serving (v3) | core/storage/walstore_v3.go WALStore.recoverV3, WALStore.fenceV3; core/storage/wal_io_v3.go scanWALV3Accepted |
TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash, TestWALStoreV3NoFenceResurrectsInBothModes (core/storage/walstore_v3_test.go) |
WALFormat NoResurrection |
STUB |
INV-WAL-V3-RESET-001 |
A v3 nonce/position reset is refused with ErrResetNotPreserved, writing nothing, unless the dirty map is empty and CheckpointLSN is at least every appended LSN (and so equals the acknowledged W). |
M1 Serving → Serving (reset: no production caller; tests only) | core/storage/reset_v3.go WALStore.resetIncarnationV3, descriptorPublisherV3.resetIncarnationV3 |
TestResetV3RefusesWhileUncheckpointed, TestResetV3RetainedButCheckpointedBytesDoNotBlock (core/storage/reset_v3_test.go); TestWALStoreV3ResetRefusesUncheckpointedOrUnacknowledgedData (core/storage/reset_store_v3_test.go) |
WALFormat reset (r4.5, pending) |
DORMANT |
INV-WAL-V3-RESET-TWO-SLOT-001 |
A reset publishes a new nonzero nonce with an empty cursor space into one descriptor slot and then the other, and succeeds only after both publications. | M1 Serving → Serving (reset: no production caller; tests only) | core/storage/reset_v3.go descriptorPublisherV3.resetIncarnationV3; core/storage/descriptor_v3.go mergeDescriptorV3Mode |
TestResetV3PublishesBothSlotsAndOnlyThenHasAFloor, TestResetV3RefusesTheCurrentOrAZeroNonce (core/storage/reset_v3_test.go); TestWALStoreV3ResetPublishesBothSlotsAndWritesRecoverAcrossACrash (core/storage/reset_store_v3_test.go) |
WALFormat reset (r4.5, pending) |
DORMANT |
INV-WAL-V3-RESET-HALF-001 |
After a crash between a reset's two publications, open selects the new incarnation and binds no WAL writer, so every append is refused until Recover's head publication puts the new nonce in both slots. | M1 Serving → Serving (reset: no production caller; tests only) | core/storage/walstore_v3.go openWALStoreV3File, WALStore.recoverV3, WALStore.appendWriteV3; core/storage/reset_v3.go descriptorPublisherV3.halfResetV3 |
TestResetV3CrashOutcomes (core/storage/reset_v3_test.go); TestWALStoreV3ResetCrashOutcomes, TestWALStoreV3HalfResetRefusesWritesUntilRecover (core/storage/reset_store_v3_test.go) |
WALFormat reset (r4.5, pending) |
DORMANT |
INV-WAL-V3-RESET-INVARIANT-001 |
A reset leaves LSN allocation, W, CheckpointLSN and the map root unchanged. | M1 Serving → Serving (reset: no production caller; tests only) | core/storage/reset_v3.go descriptorPublisherV3.resetIncarnationV3, WALStore.resetIncarnationV3 |
TestResetV3PublishesBothSlotsAndOnlyThenHasAFloor (core/storage/reset_v3_test.go); TestWALStoreV3ResetPublishesBothSlotsAndWritesRecoverAcrossACrash (core/storage/reset_store_v3_test.go) |
— | DORMANT |
INV-WAL-V3-READ-REVALIDATE-001 |
A v3 read served from a dirty entry returns data only from a WAL record that validates whole (CRC, footer, type) and whose LBA and LSN match the resolving entry; on a mismatch it resolves again, so a reused WAL position never serves another block. | M1 Serving → Serving (reads; the reset has no production caller) | core/storage/walstore_v3.go WALStore.readDirtyV3Into, WALStore.readRecordIntoV3 |
TestWALStoreV3ReadParkedAcrossAResetAndOverwriteReturnsItsOwnBlock, TestWALStoreV3ReadMissRecheckParkedAcrossAResetReturnsItsOwnBlock (core/storage/reset_store_v3_test.go) |
— | STUB |
INV-WAL-V3-READ-DAMAGE-001 |
A v3 dirty read reports WAL damage only for a record that fails validation while the resolving entry and the recovery generation are the same before and after the attempt; a failed pread is reported as substrate I/O. | M1 Serving → Serving (reads; the reset has no production caller) | core/storage/walstore_v3.go WALStore.readDirtyV3Into |
TestWALStoreV3ReadOfADamagedLiveRecordIsAnIntegrityFault, TestWALStoreV3ReadAcrossARecoveryThatReusesTheSamePositionAndLSNIsNotDamage, TestWALStoreV3ReadIOErrorsAreSubstrateIONotWALIntegrity, TestWALStoreV3ReadAdmittedBetweenRecoverBumpAndClearIsNotDamage (core/storage/reset_store_v3_test.go) |
— | STUB |
INV-WAL-V3-RECOVER-GEN-001 |
The v3 recovery generation is incremented at the start and at the end of every recovery and every reset. | M1 Serving → Serving (recovery; the reset has no production caller) | core/storage/walstore_v3.go WALStore.recoverV3; core/storage/reset_v3.go WALStore.resetIncarnationV3 |
TestWALStoreV3ReadAdmittedBetweenRecoverBumpAndClearIsNotDamage (core/storage/reset_store_v3_test.go); TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime (core/storage/walstore_map_recovery_lifetime_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-001 |
A v3 BASE install begins only if BaseLSN is at least the acknowledged W (published or not yet), the CheckpointLSN and every appended LSN; otherwise the begin writes nothing and returns ErrInstallBaseUncovered, or ErrInstallSupersedeUncovered when it supersedes. |
M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.beginBaseInstallV3 |
TestBaseInstallV3BeginRefusesBelowW, TestBaseInstallV3BeginCoversTheAcknowledgedNotYetPublishedW, TestBaseInstallV3BeginRefusesBelowTheHighestAppendedLSN (core/storage/base_install_v3_test.go); TestBaseInstallV3CoveringSupersessionOverADamagedSuffix (core/storage/base_install_reopen_v3_test.go) |
WALFormat handle and BASE configs (pending) |
STUB |
INV-WAL-V3-BASE-BEGIN-SLOTS-001 |
Before the first BASE mutation of an install, both descriptor slots durably hold installing with its BaseLSN, BaseCursor = the writer head P at begin, and the new install ID. | M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.beginBaseInstallV3; core/storage/descriptor_v3.go descriptorPublisherV3.publish |
TestBaseInstallV3BeginPublishesInstallingIntoBothSlots (core/storage/base_install_v3_test.go) |
WALFormat handle and BASE configs (pending) |
STUB |
INV-WAL-V3-BASE-DRAIN-001 |
A BASE write or install-lane apply admitted through an install handle finishes before a later begin proceeds, and after that begin every handle of the earlier install epoch is refused with ErrInstallSuperseded. |
M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.beginBaseInstallV3, installHandleV3.admitV3, installHandleV3.admissibleV3 |
TestBaseInstallV3HeldOldWriteDrainsBeforeANewBegin, TestBaseInstallV3ParkedOldFrameIsRefusedAfterASupersession (core/storage/base_install_v3_test.go); tagged swblock_format_v3_test: TestReceiverV3HeldOldBaseWriteDrainsBeforeANewSession, TestReceiverV3ParkedOldFrameIsRefusedAfterANewSession (core/recovery/receiver_install_format_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-HANDLE-001 |
On a v3 store, BASE extent writes and install-lane applies go only through an install handle: WriteExtentDirect is refused, an ordinary replicated apply is refused while installing, and WriteBase needs installing under the handle's ID. |
M1 Serving → Installing → Serving | core/storage/base_install_v3.go installHandleV3.WriteBase, installHandleV3.admissibleV3, WALStore.applyEntryV3; core/storage/walstore.go WALStore.WriteExtentDirect |
TestNativeReplacementDirectExtentRefusedPreservesWAL (core/storage/legacy_replacement_v3_test.go); tagged swblock_format_v3_test: TestReceiverV3InstallThroughTheHandle (core/recovery/receiver_install_format_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-LANE-AFTER-DONE-001 |
An install-lane apply through a handle is admitted while the volume is installing under its ID or, once that handle's own complete succeeded, while installed under its ID or retired, until the next begin; otherwise it returns ErrInstallSuperseded. |
M1 Serving → Installing → Serving (install lane only with --recovery-mode=dual-lane) |
core/storage/base_install_v3.go installHandleV3.admissibleV3, installHandleV3.ApplyInstallEntry, installHandleV3.MarkBaseComplete |
TestBaseInstallV3CompletedHandleAppliesUntilTheNextBegin (core/storage/base_install_v3_test.go); tagged swblock_format_v3_test: TestReceiverV3WALAfterBaseDoneStillApplies, TestReceiverV3WALAfterBaseDoneSurvivesACrash (core/recovery/receiver_install_format_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-LANE-ORDER-001 |
A v3 install-lane apply at or below the highest appended LSN is a no-op if its LBA already holds a higher LSN and fails with ErrWALLSNOrder otherwise; one above max(CheckpointLSN, BaseLSN, highest appended) + 1 fails with ErrInstallLSNGap. |
M1 Serving → Installing → Serving (install lane only with --recovery-mode=dual-lane) |
core/storage/base_install_v3.go WALStore.applyEntryV3 |
TestBaseInstallV3ApplyInstallEntryOrderAndGap (core/storage/base_install_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-COMPLETE-001 |
Installed is published only by a complete for the current installing ID, and only after one fsync of the store file covering the BASE extent bytes and the install-lane suffix, followed by the metadata and chunk checkpoint barriers. | M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.markBaseCompleteV3 |
TestBaseInstallV3CompleteServesTheImageAcrossACrash (core/storage/base_install_v3_test.go); TestChunkLayerV3_BASEPresenceBarrierFailureKeepsInstalling (core/storage/chunk_base_v3_test.go); tagged swblock_format_v3_test: TestReceiverV3SupersededBaseDoneFailsWithoutAnAck (core/recovery/receiver_install_format_v3_test.go) |
WALFormat handle and BASE configs (pending) |
STUB |
INV-WAL-V3-BASE-COMPLETE-MAP-001 |
The installed publication sets retainedTail to at least BaseCursor and carries a fresh owned-map candidate in which every chunk a BASE write of the install touched is UNKNOWN. | M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.markBaseCompleteV3, installHandleV3.WriteBase, WALStore.markMapUnknownV3 |
TestBaseInstallV3CompletePersistsTheMapUnknownOfBaseWrites, TestBaseInstallV3CompleteServesTheImageAcrossACrash (core/storage/base_install_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-SUPERSEDED-001 |
After a successful complete, the open store neither serves nor flushes a WAL record appended before the begin, and recovery from an installed descriptor scans no record behind BaseCursor. | M1 Serving → Installing → Serving | core/storage/base_install_v3.go WALStore.markBaseCompleteV3; core/storage/wal_io_v3.go scanWALV3Accepted |
TestBaseInstallV3CompleteServesTheImageAcrossACrash (core/storage/base_install_v3_test.go); TestWALIOV3_InstalledScanBeginsAtMaxTail (core/storage/wal_io_v3_test.go) |
— | STUB |
INV-WAL-V3-BASE-RETIRE-001 |
A v3 descriptor goes from installed to none only when CheckpointLSN ≥ BaseLSN and both the newly written slot and the slot it leaves as fallback carry retainedTail ≥ BaseCursor; installing never goes to none. | M1 Serving → Installing → Serving | core/storage/descriptor_v3.go retireBaseV3, baseTransitionAllowedV3 |
TestBaseInstallV3RetiresOnlyOnceTheCheckpointCoversBaseLSN, TestBaseInstallV3InstallingToNoneIsRefused (core/storage/base_install_v3_test.go); TestDescriptorV3BaseTransitionTable (core/storage/descriptor_v3_test.go) |
WALFormat handle and BASE configs (pending) |
STUB |
INV-WAL-V3-BASE-RETIRE-GATE-001 |
On a store whose provider deferred BASE retirement at open, retirement of an installed BASE waits for this open's attach commit. | M1 Serving → Installing → Serving (deferral only with --durable-impl=walstore-chunk) |
core/storage/base_install_v3.go WALStore.DeferBaseRetirementV3, WALStore.CommitChunkAttachV3, WALStore.AllowBaseRetirementV3; core/storage/chunk_base_v3.go chunkLayerImpl.holdBaseTransitionV3; core/storage/descriptor_v3.go descriptorPublisherV3.publishLockedCoreV3; core/frontend/durable/provider.go openOrCreate |
TestBaseInstallV3CommitChunkAttach, TestBaseInstallV3RetirementWaitsForTheGate (core/storage/base_install_v3_test.go); TestDurableProviderV3_DefersBASERetirementUntilLocalPresence (core/frontend/durable/provider_format_v3_base_test.go) |
— | DORMANT |
INV-WAL-V3-INSTALL-ACK-001 |
While a v3 volume is installing, the logical Sync returns exactly (0, ErrBaseInstalling), runs no batch and acknowledges no new W; this is checked again at its completion. |
M1 Installing | core/storage/walstore.go WALStore.Sync, WALStore.syncWithPhases |
TestInstallLogV3SyncIsGatedWhileInstalling (core/storage/install_log_v3_test.go) |
WALFormat install-log ack |
STUB |
INV-WAL-V3-INSTALL-LOG-ACK-001 |
SyncInstallLog(id) returns H, the highest LSN appended when it starts, only after a WAL fsync and then a descriptor publication of W = max(W, H) with BaseState still installing: always mode A. |
M1 Installing (only with --recovery-mode=dual-lane) |
core/storage/install_log_v3.go WALStore.SyncInstallLog |
TestInstallLogV3IsModeAAndSurvivesACrash (core/storage/install_log_v3_test.go) |
WALFormat install-log ack |
STUB |
INV-WAL-V3-INSTALL-LOG-REFUSE-001 |
Under installMu shared, SyncInstallLog is refused with ErrNotInstalling outside an install and with ErrInstallIDMismatch for another install ID. |
M1 Installing (only with --recovery-mode=dual-lane) |
core/storage/install_log_v3.go WALStore.SyncInstallLog, installLogTargetV3 |
TestInstallLogV3Refusals (core/storage/install_log_v3_test.go) |
— | STUB |
INV-WAL-V3-INSTALL-LOG-FAULT-001 |
SyncInstallLog acknowledges nothing when a store fault has latched by its final check under WALStore.mu. |
M1 Installing (only with --recovery-mode=dual-lane) |
core/storage/install_log_v3.go WALStore.SyncInstallLog |
TestInstallLogV3AFaultLatchedBeforeTheAckRefusesIt (core/storage/install_log_v3_test.go) |
— | STUB |
INV-WAL-V3-INSTALL-LOG-SCOPE-001 |
SyncInstallLog is on the narrow InstallLogSyncer, not on LogicalStorage, and no package other than core/storage and core/recovery names InstallLogSyncer. |
M1 Installing (only with --recovery-mode=dual-lane) |
core/storage/install_log_v3.go InstallLogSyncer |
TestInstallLogSyncerIsReceiverOnly (core/recovery/install_log_boundary_test.go) |
— | STUB |
INV-WAL-V3-INSTALL-LOG-RECEIVER-001 |
The rebuild receiver's durable progress ack is SyncInstallLog(installID) until its own session's completion, and the ordinary Sync after it. |
M1 Installing (only with --recovery-mode=dual-lane) |
core/recovery/receiver.go Receiver.sendAck |
tagged swblock_format_v3_test: TestReceiverV3ProgressAckIsTheInstallLog (core/recovery/receiver_install_format_v3_test.go) |
— | STUB |
INV-WAL-V3-BATCH-001 |
A v3 WriteBatch of n > 1 blocks is one record (type 0x04) with LSNs first..first+n-1 under one CRC32C, so a crash keeps all n blocks or none. |
M1 Serving | core/storage/walstore_v3.go WALStore.writeBatchV3Locked; core/storage/walstore.go WALStore.WriteBatch |
TestWALStoreV3BatchRoundTripAcrossACrash, TestWALStoreV3TornBatchIsAllOrNothing, TestWALStoreV3CrashMidBatchServesNoneOfIt (core/storage/walstore_batch_v3_test.go) |
WALFormat batch records |
STUB |
INV-WAL-V3-BATCH-READERS-001 |
Each v3 batch block's dirty entry names its data offset in the record, and every reader (store read, flusher, recovery replay, install-path replays, offline reader) uses the block only from a whole valid record whose block has that LBA, LSN and offset. | M1 Serving | core/storage/walstore_v3.go WALStore.readRecordIntoV3, readWholeRecordV3, blockOfRecordV3, flusher.readDirtyRecordV3, WALStore.replayRecordV3; core/storage/walstore_readonly_v3.go WALStoreReader.readV3 |
TestWALStoreV3BatchFlushesEveryBlock, TestWALStoreV3ReadOnlyReaderServesBatchBlocks, TestWALStoreV3BatchRoundTripAcrossACrash (core/storage/walstore_batch_v3_test.go) |
— | STUB |
INV-WAL-V3-BATCH-ACK-001 |
A Sync that covers a v3 batch returns a frontier of at least the batch's last LSN. | M1 Serving | core/storage/walstore_v3.go WALStore.writeBatchV3Locked, WALStore.advanceAfterAppendV3 |
TestWALStoreV3BatchAckCoversItsLastLSN (core/storage/walstore_batch_v3_test.go) |
— | STUB |
INV-WAL-V3-BATCH-MAP-001 |
The owned map records every block of a v3 batch at its own LSN. | M1 Serving | core/storage/walstore_v3.go WALStore.writeBatchV3Locked; core/storage/walstore_map_checkpoint_v3.go WALStore.recordMapWriteV3 |
TestWALStoreV3BatchRecordsMapCoverage (core/storage/walstore_batch_v3_test.go) |
— | STUB |
INV-FE-FUA-SYNC-001 |
A FUA write completes only after Sync succeeds. |
M1 Serving (frontend) | core/frontend/nvme/io.go IOHandler.write; core/frontend/ublk/dispatch.go handler.serve |
TestSessionWriteBudgetDeadlineIsRetryableIncludingFUA (expiry and joined physical-fault wire status); TestNVMeWriteFUACompletion (core/frontend/nvme/fua_test.go); TestDispatch_WriteFUASyncsBeforeCompleting (core/frontend/ublk/dispatch_test.go); also in core/frontend/nvme/write_command_budget_test.go |
— | ACTIVE |
INV-FE-FLUSH-SYNC-001 |
A flush is a Sync of the backend, and a failed Sync fails the command instead of acknowledging it. The NVMe session records its mapped status and backend reason in the target log. |
M1 Serving (frontend) | core/frontend/nvme/io.go IOHandler.Handle; core/frontend/ublk/dispatch.go handler.serve |
TestT3b_NVMe_Flush_DispatchesToBackend (core/frontend/nvme/t3b_flush_test.go); TestSessionFlushLogsBackendReason (core/frontend/nvme/flush_error_log_test.go); TestDispatch_FlushSyncs, TestDispatch_BackendFailuresAreReportedNotAcknowledged (core/frontend/ublk/dispatch_test.go) |
— | ACTIVE |
INV-FE-LINEAGE-GATE-001 |
Every Read, Write and Sync re-checks {volume, replica, epoch, endpoint version} and health against the current projection; any drift returns ErrStalePrimary. The volume-ID comparison is code reading: no cited test varies the volume ID. |
M3 Primary → Supporting | Excluded (I/O side) | core/frontend/durable/storage_adapter.go gate, lineageCheck |
TestT3a_StorageBackend_FenceCheck_Epoch, TestT3a_StorageBackend_FenceCheck_EV, TestT3a_StorageBackend_FenceCheck_Replica, TestT3a_StorageBackend_FenceCheck_Healthy (core/frontend/durable/storage_adapter_test.go); TestG8A_SupersedeFact_FencesOldPrimaryDurableBackend (core/host/volume/g8a_stale_fence_test.go) |
— | ACTIVE |
Notes:
-
INV-AUTH-UNCERTAIN-001detail: After a failed authority write for a workspace volume, the publisher refuses further authority changes for that volume until it restarts and reloads. A failed lease extension is such a write. Renewals that would issue a new or extended (non-revoking) grant for the volume are refused too: the renewal path reads uncertainty from the lease view (INV-LEASE-VIEW-001) instead of meeting it inpersistWorkspaceLocked. A Revoking lease still gets its bounded drain reply, min(horizon, deadline), never extended, as before. Move error classification reads the per-volume uncertainty latch under the publisher lock at reply time, covering RPC preflight, HEAD reads and local admission as well as the publisher. Only the actual request context proves caller end; a dependency timeout/cancellation with a live request is UNKNOWN too. The unknown outcome overrides the refusal audit entry. It adds no authority write and does not clear uncertainty. -
INV-WAL-V3-LSN-ORDER-001: the writer gate prevents an out-of-order physical chain whose dropped unacked middle record could later resurrect. Raw scanner/recovery integrity verdicts and the v3 ApplyEntry superseded-no-op/refusal policy are separate caller obligations. Legacy ApplyEntry and production v2 behavior are unchanged. -
INV-WAL-V3-FLUSH-LIFETIME-001: Capture recoverGen under store.mu with the dirty snapshot, before WAL materialization/extent I/O. Recheck the original generation under syncMu before either mapped or historical dark checkpoint publication. Under store.mu, recheck again before local tail progress and LSN-only compare/delete; Recover uses the same store lock at both boundaries. This adds no new lock or I/O under a publication lock. The pre-proof held control materializes unacknowledged A2, damages only that WAL suffix, Recover keeps W1, then reuses the same LBA/offset/LSN for acknowledged B2. Old publication must refuse, retain B, and a fresh retry must put B in the physical extent before crash-style reopen verifies exact bytes. -
INV-WAL-V3-MAP-PUBLISH-001: The open/quiesced bind validates the selected and every valid fallback map root/page dependency before installing a proof domain, with a slot snapshot recheck after I/O. A corrupt fallback refuses binding even if the selected map is intact; validation writes no slots and preserves the prior domain on failure. Production create and open run this bind (openWALStoreV3File); capture does not. Real Recover START and END invalidation is wired and controlled on success and WAL-integrity failure, with a durable map manually bound to the actual store publisher. The map-requiring actual-store opener (production open) now loads its owned sidecar and validates both slots before workers start, binds a fresh proof domain, and Close releases the map. The explicit mapped creator persists an all-UNKNOWN initial map before publishing its first slot. Earlier unmapped row5 fixtures have a separately named test-only opt-out, not a production selector. Owned-map stores now prepare a typed snapshot/proof outside publication locks and publish real checkpoint coverage through publishMapV3 under syncMu. The existing map mutex reserves candidate generations; transaction failures latch the whole store before returning. The entry snapshot may already contain LSNs above cp or W from pre-snapshot appends; max-LSN entries remain monotone and idempotent under replay. Strictly newer ordered WAL appends update per-chunk max LSN without invalidating an older checkpoint-prefix proof: their retained suffix is replayed before recovery serves. BASE writes, capture UNKNOWN clearing and lifecycle boundaries still invalidate proofs. A reused ordered LSN below a speculative retained map maximum can set UNKNOWN without invalidating the prefix; the high max and replayed retained suffix remain conservative. Recover rebuilds the volatile cache from the selected root and retained WAL prefix. Metadata/chunk callbacks precede map and descriptor durability. The actual chunk capture (production with--durable-impl=walstore-chunk) now also selects owned-map UNKNOWN/max-LSN candidates after checkpoint, samples chunk mutation tokens under its barrier, and clears UNKNOWN only after definite HEAD publication with unchanged tokens. Its resulting map snapshot is published through the same proof/coverage checks; failed or unresolved cuts clear nothing, and failed local map publication keeps disk UNKNOWN conservative. Replaying an already checkpoint-covered record does not invent a fresh logical map mutation. A mismatched chunk geometry is refused before remote contact. Eviction uses the same owned-map/WAL dirt predicate, so checkpointed data awaiting capture cannot be replaced by a fill from an older HEAD. Normal impl3 capture attachment/checkpoint/status no longer loads, saves, resets or requires the legacy bitmap; v2 retains it. A provided legacy object is ignored. The immutable per-open proof discriminator permits status alongside Close without reading its mutable cleanup pointer. Legacy BASE header mutations remain refused; the descriptor install protocol now uses the chunk transition drain (no production caller: a BASE install comes only from replication, whichwalstore-chunkrefuses) and permits completed BASE attachment (INV-WAL-V3-CHUNK-BASE-001). A private test-only provider factory now drives the actual DurableProvider/StorageBackend create, recover, write, Sync, flusher, capture and local reopen paths on mapped v3 without a legacy bitmap. The cross-package constructor wrappers exist only under swblock_format_v3_test; the normal provider selector now creates and opens mapped v3 too (INV-WAL-V3-ACTIVATION-001), and a missing owned map refuses without caching a backend. SeedChunkFrontier now dispatches to the shared v3 checkpoint publisher (row9c), without waiting on the committer under store.mu. The real provider invalid-frontier control proves preparation failure claims no HEAD and leaves the backend nonoperational. Row12a now removes the provider refusal and exercises the actual mapped FreshFromHead restore through the row9 single-publisher seed: seed/rebase precedes takeover CAS, a committed claim with a lost response is resolved by exact reread, inherited LSNs are not reused, immutable chunks fill lazily, and later capture/local reopen preserve exact bytes. An invalid inherited frontier refuses without claiming HEAD. Production create and open select mapped v3 (INV-WAL-V3-ACTIVATION-001); the BASE caller and readonly/status controls have dedicated rows below. WAL tail reclamation is wired (INV-WAL-V3-RECLAIM-001family). Existing lifecycle tests drive invalidation primitives; only the two explicitly named real-store controls exercise actual Recover, ; automatic checkpoint and tagged provider controls above separately cover those real callers. The owner serializes lifecycle transitions with publication using its existing lifecycle admission. No new lock or callback is taken under descMu; validation uses immutable candidate fields and atomic proof loads. -
INV-WAL-V3-MAP-BYTES-001: row 6 prepares durable pinned tuples only. Root/merged-descriptor coverage, mutation proofs and real chunk/provider replacement are row 7; no serving or checkpoint advance is authorized by the codec/store. Sidecar extents are reused only after neither slot nor a pending or uncertain candidate references them; seechunk_map_extents_v3.goand its tests. -
INV-WAL-CHECKPOINT-SNAPSHOT-001: The SIGKILL test is Linux only. -
INV-FE-FLUSH-SYNC-001: NVMe/TCP also asserts failed-Sync status and reason logging through the actual session dispatch, and success produces no failure log. -
INV-WAL-V3-RESET-001: Format bump v3, plan row 8 (DESIGN 8.6). Dark: no production path calls the reset, and it must not be activated before the reset model (r4.5) passes. The precondition is CheckpointLSN >= W rather than an empty retained range: retained old-incarnation bytes at or below the checkpoint are preserved in the extent. The map root is unchanged by a reset, so no map page is retired. -
INV-WAL-V3-BASE-001: Format bump v3, plan row 9a (DESIGN r17.3.1 sections 8.1, 8.2, 8.4, 8.5, 8.7). Production reaches it through both callers below: the legacy single-lane caller by default, the dual-laneReceiverwith--recovery-mode=dual-lane. Row 9b makes the seamBaseInstallPreparer.BeginBaseInstall(baseLSN, installID) (InstallHandle, error): the dual-laneReceiverbegins at SessionStart (BaseLSN = FromLSN, a fresh random ID) and itsRebuildSessionwrites, applies and completes only through the handle, propagating theMarkBaseCompleteerror; stores without the seam keep their exact pre-seam behaviour through the lazy legacy handle (the legacyBaseStager.BeginBaseStagestaging remains as an interface; parallel-walstore, its one shipped implementation, is removed). Since row 10b the legacy single-lane caller (core/transport/replica.go) is on the handle too: the first admittedMsgRebuildBlock(or an empty rebuild'sMsgRebuildDone) begins one install per connection at the lineage's frontier hint under a fresh random ID, blocks go throughWriteBase, a different hint on the connection is refused, and done completes and then Syncs, closing the connection with noMsgBarrierRespwhen either fails; a reconnect is a superseding install under the coverage rule (tagged controls incore/transport/replica_install_format_v3_test.go). A v3 begin with an attached chunk layer that has no BASE transition hook is refused (errV3NotYet), writing nothing (TestBaseInstallV3BeginRefusesWithAnUnsupportedAttachedChunkLayer; a supported layer is drained as inINV-WAL-V3-CHUNK-BASE-001); since row 9c the v3SeedChunkFrontierpublishes CheckpointLSN = W = map coverage = lsn through the one checkpoint publication (publishCheckpointV3: data fsync, metadata and chunk barriers, owned-map candidate, the sole slot publisher under syncMu with the lifetime check), moves the volatile frontier only after it, publishes nothing on failure, and refuses local writes, an install, an attached layer or a store without an owned map; the provider's former refusal of a HEAD restore onto a v3 store is gone since row 12a (see theINV-WAL-V3-MAP-PUBLISH-001note); since row 11a an installing physical reopen (an installing ID this open did not begin) keeps its recovered bounds (E, R, intact or damaged) without fencing, publishing or admitting; a same-open Recover of this open's live install records none, so its still-valid handle cannot append past a cached cut that a resume would fence from; it republishes the live install's trusted records in the dirty map and keeps the volatile map coverage, or latches the store when the recovered cut is short of the live writer, and a covering superseding begin after it fences [E, floor + WALSize) and fsyncs before its two-slot installing publication, anchors at P = max(E, the persisted retainedHead) without lowering retainedHead, and restarts the writer at P (forward only); since row 11b the same-ID resume after a reopen (store level; no current caller resumes, both receivers begin fresh IDs) runs underinstallMuexclusive and appends nothing until the trusted-through-W check (intact suffix and E >= the persisted retainedHead), the fence of [E, floor + WALSize) with fsync and a retainedHead = E publication all held, refusing withErrInstallSuffixDamagedand writing nothing otherwise; the writer continues at E and the recovered install-lane records are replayed. A begin while installed is refused until retirement (8.5 has no installed -> installing edge). -
INV-WAL-V3-MIGRATE-001: Archived with the converter and its legacy fixtures; v2 inputs refuse open without mutation. -
INV-WAL-V3-W-001,INV-WAL-V3-FENCE-001: Format bump v3, plan rows 5 and 5b (DESIGN r15 sections 6.1 to 6.6). Since 5b the v3 format runs inside the realWALStore, through the shared committer, dirty map, flusher and leaf. Since activation (row 12b) production create and open (CreateWALStoreWithOptions,OpenWALStoreWithOptions) reach it. Without the row-7 map candidate (unmapped test fixtures only) the v3 checkpoint and tail do not advance.INV-WAL-V3-W-001stays a STUB for the reason in the format v3 status note below;INV-WAL-V3-FENCE-001is still a STUB although the path is active, its promotion pending a per-row check of its tests. The test "crash" closes the file without further writes, so the slot-before-records reordering that mode C's lagged W guards against is covered by the composed model, not by these tests. Installing recovery is row 11. -
INV-WAL-V3-PUBLISH-001: Format bump v3, plan row 3 (DESIGN r15 sections 4, 5 and 5.1). The v3 store is wired in (rows 4 and 5) and activated (row 12b); the row stays a STUB for the reason in the format v3 status note below. The v2 checkpoint path (persistCheckpointReleasing) is retired. The map coverage predicates against the root are added by row 7, and the conditions on BASE edges by rows 9 to 11. -
INV-WAL-V3-DESCRIPTOR-001: Format bump v3, plan row 1 (DESIGN r15 section 2). Since the activation commit (plan row 12b) production walstore open and create reach the v3 codec; the row stays a STUB for the reason in the format v3 status note below. The map-dependency checks (root and pages present and hash-valid) are added by plan row 7. The tests decode vectors from an independent generator (core/storage/testdata/format_v3/slot/gen_slot_vectors.py). -
Format v3 status: the rows from
INV-WAL-V3-DESCRIPTOR-001toINV-WAL-V3-W-001that wereSTUB(production reaches each by default) were checked clause by clause. A row isACTIVEwhen a test in the default suite (no build tag) asserts every clause of its statement. The others staySTUB; the clause without an asserting test is in brackets.- No test asserts the clause:
INV-WAL-V3-DESCRIPTOR-001(geometry under checked arithmetic),INV-WAL-V3-DESCRIPTOR-BASE-001(mapCoveredCheckpoint ≤ W),INV-WAL-V3-RECORD-REFUSE-001(before allocating a payload),INV-WAL-V3-OWNER-001(read-only open takes the same exclusive lock; no byte changes under contention),INV-WAL-V3-RECLAIM-001(never past BaseCursor while installing),INV-WAL-V3-RECLAIM-INDEX-001(only trusted records of the kept scan),INV-WAL-V3-RECLAIM-PUBLISH-001(the five fields in one slot publication),INV-WAL-V3-CATCHUP-REVALIDATE-001(unchanged nonce and install epoch),INV-WAL-V3-FLUSH-LIFETIME-001(a cycle spanning a reset),INV-WAL-V3-MAP-PUBLISH-ROLLOVER-001(a rollover keeps the root),INV-WAL-V3-MAP-VALIDATE-001(file bounds; no entry returned on refusal),INV-WAL-V3-MAP-PERSIST-FAIL-001(a Stat error latches nothing),INV-WAL-V3-MAP-TRUNCATE-001(the four-times threshold; truncation to the end of the highest live page),INV-WAL-V3-PUBLISH-001(every slot write goes through the publisher),INV-WAL-V3-PUBLISH-LOCKORDER-001(the callers that holdWALStore.muacross slot I/O),INV-WAL-V3-PUBLISH-BASE-EDGE-001(installing → installed with another BaseLSN),INV-WAL-V3-PUBLISH-FAIL-001(after a failed slot fsync: latch, pin, rollover and reuse refusal),INV-WAL-V3-PUBLISH-LATCH-LEAF-001(a real store Sync; the test uses a stand-in leaf),INV-WAL-V3-PUBLISH-COUNTER-001(slotGen, retainedTail, map coverage, BaseLSN, BaseCursor),INV-WAL-V3-PUBLISH-ROLLOVER-001(written into the fallback slot, otherwise unchanged). - The tests only exercise the path:
INV-WAL-V3-SCAN-BINDING-001(nonce and cursor checked before Length or count),INV-WAL-V3-SCAN-STOP-001(no search inside a payload),INV-WAL-V3-RECLAIM-EXCL-001(the test writes after the window),INV-WAL-V3-W-001(mode C),INV-WAL-V3-MAP-PUBLISH-REPLACE-001(coverage not below the bound map's; same sidecar). - Asserted only by tests under build tag
swblock_format_v3_test:INV-WAL-V3-CATCHUP-001(an empty request at the head),INV-WAL-V3-CATCHUP-BASE-001.
- No test asserts the clause:
-
INV-WAL-V3-ACTIVATION-001family: writable and read-only open validate the owned-map dependencies of the selected slot and of every valid fallback slot before the store or reader is returned, and refuse a valid legacy superblock withErrUnsupportedLegacyFormatwithout changing a byte: see M1 — → Opened (testsTestWALStoreV3_OpenRequiresBothMapGenerations,TestWALStoreV3_ReadOnlyRefusesIncompleteOrCorruptDependencieswith its fallback-page case,TestNativeReplacementLegacyBytesRefusedWithoutMutation). A zero chunk geometry option becomes 1024 blocks per chunk, so every public create is mapped; create persists an all-UNKNOWN initial map before its first slot. -
INV-WAL-V3-DESCRIPTOR-CONFLICT-001: the old statement said the two slots must not disagree on identity; of the identity fields, open compares the UUID, together with the geometry. The next publication's slotGen comes fromnextSlotGenV3(INV-WAL-V3-PUBLISH-COUNTER-001).TestWALStoreV3CloseKeepsTheNewestSlotAAndItsWis a store-level control of the selection: a v3Closewrites no slot, and reopen selects the newest one. -
INV-WAL-V3-RECORD-001: codec success alone is not nonce, cursor or lap replay admission; that belongs to the scanner (INV-WAL-V3-SCAN-BINDING-001). -
INV-WAL-V3-ADMISSION-001family: at every store call the store derives its own admission deadline from the command deadline, min(command deadline, now +admissionTimeout) less a reserve of min(1 s, a quarter of the time left), so the append and its completion keep headroom; the 4 s local admission timeout restarts for each adapter batch, while the command deadline does not. The budget is cooperative: it never interrupts a mutex wait or a WAL write already started, and issued WAL I/O keeps its existing lifecycle ownership. Keeping a committed prefix's storage error in the classified set means a later observer deadline cannot turn a physical fault into a retryable one; on NVMe a retryable deadline is Namespace Not Ready, DNR=0. The WAL-pressure wait and its locks are in Part D. The burst tests are liveness controls: they would stall if a waiter held a lock the flusher needs, but they do not assert the lock state. -
INV-WAL-V3-RECLAIM-001family: reuse still needs both valid same-nonce slot tails: see M1 Serving → Serving (checkpoint) andINV-WAL-V3-PUBLISH-NONCE-FLOOR-001. A catch-up scan revalidates the tail and checkpoint before it delivers its buffered entries (INV-WAL-V3-CATCHUP-REVALIDATE-001). Writer exclusion until the rollover and the dirty retirement end means no write reuses a released position while a dirty entry still names it. The flusher also caps the checkpoint at the lowest active catch-up pin (persistOwnedMapCheckpointV3). An installing reopen indexes record boundaries without restoring or rewinding the writer's cursor or LSN (rememberReclaimScanV3). -
INV-WAL-V3-CATCHUP-001family: the revalidation closes begin/complete/retire ABA, so a superseded prefix is never published; a source that began installing during the scan refuses withErrBaseInstalling, and any other change makes it scan again. A request at or below CheckpointLSN minus the retention window also fails withWALRecycled. A scan holds no store lock across its callbacks and emits all of its entries or none. -
INV-WAL-V3-BINDING-001family: a writer whose pwrite failed refuses every later append, and the store latches the fault: see M1 Serving → FaultLatched and FaultLatched → FaultLatched (testTestWALIOV3_FloorAndPwriteFailureRefuse). A scan result (walScanResultV3) is a typed read-only result, never an acknowledgement or serving permission; recovery decides from it (INV-WAL-V3-W-RECOVERY-001). The scan start for a BASE descriptor is inINV-WAL-V3-BASE-SUPERSEDED-001. -
INV-WAL-V3-MAP-PUBLISH-001family: binding validates the map root and pages of the selected slot and of every valid fallback slot before serving: see M1 — → Opened (testsTestMapPublicationV3_BindValidatesBothSlotDependencies,TestWALStoreV3_OpenRequiresBothMapGenerations,TestWALStoreV3_MappedCreateOpenOwnsMap,TestDurableProviderV3_MissingMapRefusesBeforeBackend). Recover invalidates the map proof epoch at its start and at its end, on success and on failure: see M1 Recovering → Serving (testsTestWALStoreV3_RealRecoverInvalidatesMapProofAtStartAndEnd,TestWALStoreV3_FailedRecoverInvalidatesMapProofAtBothBoundaries,TestWALStoreV3_AutomaticMapRecoverRebuildsCoverage). A candidate whose slot publication outcome is unknown stays pinned until reopen (INV-WAL-V3-MAP-EXTENT-REUSE-001,INV-WAL-V3-PUBLISH-FAIL-001). Controls of the capture, seed and provider callers described in the next note, not of the publication rule itself:TestDurableProviderV3_InvalidHEADFrontierRefusesBeforeClaim,TestDurableProviderV3_HEADRestoreAfterLostClaimResponse,TestDurableProviderV3_MappedCheckpointCaptureAndReopen,TestDurableProviderV3_DefaultSelectorCreatesV3,TestChunkLayerV3_MapOnlyCaptureNeedsNoLegacyBitmap,TestChunkLayerV3_IgnoresProvidedLegacyBitmap,TestChunkLayerV3_MapOnlyFreshZeroHEADPreservesLocalWrites,TestChunkLayerV3_MapOnlyRefusesLegacyBASEHeaderMutation,TestChunkLayerV3_MapStatusConcurrentClose,TestChunkLayerV3_CaptureUsesOwnedMapAfterCheckpoint,TestChunkLayerV3_MaxLSNSelectsAfterReopenWithCleanLegacyBitmap,TestChunkLayerV3_ChangedCaptureTokenKeepsUNKNOWN,TestChunkLayerV3_UnsettledCaptureNeverClearsUNKNOWN,TestChunkLayerV3_RefusesMapGeometryBeforeRemote,TestChunkLayerV3_CheckpointProgressUnderContinuousAppends,TestChunkLayerV3_CheckpointProgressAtWALPressure,TestCheckpointV3_NewerBatchReplaysAfterPreparedPrefix,TestCheckpointV3_LazyFillDoesNotInvalidatePreparedPrefix,TestCheckpointV3_NoFlushPressureWithRealPin,TestCheckpointV3_SpeculativeMaximumAfterDroppedSuffix,TestCheckpointV3_HeldHydrationWithLocalWriteAndFlush;TestDurableProviderV3_HEADRestorePreservesRemoteImageAndNextLSNis also a control ofINV-WAL-V3-ACTIVATION-PROVIDER-001. -
INV-WAL-V3-MAP-BYTES-001family: root and pages are addressed by offset and SHA-256; with 4096-byte alignment, distinct page offsets that do not overlap the root rule out a partial overlap. Truncation keeps a root the fallback slot names readable. -
INV-WAL-V3-MAP-PRIOR-LIVE-001: every root preparer (the flusher's checkpoint, the chunk layer's captured-map publication, BASE complete) goes through the guard, but the harmful pair without it is narrower: a stale flusher prepare, a chunk-layer publication in its gap that cleared no UNKNOWN entry (so the proof does not move), then any publication that releases the flusher's prior. BASE complete is harmless on both sides (as the intervening publisher it invalidates the proof under the same lock; as the stale preparer it is refused by coverage). No other allocation is needed for the damage: the stale prepare's own new page or root lands on the freed extent (lowest free extent first). The outage it caused was not one open: later roots reuse the bad page reference for the unchanged page, so the volume stays unopenable until two root publications have rewritten that page, and a failing fallback root refuses open too. A store damaged before the fix is not cured by a restart; there is no offline rebuild of the owned map from the WAL and the extent, so recovery is a replica rebuild or a HEAD restore onto a fresh store (an offline map rebuild is the post-RC tool this failure would need). Modeled: bounded simulation reaches the bad state in 18 steps without the guard and never with it; each of the three facts (the check in the snapshot's liveMu section, prepares under the map lock, the candidate pinning its reused references) fails as a mutant; exhaustive model checking is pending. -
INV-WAL-V3-PUBLISH-001family: create writes the initial descriptor into slot A directly (createWALStoreV3Configured) before the store opens; every later slot write is the publisher's. The lock graph is metadata callbacks, thenWALStore.mu(snapshot only), thendescMu, thenfileSyncMu(the leaf, insidesyncFile). An fsync error is latched by the leaf itself (noteFsyncFailure); the publisher latches a slot write error because the leaf does not. The success-boundary refusal is the #172 rule.TestCheckpointV3_AppendRolloverFaultRefusesHeldCandidatedrives the failure rule through an append's rollover. -
INV-WAL-V3-W-001family: because mode C's slot carries the previous batch's W, the acknowledged writes above the slot W are at most those of the newest acknowledged batch, which is unprotected only against media corruption before the next Sync or the idle refresh (INV-WAL-V3-W-REFRESH-001; testTestWALStoreV3ModeCWindowIsExactlyTheNewestBatch). For an installing descriptor, recovery reports a short prefix (R < W*) or a scan error asErrBaseIncomplete, notwal_corrupt(installingErrorV3; testTestWALStoreV3InstallingScanErrorIsTypedNotReadycovers the scan error). A Sync acknowledges nothing when a store fault has latched by its final check (INV-WAL-FSYNC-STICKY-001). -
INV-WAL-V3-FENCE-001: with mixed slot nonces (a reset stopped between its two publications) the fence interval is empty, because old-nonce bytes fail the scanner's nonce binding (fenceRangesV3). A fence write error latches the store inside the leaf. -
INV-WAL-V3-RESET-001family: an empty dirty map means no entry names an old-incarnation WAL position. Between the two reset publications the slots carry different nonces, so there is no reuse floor (INV-WAL-V3-PUBLISH-NONCE-FLOOR-001); only a reset changes the nonce (INV-WAL-V3-PUBLISH-MERGE-001). A dirty read holds no lock across its WAL read, so the position it resolved may be reused (after a reset the cursor space restarts at 0); LSN allocation runs on across a reset, so a matching LBA and LSN identify the resolved write and no nonce is checked. A reset is also refused during a BASE install and while a previous reset is half published. A BASE resume and a covering supersession bump the recovery generation the same way. -
INV-WAL-V3-BASE-001family: begin, complete and the attach commit takeinstallMuexclusive; handle mutations take it shared. Begin covers every appended LSN because an unacknowledged record above BaseLSN would leave a hole behind BaseCursor. Begin also refuses a zero install ID, the installing ID itself (TestBaseInstallV3BeginRefusals) and a begin while installed (retire first). An install-lane apply stays admitted after the handle's own completion because the session's WAL lane can outlive its BaseDone (DESIGN r17.4). The retirement deferral is meant to keep the installed descriptor as the provider's completed-image evidence while a reopen could still read the volume as fresh from HEAD. It is lifted by the attach commit when the volume is already installed (CommitChunkAttachV3), or after a BASE transition once local presence is durably saved and this open's attach is committed (holdBaseTransitionV3); a new begin defers it again. Open question: whether the attach commit's removal of the fresh marker and its directory fsync, before the deferral is lifted, is the full safety argument on the non-chunk-managed path where the commit lifts it; the presence-durable form is the stronger, chunk-managed path. Controls of the resume, supersession and same-open Recover rules in the next note:TestBaseInstallV3SupersessionAfterReopenFencesTheOldSuffix(core/storage/base_install_reopen_v3_test.go);TestBaseInstallV3ResumeAfterReopenFencesAndServesTheSuffix,TestBaseInstallV3ResumeRefusesADamagedSuffix,TestBaseInstallV3EBelowThePersistedHead,TestBaseInstallV3SameOpenRecoverLeavesNoStaleResumeCut,TestBaseInstallV3SameOpenRecoverKeepsTheLiveInstallServed,TestBaseInstallV3SameOpenRecoverOverDamageFailsClosed(core/storage/base_install_resume_v3_test.go). -
INV-WAL-V3-INSTALL-ACK-001family: DESIGN r17.4 section 7.SyncInstallLogattests install-log durability only, never a readable image, and never changes BaseState; its final fault check is the #172 acknowledgement boundary. The former clause that a v2 store'sSyncInstallLogis itsSyncis dropped: open refuses legacy formats, so every open store is v3. -
INV-WAL-V3-BATCH-001family: a single-blockWriteBatchis an ordinary write record. The writer consumes the whole LSN range of a batch (INV-WAL-V3-LSN-ORDER-001). A torn acknowledged batch fails recovery closed (INV-WAL-V3-W-RECOVERY-001). A failed batch pwrite latches the store and is never acknowledged: see M1 Serving → FaultLatched (INV-WAL-APPEND-STICKY-001). -
Enforced by reading (no test asserts it), M1 rows:
INV-WAL-V3-ADMISSION-001family, that a WAL-pressure or admission-slot wait wakes the flusher and holds no store, descriptor or WAL writer lock while it sleeps, and that no such wait grants WAL reuse or acknowledges a write (walAdmission.acquireContext,writePressureSample);INV-WAL-V3-ACTIVATION-FALLBACK-001, the read-only half (openReadOnlyV3runs the samerefuseLegacyWALStoreandselectSlotV3; the test opens writable);INV-WAL-V3-BASE-HANDLE-001, the refusal of an ordinary replicated apply while installing (applyEntryV3);INV-WAL-V3-BASE-DRAIN-001, that a complete also waits for every admitted handle mutation (markBaseCompleteV3takesinstallMuexclusive);INV-WAL-V3-RESET-INVARIANT-001, that LSN allocation is unchanged (the tests compare W, CheckpointLSN and the map root);INV-WAL-V3-INSTALL-LOG-RECEIVER-001, the switch to the ordinarySyncafter the session's completion (Receiver.sendAck); and that a publication refused at its success boundary keeps its written candidate pinned as uncertain until reopen (publishLockedCoreV3).
B.2 Core: authority and epochs
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-AUTH-DYNAMIC-NEEDS-LOOP-001 |
With the loop off, new dynamic records and first placements fail without writes (FailedPrecondition names the cure); exact static RF1 membership is exempt. Recorded retries keep identity/conflict rules after restart. | M2 none → Bound admission | core/host/master/placement_admission.go requireAssignmentProducer; services.go CreateVolume; workspace_binding.go PlaceWorkspace (under workspaceMu) |
TestCreateVolumeRequiresAnAssignmentProducerBeforeAnyWrite, TestPlaceWorkspaceRequiresAnAssignmentProducerBeforePlacement, TestRecordedDynamicIntentRetriesAfterRestartWithTheLoopOff (core/host/master/create_placement_loop_test.go); TestAssignmentProducerGuardSitesAndOrder (core/host/master/placement_admission_guard_test.go) |
— (immutable configuration admission; no kernel transition) | ACTIVE |
INV-AUTH-HOLDER-IDENTITY-001 |
A primary holder is the pair (server id, replica id): every site that decides holdership (adopting a fact, lease first grant, renew, re-grant, HEAD claim, superseded exit) compares both; a missing server id is refused, never guessed. | AUTHORITY: PRIMARY holdership (supporting replicas are not holders) | core/host/volume/host.go applyFact, IsSuperseded, recordOtherLine; assignment_holder.go assignmentNamesSelf, observeForeignHolder, refusePrimaryAssignment; host.go IsSuperseded; core/host/master/services.go SubscribeAssignments; workspace_service.go holderMatches, RenewWorkspaceLease, AckWorkspaceRevoked; cmd/blockvolume/chunk_remote.go chunkHolder; core/frontend/chunkstore/layout/start.go Start, core/frontend/chunkstore/layout/claim.go Claim; superseded exit covered by #409; core/host/master/workspace_binding.go workspaceLineOwner, workspaceSourceHost; core/authority/assignment_owner.go captureAssignmentOwner; core/host/master/services.go assignmentFact; core/host/master/server_host_identity.go refuseServerIDFromOtherHost (called from ReportHeartbeat), refuseWorkspaceHolderHost (called from holderMatches and, for a workspace volume, from SubscribeAssignments), holderSlotFact (called from QueryVolumeStatus, observationVolume and observationReplicas); core/csi/master_backend.go primaryOwnedFrontends (a CSI target only from a usable primary frontend); core/authority/snapshot_builder.go expectOwnerForLine (a moved line's replica facts and endpoint refreshes only from its owner, #425) |
TestAssignmentHolderIdentityRestartedOldProcess, TestAssignmentHolderIdentityMatchingServerStillAdopts, TestAssignmentHolderIdentityFencesPreviouslyHealthySameReplica, TestAssignmentHolderIdentityAdoptsAndWarnsCarriedEndpointMismatch, TestAssignmentHolderIdentityForeignStreamOrdering, TestAssignmentHolderIdentityForcedMoveRefusesEveryDeliveredVersion, TestAssignmentHolderIdentitySameEpochCannotChangeServer (core/host/volume/assignment_holder_test.go); TestWorkspaceLeaseGuardCarriesHolderServerIdentity (core/host/volume/workspace_holder_identity_test.go); TestWorkspaceLeaseRequiresHolderServerForGrantRenewAndRegrant, TestWorkspaceRevocationACKRequiresHolderServer (core/host/master/workspace_holder_identity_test.go); TestWorkspaceRPCCleanMovePreservesReplicaIdentity (core/host/master/workspace_service_test.go); HEAD claim: TestChunkHolderIsServerAndReplica (cmd/blockvolume/chunk_remote_test.go), TestWALStoreChunk_SameReplicaOnAnotherServerIsFenced (core/frontend/durable/provider_chunk_holder_test.go); superseded exit: covered by #409 (server-id/replica-id pair, never replica alone); supporting replicas are not holders; descriptor identity not in this row; TestWorkspaceLineOwnerIssuedAndHistorical (core/host/master/workspace_line_owner_test.go), TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation (core/host/master/workspace_lease_horizon_test.go); TestAssignmentFactKeepsCapturedMoveOwnerWithoutReadableJournal (core/host/master/assignment_fact_owner_test.go), TestAssignmentOwnerReservedAndIssuedCapture (core/authority/assignment_owner_test.go), TestWorkspaceCrashAfterJournalBeforeEpochResumesSameGrant (core/authority/workspace_test.go); TestServerIDRefusedFromAHostOtherThanItsRegisteredOne, TestWorkspaceHolderRefusedFromAnotherHostAtRenewAckAndStream, TestPortalAndPrimaryComeFromTheLineServerNotTheFreshestHeartbeat, TestDisplayedPrimaryIsTheIssuedHolderNotThePlacementSlot, TestStatusListsNoFrontendWhenThePrimaryEvidenceIsMissing, TestCSIPublishesNoTargetWhenThePrimaryFrontendIsMissingOrRejected, TestDeletionReservedWorkspaceVolumeKeepsTheStreamHostCheck (core/host/master/server_host_identity_test.go); TestPublishTargetIsPrimaryOwned (core/csi/primary_owned_frontend_test.go). Host scope: registered advertised-host consistency, not process uniqueness; a workspace holder's server id must be registered (no first-seen binding: host addresses change); non-workspace heartbeats from an unregistered id are not checked. Limits: with mutual TLS on, a node may act only for the server id bound to its certificate (TERM-CALLER-001; auth.RequireNode in ReportHeartbeat, SubscribeAssignments, RenewWorkspaceLease, AckWorkspaceRevoked, QueryVolumeStatus; TestNodeActsOnlyForItsOwnServerID, core/host/master/auth_red_test.go), and the registered-host check stays beside it (no NAT or proxy between volume and master in OSS); in development mode (plaintext on loopback, no role file) there is no authentication; TestBuildSnapshotTakesTheMovedLinesReplicaFromItsOwner (core/authority/line_owner_snapshot_test.go); TestProcedureForcedMoveWithTheOldHostReturning (cmd/blockvolume/procedure_gate_integration_test.go, tags subprocess chunkstore_integration: every forced-epoch line carries the new owner's endpoints); also in core/auth/authorize.go |
WorkspaceRegrant NoForeignAdoption, TargetNotFencedByOwnLine (round 4 pinned simulations only; exhaustive combo10 pending) |
ACTIVE |
INV-AUTH-CALLER-ROLE-001 |
With mutual TLS on, every blockmaster gRPC call (unary, and before every stream send) is decided by the caller's certificate and the current role file: an unknown caller is refused UNAUTHENTICATED, a role its method's rule does not admit PERMISSION_DENIED, a method without a rule always. | AUTHORITY: control API callers (people, tools, nodes) | core/auth/identity.go Authenticator.PeerIdentity, Authenticator.Reload; core/auth/authorize.go Rule.Allows, UnaryInterceptor, StreamInterceptor, RequireNode, RequireRole; core/host/master/authz.go masterRules, serverAuth; core/rpc/link/tls.go ServerCredentials, ClientCredentials; cmd/blockmaster/auth.go authFlags.validate, authFlags.build |
TestPeerIdentity, TestRoleFileReload (core/auth/identity_test.go); TestRuleAllows, TestRequireNodeAndRole, TestUnaryInterceptor, TestStreamEndsAtTheReloadThatRevokesItsCaller (core/auth/authorize_test.go); TestMasterAuthorizationTableCoversEveryMethod (core/host/master/authz_test.go); TestForcedMoveNeedsAnAdmin, TestNodeActsOnlyForItsOwnServerID (core/host/master/auth_red_test.go); TestMasterLinkMutualTLS (core/rpc/link/tls_test.go); TestAuthFlags (cmd/blockmaster/auth_flags_test.go); TestMasterTLSFlags (cmd/blockvolume/master_tls_test.go); TestOpsEvidenceFlagsReachAMutualTLSMaster (cmd/sw-block/ops_evidence_tls_test.go), including the viewer CLI flags, environment defaults, incomplete credentials and untrusted server CA. Also: a mutating operator or admin method writes its audit attempt before it runs or is refused as audit unavailable (Rule.Strict; TestMasterOperatorMethodsAreStrict (inverted: a new operator or admin method fails unless strict or named with its reason), core/host/master/authz_test.go; TestStrictCallsNeedTheirAttemptLine, core/auth/strict_audit_test.go), node calls never wait on the audit log; a reload that removes a caller, or changes its role so the method's rule no longer admits it, ends its open streams at the reload; a forced move needs an admin; plaintext listens only on loopback without a role file (development mode). Limits: the audit log records outcomes and decides nothing; the volume process's own HTTP routes stay loopback-only and unauthenticated. |
AuthLease (exhaustive run pending) |
ACTIVE |
INV-AUTH-ONE-REPLICATED-FACTOR-001 |
CreateVolume admits a replicated volume only if the master can decide it: its replication factor equals the master's one slot count (--expected-slots-per-volume) and the lifecycle product loop runs (only that loop binds, mints and promotes it). | M2 none → Bound (a created replicated volume's first line) | core/host/master/services.go CreateVolume; core/host/master/host.go Config.LifecycleProductLoop; core/authority/controller.go ExpectedSlotsPerVolume, validateVolumeTopology |
TestAnRF2CreateOnAnRF3MasterIsRefusedAndFailoverContinues, TestAReplicatedCreateWithTheProductLoopOffIsRefused (core/host/master/create_rf_mismatch_test.go) |
— (an admission check). Limits: single-replica volumes are admitted at any slot count (they never reach the check); a static --topology file with a mismatched volume is not checked at start (a cluster spec is: INV-AUTH-REPLICATED-SPEC-NEEDS-LOOP-001) |
ACTIVE |
INV-AUTH-REPLICATED-SPEC-NEEDS-LOOP-001 |
blockmaster refuses to start when its cluster spec holds a replicated volume it could never decide: one whose replication factor differs from --expected-slots-per-volume, or any while the lifecycle product loop is off (only that loop binds, mints and promotes it). | M2 none → Bound (a replicated cluster-spec volume's first line) | cmd/blockmaster/product_loop_guard.go requireProductLoop; cmd/blockmaster/main.go run |
TestReplicatedClusterSpecWithTheProductLoopOffIsRefused, TestTheProductLoopGuardPassesWhatItShould, TestAClusterSpecVolumeOfAnotherReplicationFactorIsRefused, TestAPlacementOnlyClusterSpecVolumeIsChecked (cmd/blockmaster/product_loop_guard_test.go) |
— (a startup configuration check). Limits: static --topology is not refused (its observation controller mints), and has no automatic failover in v1 |
ACTIVE |
INV-CREATE-ONE-IDENTITY-001 |
One name, one layout identity; no directory but the record's holds a live HEAD (not none, not deleted). A served volume's deleted name is never created again. | M2 none → created (CreateVolume, restore target creation) | core/host/master/services.go CreateVolume, createLifecycleVolume; core/frontend/chunkstore/layout/start.go Start |
TestARefusedRestoreLeavesNoTargetRecord (core/host/master/restore_refusal_test.go), TestARealCatalogRestoreOfARestoreTargetLeavesNothing, TestAServedThenDeletedNameIsStillRefused (core/host/master/restore_refusal_catalog_test.go), TestCreateVolume (core/frontend/chunkstore/layout/create_test.go), TestDecodeHead_RefusesAnotherVolumesHead (core/frontend/chunkstore/layout/head_test.go) |
VolumeCreate OneIdentity (its second clause: a directory with a live HEAD is the record's). Scope: only a refused restore's record, which never left the creation phase (never assigned, never served), is removed, with no filer write. Limits: a served volume's deleted name stays refused until 1.1 | ACTIVE |
INV-CREATE-DIR-COLLISION-001 |
Only a rejected exclusive VOLUME create proving a valid foreign full id in the selected name/id8 directory permits an unready, unattached ordinary create to redraw. Ready, attached and restore records refuse redraw. | M2 pending create collision → pending create with fresh id | core/frontend/chunkstore/layout_create.go CreateVolumeRecord; core/lifecycle/store.go RedrawPendingLayoutID; core/host/master/services.go createLifecycleVolume |
TestCreateVolumeExclusiveCollisionRedraws, TestCollisionExistingVolumeSafety, TestDirectoryCollisionIsOnlyAnExclusiveCreateRefusal, TestRedrawPendingLayoutID |
MasterCreate3 MUST-VIOLATE rows 220-224; no-proof redraw, use-before-persist and remint-on-replay mutants violate OneIdentity; no change to HEAD ownership/lease rules | ACTIVE |
INV-CREATE-DIR-COLLISION-SETTLE-001 |
A collision replacement is persisted before use. A lost synchronization reply settles the identity already on disk; a retry never remints it. | M2 pending create collision → pending create with fresh id | core/frontend/chunkstore/layout_create.go CreateVolumeRecord; core/lifecycle/store.go RedrawPendingLayoutID; core/host/master/services.go createLifecycleVolume |
TestCreateVolumeExclusiveCollisionRedraws, TestCollisionExistingVolumeSafety, TestDirectoryCollisionIsOnlyAnExclusiveCreateRefusal, TestRedrawPendingLayoutID |
MasterCreate3 MUST-VIOLATE rows 220-224; no-proof redraw, use-before-persist and remint-on-replay mutants violate OneIdentity; no change to HEAD ownership/lease rules | ACTIVE |
INV-CREATE-DIR-COLLISION-FOREIGN-001 |
A rejected exclusive create leaves the colliding volume metadata and payload byte-identical, with no new activity or lock; that volume remains attachable and serves its data. | M2 pending create collision → pending create with fresh id | core/frontend/chunkstore/layout_create.go CreateVolumeRecord; core/lifecycle/store.go RedrawPendingLayoutID; core/host/master/services.go createLifecycleVolume |
TestCreateVolumeExclusiveCollisionRedraws, TestCollisionExistingVolumeSafety, TestDirectoryCollisionIsOnlyAnExclusiveCreateRefusal, TestRedrawPendingLayoutID |
MasterCreate3 MUST-VIOLATE rows 220-224; no-proof redraw, use-before-persist and remint-on-replay mutants violate OneIdentity; no change to HEAD ownership/lease rules | ACTIVE |
INV-CLI-TYPED-REFUSAL-001 |
The chunk CLI reports a restore the master refused for a foreign source as restore_source_not_own (from the master's typed reason, never its text) and a volume the master does not know as volume_not_found. |
M2 none → created (restore refusal); CLI volume resolve | core/host/master/services.go CreateVolume; core/rpc/lifecycleclient/reason.go WithReason, Reason; cmd/sw-block/chunk_b.go chunkRestore, run |
TestOpsChunkTypedRefusalCodes (cmd/sw-block/chunk_typed_codes_test.go), TestReasonRoundTrip (core/rpc/lifecycleclient/reason_test.go), TestARealCatalogRestoreOfARestoreTargetLeavesNothing (core/host/master/restore_refusal_catalog_test.go) |
— (reporting only; the refusal is INV-CREATE-ONE-IDENTITY-001's). Limits: other FailedPrecondition refusals stay the generic not_admitted |
ACTIVE |
INV-CLI-RESTORE-VERB-001 |
volume restore --abort changes nothing unless the master records this command's source, snapshot and request id for the target and this host's settings name exactly it (volume, master, --layout-id alone in the extra arguments); a re-run counts only this replica's published line as placed. |
client (no state machine): the CLI side of M2 restore create, placement and delete | cmd/sw-block/volume_backup.go volumeRestoreAbort, volumeRestore, restorePlaced; core/host/master/services.go lifecycleVolumeResponse |
TestVolumeRestoreAbortRefusesAForeignTarget, TestVolumeRestoreAbortRefusesAnotherLocalInstallation, TestVolumeRestoreAbortInterruptedAtEveryStepCompletes, TestVolumeRestoreCrashTableBothWays, TestVolumeRestorePublicationDuringThePlacement, TestVolumeRestorePlacementOfAnotherLineRefuses, TestVolumeRestoreCreatesPlacesAndStarts, TestVolumeBackupTakesOneSnapshotAndRerunReplays, TestVolumeBackupRefusals, TestVolumeBackupIncompleteAnswerIsUnknown (cmd/sw-block/volume_backup_test.go), TestGetVolumeAnswersTheRecordedRestoreTuple (core/host/master/volume_restore_tuple_test.go) |
— (the command's model is checked outside the repository; its trace is on the pull request) | ACTIVE |
INV-AUTH-EPOCH-MINT-001 |
Only the publisher mints epochs; a reassignment takes the per-volume maximum epoch plus one, also after a restart. | M2 Bound → Reassigned | core/authority/authority.go applyWithWorkspaceMove, maxPublishedEpochForVolume |
TestLayoutGrantedEpochIssuerSites, TestLayoutEpochEnumerationRejectsANewIssuer, TestG8_0_Publisher_ReassignAdvancesPerVolumeEpochAcrossReplicaSlots (core/authority/g8_0_authority_failover_test.go); TestDurableAuthority_PublisherAdvancesFromReloaded (core/authority/authority_restart_test.go); TestG9F2_AssignmentRequestShapeHasNoEpochOrEndpointVersion (core/host/master/authority_request_bridge_test.go); also in core/authority/layout_granted_epoch_guard_test.go |
ControlPlane UniqueEpoch |
ACTIVE |
INV-AUTH-RESTART-REISSUE-001 |
A line records the primary process it was issued for (durable); a current primary reporting another process is re-issued its line at a new endpoint version, and a primary adopts no line issued for another process, so a restarted process never reuses the dead one's sessions. | M2 authority (RefreshEndpoint); M3 primary adoption | core/authority/authority.go applyWithWorkspaceMove (records the ask's or the source's incarnation); core/authority/controller.go endpointStale, sameAsk, refreshAsk (conditional on the line it read); core/host/master/product_loop.go RunLifecycleProductTick, restartedHolderRefresh (the product loop's direct path for a workspace-bound RF1 volume, conditional on the line it read); core/authority/workspace.go persistWorkspaceTimedLocked; core/authority/observation_store.go SlotFactAt; core/host/master/host.go (the source); core/host/volume/host.go applyFact |
TestPublisher_RestartedPrimaryGetsANewEndpointVersion, TestPublisher_AskWithoutAProcessIsIssuedForTheReportedOne, TestTopologyController_RestartedPrimaryAtTheSameAddressIsReissued, TestTopologyController_QueuedRefreshIsReplacedForANewerProcess, TestTopologyController_UnnamedLineIsReissuedOnceForTheReportingProcess, TestWorkspaceLeaseWriteKeepsTheLinesIncarnationAcrossReload, TestObservationStore_SlotFactAtIsTheProcessAtThoseEndpoints (core/authority/restart_endpoint_version_test.go); TestLinesNameTheirPrimarysProcess, TestLineForTheTargetsEndpointsNamesTheTargetsProcess (core/host/master/line_incarnation_test.go); TestRF1RuntimeVolumeIsReissuedToARestartedHolder, TestRF1RuntimeLineNamingNoProcessIsReissued, TestRF1RefreshDecidedBeforeACrossHostMoveIsNotApplied (core/host/master/rf1_restart_reissue_test.go); TestRefreshIsConditionalOnTheLineItWasDecidedAgainst, TestControllerRefreshNamesTheLineItWasDecidedAgainst (core/authority/refresh_expected_line_test.go); TestHost_ApplyFact_LineIssuedForAnotherProcessIsNotAdopted, TestHost_ApplyFact_UnnamedLineIsNotAdoptedWhereLinesNameTheirProcess (core/host/volume/line_incarnation_test.go); TestHostConfigAdoptsOnlyLinesNamingThisProcess (cmd/blockvolume/lines_name_their_process_test.go); TestRestartedPrimaryAtTheSameEpochIsAdmitted (core/replication/primary_restart_session_test.go) |
— | ACTIVE |
INV-AUTH-PERSIST-BEFORE-PUBLISH-001 |
With an authority store configured, an assignment is written to the store before memory or any subscriber sees it, a failed write does not publish it, and an unknown outcome (directory fsync after the rename failed) fail-stops blockmaster: see M2 any → (store write first). | M2 any → (store write first) | core/authority/authority.go applyWithWorkspaceMove; core/authority/authority_store_file.go Put (failStopDurabilityUnknown after a failed directory open or fsync behind the rename, every record; a close error after a good fsync is reported written; Windows keeps its previous behaviour) |
TestDurableAuthority_PutFailureRollsBackInMemoryState (core/authority/authority_restart_test.go); TestPutFailStopsWhenTheDirectoryFsyncFailsAfterRename, TestPutReportsWrittenWhenOnlyTheDirectoryCloseFails (core/authority/authority_store_dir_fsync_test.go) |
ControlPlane UniqueEpoch |
ACTIVE |
INV-AUTH-MOVE-JOURNAL-001 |
A workspace move's epoch is issued only after its journal record is durable, and one move request id gets exactly one epoch, also across restarts. | M2 MoveReserved → MoveIssued | core/authority/workspace.go prepareWorkspaceMoveLocked, MoveWorkspace, sameWorkspaceRequest |
TestWorkspaceMoveCannotIssueEpochWithoutJournal, TestWorkspaceCrashAfterJournalBeforeEpochResumesSameGrant (core/authority/workspace_test.go); TestWorkspaceReplayedIssueStartsGranteeLease (core/authority/workspace_unclaimed_grant_test.go) |
ControlPlane Idempotent, JournalComplete |
ACTIVE |
INV-AUTH-UNCERTAIN-001 |
A failed authority write for a workspace volume latches uncertainty until a restart reloads the store: later authority changes and new or extended grants for that volume are refused. See M2 any (workspace) → Uncertain and Uncertain → Uncertain (move answer). | M2 any (workspace) → Uncertain; Uncertain → Uncertain (move answer) | core/authority/authority.go applyWithWorkspaceMove; core/authority/workspace.go persistWorkspaceLocked; core/authority/workspace_lease_view.go RenewWorkspaceLease; core/authority/workspace.go WorkspaceMoveOutcomeError, MoveWorkspace; core/host/master/workspace_service.go MoveWorkspace |
TestWorkspaceUncertaintyPrecedesRequestRefusal (core/authority/workspace_outcome_uncertain_test.go), TestWorkspaceMoveUnknownPrecedesAdmissionRefusals (core/host/master/workspace_uncertain_precedence_test.go), TestWorkspaceUncertainIssueWriteIsTyped (core/authority/workspace_outcome_uncertain_test.go) |
ControlPlane UniqueEpoch; WorkspaceMoveOutcome NoFalseRefusal, CallerEndTyped, UncertainReplyClass |
ACTIVE |
INV-LEASE-VIEW-001 |
Whenever the publisher lock is released, each volume's lease view, the renewal path's only input, equals derive(the published authority line, workspace state, uncertainty, store presence). | M2 every workspace transition | core/authority/workspace_lease_view.go deriveLeaseLocked, refreshLeaseViewLocked, publishIssuedLeaseLocked, setLeaseDeadlineLocked; core/authority/authority.go applyWithWorkspaceMove, reloadFromStore; core/authority/workspace.go persistWorkspaceLocked |
TestWorkspaceLeaseViewMatchesDeriveAfterEveryWriter (core/authority/workspace_lease_horizon_test.go) |
— | ACTIVE |
INV-LEASE-VIEW-OWNED-001 |
The granted deadline and the extender flag exist only in the lease view; refreshing the view from its derive inputs never changes either of them. | M2 every workspace transition | core/authority/workspace_lease_view.go refreshLeaseViewLocked, setLeaseDeadlineLocked, extendWorkspaceLease |
— | — | STUB |
INV-WS-LEASE-HORIZON-001 |
Retired: v1.1 keeps no lease horizon current; renewals write nothing and a restarted master waits for its own restart floor (INV-WS-RESTART-GRACE-001). |
legacy M2 Granted → Granted | — | — | — | ARCHIVED |
INV-WS-LEASE-HORIZON-MONO-001 |
Retired with the lease horizon (INV-WS-RESTART-GRACE-001). |
legacy M2 Granted → Granted | — | — | — | ARCHIVED |
INV-WS-RENEW-NONBLOCKING-001 |
Live renewals take only the leaf lease lock and lock-free lifecycle snapshots; they never wait on publisher/store locks. First grants and expired re-grants persist synchronously; an expired re-grant refuses immediately if the publisher lock is busy. | M2 Granted → Granted | core/authority/workspace_lease_view.go RenewWorkspaceLease; core/host/master/workspace_service.go workspaceVolumeForRenewal ; core/lifecycle/placement_intent.go GetPlacementSnapshot; core/host/master/workspace_service.go RenewWorkspaceLease; core/lifecycle/node_inventory.go GetNodeSnapshot (the holder host check) |
TestWorkspaceRenewalDoesNotWaitForSlowStore, TestWorkspaceConcurrentRenewalsDoNotSerializeOnStore, TestWorkspaceRenewalDoesNotWaitForUnrelatedHeldWrite (core/authority/workspace_renewal_slowstore_test.go); TestWorkspaceLeaseGuardSurvivesSlowAuthorityStore, TestWorkspaceRenewalRPCDoesNotWaitForHeldReservationWrite (core/host/master/workspace_renewal_slowstore_test.go) ; TestPlacementSnapshotDoesNotWaitForWriter, TestPlacementSnapshotFailedCommitStaysCommitted (core/lifecycle/placement_snapshot_test.go); TestNodeSnapshotDoesNotWaitForARegistrationWrite (core/lifecycle/node_snapshot_test.go); TestLiveRenewalDoesNotWaitForAHeldRegistrationWrite (core/host/master/server_host_identity_test.go) |
— | ACTIVE |
INV-WS-RESTART-GRACE-001 |
At format level 1, a renewal writes nothing durable. A forced move, an expired re-grant and a no-live-lease proof wait for this process's deadline plus skew: its latest grant, or after a restart the restart floor (restart + TTL); no lease value an earlier process wrote is read. | M2 Granted → Granted; Expired → Moved (forced); Expired → Granted; any → DeleteReserved | core/authority/workspace_lease_view.go RenewWorkspaceLease, regrantWorkspaceLease, newWorkspaceLease; core/authority/workspace.go forcedMoveBarrierLocked, AckWorkspaceRevocation; core/authority/authority.go reloadFromStore (the restart floor) |
TestRenewalWritesNothingDurable, TestForcedAdmissionIgnoresAPersistedHorizon (core/authority/workspace_restart_grace_test.go); TestWorkspaceLeaseGuardServesThroughAStalledStore (core/host/master/workspace_lease_horizon_test.go); TestAfterARestartADifferentHolderIsRefusedUntilTheRestartFloor, TestAfterARestartTheSameLiveHolderRenewsAtOnce (core/authority/workspace_restart_barrier_test.go) |
LeaseRestart OneServer (grace design) |
ACTIVE |
INV-WS-AUTH-RECORD-V2-001 |
The format finalize writes the store's attestation file as format 2 (INV-FMT-LEVEL-001), on which a v1.0.x master refuses its whole start; from then on its authority records are envelope version 2 (a v1.0.x master would skip them); before it, both are v1.0's. It reads both forms of each. |
M2 every workspace write; master start | core/host/master/store_attestation.go ensureEnvelope, decodeStoreAttestations; core/host/master/host.go New; core/authority/authority_store.go storeEnvelopeVersion, encodeEnvelope, decodeEnvelope |
TestAV100MasterRefusesTheAttestationEnvelope, TestAttestationsWriteTheV100FileUntilTheFinalize, TestAttestationsReadTheV100File (core/host/master/golden_v100_test.go); TestARecordWrittenNowFailsTheV100Decoder (core/authority/workspace_restart_grace_test.go); TestAuthorityStoreWritesTheV100Files, TestAuthorityStoreReadsTheV100Files (core/authority/golden_v100_test.go) |
— | ACTIVE |
INV-FMT-LEVEL-001 |
The cluster's format level is the attestation file's form: v1.0.x's bare map is level 0, the envelope (format 2, format_level 1) level 1. It only rises: the finalize is its only writer, and an envelope below level 1 is refused at start. | FormatGate Finalize (level 0 → 1) | core/host/master/store_attestation.go decodeStoreAttestations, finalize, persist, level; core/host/master/host.go New |
TestFinalizeFormatBlocksOnAnOldHolderAndIsDurable, TestAnAttestationEnvelopeBelowLevel1IsRefused (core/host/master/format_gate_test.go); TestAttestationsWriteTheV100FileUntilTheFinalize, TestAV100MasterRefusesTheAttestationEnvelope (core/host/master/golden_v100_test.go) |
FormatGate OneWay (mutation level_lowered) |
ACTIVE |
INV-FMT-FINALIZE-001 |
The finalize is refused, naming them, only while a fresh report of a process holding a volume reads below 1; hosts with no or a stale report are listed, not blocking. Else it writes the envelope durably, then switches the publisher under both its locks, then answers; a failed write leaves level 0. | FormatGate Finalize | core/host/master/format_gate.go FinalizeFormat, finalizeCheck; core/authority/workspace_lease_v100.go FinalizeFormatLevel |
TestFinalizeFormatBlocksOnAnOldHolderAndIsDurable, TestFinalizeFormatListsTheHostsItCannotConfirm, TestAFailedFinalizeWriteLeavesLevel0, TestAHolderRestartedOnAnOldBinaryIsNotReissuedItsLine (core/host/master/format_gate_test.go); TestHost_ApplyFact_LineIssuedForAnotherProcessIsNotAdopted (core/host/volume/line_incarnation_test.go); TestClusterFinalizeFormat (cmd/sw-block/cluster_format_test.go); TestClusterFinalizeFormatTypedAnswer (cmd/sw-block/cluster_format_json_test.go) |
FormatGate FinalizeKeepsHosts (mutation finalize_ignores_reports); FormatGateMaster (mutations old_starts_after_finalize, finalize_not_atomic) |
ACTIVE |
INV-FMT-ELIGIBLE-001 |
At level L no new work goes to a server known to read below L: no placement or move target (binary_too_old). An unreported server is placeable; no line is granted to a holder process before its own report. Heartbeats are recorded, never refused. Placed work stays. Every assignment carries L. | FormatGate Assign (placement, move, failover) | core/host/master/format_gate.go formatEligible, formatTooOld, placementTooOld, grantTooOld; core/host/master/journal_isolation.go newWorkRefused, reconcilePlacements; core/host/master/workspace_binding.go PlaceWorkspace; core/host/master/workspace_service.go workspaceMoveCheckLocked; core/host/master/services.go ReportHeartbeat, assignmentFact |
TestFormatGateRecordsAnOldBinarysHeartbeatAtLevel1, TestFormatGateRefusesPlacementAndMoveOntoAnOldHost, TestFormatGateProductLoopPlacesOnlyOnHostsThatReadTheLevel, TestAssignmentFactCarriesTheFormatLevel (core/host/master/format_gate_test.go) |
FormatGate NoStrand (mutation place_ignores_reads_level) |
ACTIVE |
INV-FMT-LEVEL0-V100-001 |
At format level 0 the master writes as v1.0: grants clamp to the persisted horizon, an extender keeps it current, forced moves and re-grants wait for the later of horizon and deadline plus skew, records are version 1. Every grant raises the deadline at both levels. | M2 Granted → Granted; Expired → Moved (forced); Expired → Granted (level 0) | core/authority/workspace_lease_v100.go renewV100Locked, extendWorkspaceLease, forcedMoveBarrierV100Locked, ackValidityLocked, envelopeVersionLocked; core/authority/workspace_lease_view.go RenewWorkspaceLease |
TestALevel0RenewalKeepsTheHorizonCurrent, TestALevel0GrantIsClampedToTheHorizon, TestTheForcedBarrierFollowsTheFormatLevel, TestRecordEnvelopeVersionFollowsTheFormatLevel (core/authority/workspace_format_level_test.go) |
FormatGateMaster OneServer, GraceOnlyFinal (mutations level0_no_horizon, old_starts_after_finalize) |
ACTIVE |
INV-FMT-RETIRE-001 |
A host retire, the node registry's only writer after start, is refused, naming the volumes, while the host holds a placement or a live line, and unless confirm repeats the id. A retired id is unregistered; if the host returns it registers again at its reported level. | FormatGate Retire | core/host/master/format_gate.go RetireHost; core/host/master/journal_isolation.go volumesServedBy |
TestRetireHostRefusesAHostThatHoldsWork (core/host/master/format_gate_test.go); TestACleanMoveReleasesTheTopologyHome, TestTheTopologyHomeHoldsTheVolumeBeforeAMove, TestTheTopologyHomeAloneHoldsTheVolumeBeforeAMove (core/host/master/served_topology_move_test.go); TestClusterRetireHost (cmd/sw-block/cluster_format_test.go); TestNodeRegistryIsWrittenOnlyAtStartup (cmd/blockmaster/node_registry_guard_test.go) |
FormatGate r2 OneServer (mutation retire_holding_host) |
ACTIVE |
INV-LIFECYCLE-SNAPSHOT-001 |
The Volumes and deletion-reservation snapshots read by the renewal path equal the store records after every change of the records, including load, delete and a protective reservation kept in memory on an unknown write outcome; a published snapshot is never mutated. | M2 Bound → Deleting (renewal reads) | core/lifecycle/store.go publishLocked, GetVolumeSnapshot; core/lifecycle/deletion_reservations.go publishLocked, ReservedSnapshot |
TestDeletionReservationSnapshotFollowsRecords, TestFileStoreSnapshotFollowsRecords, TestLifecycleSnapshotReadsDoNotTakeStoreMutex, TestLifecycleSnapshotConcurrentWriters (core/lifecycle/renewal_snapshot_test.go); TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation (core/host/master/workspace_lease_horizon_test.go) |
— | ACTIVE |
INV-NODE-REGISTRATION-FRESHNESS-001 |
Replaying a node registration without an observation time preserves its stored SeenAt; unchanged non-time fields do not rewrite its record. A restart is not a fresh observation, also when the declaration changed; a live heartbeat supplies freshness independently. | M2 lifecycle registration replay (no authority transition) | core/lifecycle/node_inventory.go ImportNodes, RegisterNode, registrationLocked; core/host/master/observation_snapshot.go nodeHeartbeat; core/lifecycle/verified_placement.go VerifyPlacementIntent |
TestUnchangedNodeRestartDoesNotRefreshAStaleObservation, TestChangedNodeImportDoesNotRefreshAStaleObservation (core/lifecycle/node_import_freshness_test.go); TestObservationNodesReportTheNewestHeartbeat (core/host/master/observation_heartbeat_test.go); live-holder process restart qualification pending |
Observation time is evidence, not authority; a declaration is not an observation | STUB |
INV-LIFECYCLE-STORE-DURABLE-001 |
A successful record put/import publishes only after complete replacement records and their directory are durable. Open syncs the records directory before publication. A possibly-applied failure blocks mutations until reopen; recovery reconciles complete old/new records. | M2 lifecycle record publication | core/lifecycle/record_file.go writeRecordDurably, writeRecordBatchDurably; node_inventory.go ImportNodes; placement_intent.go ImportPlans; node_inventory.go, store.go, placement_intent.go putLocked |
TestNodeInventoryCrashKeepsCompleteRegistration (core/lifecycle/node_inventory_crash_test.go); TestFileStoreCrashKeepsCompleteRecord, TestPlacementStoreCrashKeepsCompleteRecord, TestLifecyclePutSyncOrderAndFailure (core/lifecycle/store_crash_test.go); TestLifecycleStoreParentSync (core/lifecycle/store_parent_sync_test.go); TestImportStepSyncsChangedFilesThenOneDirectory (core/lifecycle/import_step_sync_test.go); TestImportSyncfsFailureAndOrdering, TestImportSyncfsReturnedFailurePolicyAndReplay, TestImportSyncfsCrashBoundaries, TestSyncfsKernelGate, TestSyncfsFilesystemGate, TestImportBatchSelectsSyncfsByFilesystem, TestImportDurabilityModeProbesEachStoreDirectory (core/lifecycle/import_syncfs_test.go); TestRecordEqualityRequiresRecoveredDirectoryAndConsistentDisk (core/lifecycle/import_recovery_test.go); TestVolumeEqualityRequiresRecovery (core/lifecycle/volume_recovery_test.go); TestNodeMarshalErrorDoesNotRequireRecovery (core/lifecycle/remove_retry_test.go) |
Lifecycle record publication, including startup-step durability barrier | ACTIVE |
INV-LIFECYCLE-FAILSTOP-001 |
A supervised master exits nonzero within one second of a lifecycle put/import or open-barrier persistence failure, independently of logging. It attempts one ERROR; restart completes recovery barriers and import before serving. | Lifecycle process ready/recovering → faulted → exited → recovering | core/host/master/lifecycle_failure.go lifecycleFailStop; host.go New; cmd/blockmaster/main.go run; lifecycle store failure handlers |
TestMasterImportPersistenceFailureExitsAndRecovers (cmd/blockmaster/persist_exit_test.go); TestLifecyclePersistenceFailureStopsTheProcess, TestLifecycleFailStopExitsWithBlockedLogger (core/host/master/lifecycle_failure_test.go) |
Manual process-fault/recovery projection of lifecycle record durability; no new wire or format state | ACTIVE |
INV-VOL-ID-NO-REUSE-001 |
A deleted volume id is never created or attached again. | M2 Deleting; M6 purging → deleted | core/host/master/services.go MarkVolumeDeleting; core/frontend/chunkstore/layout/create.go createVolume |
TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart (core/host/master/volume_deleting_test.go); TestCreateVolume_OverAnExistingHeadByState (core/frontend/chunkstore/layout/create_test.go) |
ChunkLifecycleFixed NoIdReuse |
ACTIVE |
INV-MASTER-JOURNAL-ISOLATION-001 |
Under strict journal isolation, blockmaster gives no new work to a node whose durable root shares the authority store's file system: it refuses that node's heartbeat while it serves no volume, a new placement on it and a move onto it; work the node already has is kept. | M2 workspace move: Acked or Expired → (move refused, nothing written); workspace placement admission; node heartbeat | core/host/master/journal_isolation.go refuseColocatedHeartbeat, colocatedTargetRefused, reconcilePlacements, nodeServesVolumes; core/host/master/workspace_service.go workspaceMoveCheckLocked; core/host/master/workspace_binding.go PlaceWorkspace |
TestColocatedNodeIsAlarmedButAcceptedByDefault, TestStrictRefusesColocatedNodeWithoutVolumes, TestStrictAcceptsColocatedNodeThatAlreadyServes, TestStrictRefusesPlacementAndMoveOntoColocatedNode, TestStrictProductLoopSkipsColocatedNodeForNewPlacement (core/host/master/journal_isolation_test.go); TestStrictReplaysAnIssuedMoveToANowColocatedTarget, TestStrictKeepsAnIdempotentPlacementOnANowColocatedNode (core/host/master/journal_isolation_fold_test.go) |
— | ACTIVE |
INV-SEC-CONTROL-BIND-001 |
blockmaster's unauthenticated control listeners bind only loopback: --listen without mutual TLS, and the runtime HTTP listener always; a non-loopback address, and --insecure-external-bind, are refused at startup. | AUTHORITY: control API reachability | core/host/master/journal_isolation.go ValidateControlListen; cmd/blockmaster/main.go parseFlags |
TestParseFlags_PlaintextControlListenersStayOnLoopback, TestManifests_NoPlaintextExternalBlockmasterBind (cmd/blockmaster/external_bind_test.go); TestAuthFlags (cmd/blockmaster/auth_flags_test.go) |
— (no state machine; the flag test is the proof form) | ACTIVE |
Notes:
INV-LIFECYCLE-STORE-DURABLE-001open gaps: Store-directory ancestor sync on Open is best-effort: failures are logged and do not block startup; a new directory entry may not survive an immediate crash when an ancestor cannot be synced. Record-file and store-directory sync after a put remain mandatory.NodeInventoryStore.RemoveNode,PlacementIntentStore.DeletePlacementandFileStore.DeleteVolumedo not fsync their directory after deletion, so a removed node, placement or volume record can reappear after a crash. A failed put may still be on disk: if directory fsync fails after rename, restart can load the new record.INV-AUTH-PERSIST-BEFORE-PUBLISH-001: a failure before the rename leaves the old record and is reported failed (the in-memory rollback test); a directory open or fsync failure after the rename leaves the outcome unknown and fail-stops the process, for every record type, so the restart reloads whatever survived and callers re-read. A workspace volume's uncertainty latch (INV-AUTH-UNCERTAIN-001) stays for its other causes.INV-AUTH-UNCERTAIN-001: The cited test asserts the refusal after an unknown-outcome lease extension (rename landed, then a failure; the file store fail-stops on a directory fsync failure instead,INV-AUTH-PERSIST-BEFORE-PUBLISH-001): the next renewal, a revocation and an endpoint change are all refused. The TLA+ configurationS5_red_noUncertainviolatesUniqueEpochwithout it. A Revoking lease still gets its bounded drain reply, min(horizon, deadline), never extended: see M2 any (workspace) → Uncertain. A failed move on an uncertain volume is answered as an unknown outcome before any admission refusal, the request's own cancellation or deadline stays typed, and an issued move's replay still returns its stored grant: see M2 Uncertain → Uncertain (move answer). The renewal path reads uncertainty from the lease view (INV-LEASE-VIEW-001), not frompersistWorkspaceLocked.INV-WS-LEASE-HORIZON-001: The forced-barrier argument (a renewal that reads its clock after the barrier has read the deadline is refused) assumes nondecreasing master time. That is an assumption of the currentWorkspaceTakeovermodel, whoseTickandSlowTickactions only advancenow; it is not a consequence oftime.Nowcarrying a monotonic reading, because persistedUnixNanodeadlines are compared as wall-clock values. The existing deadline check stays alongside the horizon. The model still renews withexp = deadline = now + TTL; the horizon/grant split is a pending specification update (Part C rule 2).INV-WS-LEASE-HORIZON-001,INV-WS-LEASE-HORIZON-MONO-001: a move issue that replaces the lease with the new holder's (a clean handoff, or a forced move past the barrier) is its ordered successor and ends the scope of these rows. If that issue write is persisted ambiguously (it may have landed while memory has not published it), the volume is uncertain and no further grant at the old epoch is issued (INV-AUTH-UNCERTAIN-001), so no disk expiry is claimed for it.INV-LEASE-VIEW-001,INV-LEASE-VIEW-OWNED-001: writers refresh the view under the publisher lock, then the lease lock, at every change of a derive input; the live renewal path takes only the lease lock (INV-WS-RENEW-NONBLOCKING-001). A move issue publishes the derived view and the new holder's initial deadline in one lease-lock section, never lowering a deadline a renewal raised: see M2 Moved → epoch issued (testTestWorkspaceIssuePublishNeverLowersARenewedDeadline,core/authority/workspace_issue_publish_test.go).- Enforced by reading (no test asserts it):
INV-AUTH-PERSIST-BEFORE-PUBLISH-001, that no subscriber sees a failed write (applyWithWorkspaceMovewrites the store before it changes memory and snapshots the subscribers);INV-AUTH-UNCERTAIN-001, the drain reply on an uncertain volume (RenewWorkspaceLeaseanswers a Revoking lease before it checks uncertainty);INV-LEASE-VIEW-OWNED-001(refreshLeaseViewLockedassigns only the derived part); the one-section issue publish (publishIssuedLeaseLocked);INV-WS-LEASE-HORIZON-MONO-001, that an extension writes only a greater horizon (extendWorkspaceLease); and the note above onINV-WS-LEASE-HORIZON-001, that no old-epoch grant follows an issue write with an unknown outcome (the latch, then the uncertainty check inRenewWorkspaceLease). INV-WS-RENEW-NONBLOCKING-001: First grants and expired re-grants are synchronous exceptions (M2 Expired → Granted,INV-WS-LEASE-REGRANT-001); the expired path uses TryLock and refuses a busy publisher. The cited live-renewal tests inject delays or holds before or inside the store write; they show sensitivity to a slow store, not a measured disk trace.INV-MASTER-JOURNAL-ISOLATION-001: a refused heartbeat gets FailedPrecondition. A new placement is either a workspace placement or one the product loop plans. Work the node already has means: the node serves by durable state (a placement slot or a current authority line that names it), a repeated identical placement, or the retry of an issued move. Without strict mode, co-location only raises an alarm.
B.3 Core: replication and replica roles
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-REPL-SESSION-COVERAGE-RETIRE-001 |
Superseded logical-session coverage is released only after every already-admitted frame for that session settles; newer sessions do not delay that release. Shared version history and P survive. | M3 replica admission / session retirement | core/transport/replica.go admitMutation, endSessionFrame; ReplicaApplyGate.CloseSession |
TestApplyGate_WireSessionTurnoverRetiresSettledCoverage, TestApplyGate_AlreadyAdmittedWireSessionNeverRegressesBytes |
ReplicaReviewGuards NoEarlyRetirement/NoSettledHistory |
ACTIVE |
INV-REPL-RECOVERY-SESSION-UNIQUE-001 |
Each runtime observation selects at most one recovery session; delayed same-identity facts cannot restart a completed prefix, while a higher primary head or replacement identity still permits new work. | M3 recovery observation / preparation | core/adapter/adapter.go, normalize.go; core/engine/apply.go |
TestAdapter_OneRecoveryFromPostCloseStalledAck, TestAdapter_OneRecoveryPreparedWithinProbeBatch, TestAdapter_ConcurrentOldProbesNeverRestartHealthyRecovery, TestAdapter_ProbeUsesFreshBoundsBeforePreparingRecovery, TestRecoveryProbeKeepsCompletedRButAllowsNewWorkAndIdentity, TestMissingProbeAckRestoresNewerDurableProgress, TestC5_OrderStableAcrossRuns |
ReplicaApplyOrder NoDuplicateRecovery; ReplicaReviewGuards AckRestoresProgress |
ACTIVE |
INV-REPL-SESSION-ORDER-001 |
Every session the primary opens toward a replica (live ship, catch-up, rebuild, fence, probe) takes its id from that replica's one order, kept across its peers and executors: a later session has a larger id, so a recovery after a live session is never refused as older. | M3 recovery admission | core/adapter/session_ids.go SessionIDs; core/replication/volume.go UpdateReplicaSet (one order per replica id); core/transport/executor.go SessionIDs; core/adapter/adapter.go prepareQueuedCommands |
TestRecoveryStartsAfterThePeerWasReAdded, TestReplicaApplyFailure_PrimaryDegradesRecoversAndReplaysFailedLSN (core/replication/component/replica_apply_failure_recovery_test.go) |
— | ACTIVE |
INV-REPL-NO-PER-LBA-DATA-REGRESSION |
On a replica, an entry writes data only if its LSN is above both P and its LBA's applied LSN, one value shared by every session and lane; a successful write sets that applied LSN to the entry's LSN. | M3 replica apply / session release | core/replication/apply_gate.go applyRecovery, applyLive; cmd/blockvolume/replication_ingress.go replicationIngress (one NewReplicaApplyGate per replica) |
TestReplicationIngressSharesApplyVersionsAcrossSessions (cmd/blockvolume/replication_ingress_apply_test.go); TestApplyGate_OverlappingSessionsNeverRegressBytes (core/replication/apply_gate_cross_session_test.go); TestApplyGate_AlreadyAdmittedWireSessionNeverRegressesBytes (core/replication/apply_gate_wire_overlap_test.go); TestApplyGate_PrunedDurableVersionsRemainStale (core/replication/apply_gate_floor_test.go); TestApplyGate_LiveAndRecovery_DistinctCoverageSharedVersion (core/replication/apply_gate_test.go) |
ReplicaApplyOrder NoRegression; ReplicaPrefixFloor NoRegression/OnlySuffix |
ACTIVE |
INV-REPL-NO-PER-LBA-STALE-RECOVERY |
A stale recovery-lane entry, LSN at or below max(applied LSN, P), writes no data and still marks its LBA covered for its own session. | M3 replica apply / session release | core/replication/apply_gate.go applyRecovery |
TestApplyGate_RecoveryLane_StaleSkip_DoesNotRegressData, TestApplyGate_RecoveryLane_StaleSkip_AdvancesRecoveryCovered (core/replication/apply_gate_test.go) |
— | ACTIVE |
INV-REPL-NO-PER-LBA-STALE-LIVE |
A stale live-lane entry writes no data, returns an error, and marks no recovery coverage. | M3 replica apply / session release | core/replication/apply_gate.go applyLive; core/transport/replica.go handleConn (closes the connection, INV-REPL-APPLY-FAIL-001) |
TestApplyGate_LiveLane_StaleEntry_ReturnsError, TestApplyGate_LiveLane_StaleEntry_DoesNotAdvanceRecoveryCovered (core/replication/apply_gate_test.go) |
— | ACTIVE |
INV-REPL-LIVE-NEXT-LSN-001 |
Inside an epoch, a live-lane entry above the store's next LSN (an LSN skipped) is not applied: the replica closes the connection and its barrier reports the end below the gap; entries replayed from that end apply once, in order. | M3 replica apply | core/transport/replica.go handleConn (with and without the apply gate; no live entry lands while a recovery owns the store) |
TestReplicaAppliesALiveEntryOnlyAtItsNextLSN, TestReplicaAppliesNoLiveEntryWhileARecoveryOwnsTheStore (core/replication/replica_next_lsn_test.go; walstore, the volume's listener construction); guarded during a recovery (a per-block catch-up's end may sit above a gap): such a replica is never a fencing round's target and never completes a write, TestPromotionGate_DecidesOnTheFencingRound (row: invalid table, highest end), TestReplicaMidCatchUpNeverCompletesAWrite (core/replication/component/midrecovery/mid_recovery_count_test.go); also in core/host/master/fence_gate_test.go |
— | ACTIVE |
INV-REPL-NO-PER-LBA-RETAIN |
Closing a session or merging a substrate seed below the recorded value never lowers an LBA's applied LSN. | M3 replica apply / session release | core/replication/apply_gate.go CloseSession, initSessionLocked |
TestApplyGate_CloseAndLowerSeedNeverEraseReplicaVersion (core/replication/apply_gate_cross_session_test.go) |
— | ACTIVE |
INV-REPL-NO-PER-LBA-FAILED-WRITE |
A failed physical write leaves its LBA's applied LSN and its session's coverage unchanged. | M3 replica apply / session release | core/replication/apply_gate.go applyRecovery, applyLive |
TestApplyGate_FailedWriteDoesNotPublishReplicaVersion (core/replication/apply_gate_cross_session_test.go) |
— | ACTIVE |
INV-REPL-NO-PER-LBA-CERTIFIED-PREFIX |
P advances only through an explicit recovery-prefix certificate admitted for the active, prefix-eligible lineage; synced R, live traffic and session changes never advance it. | M3 replica apply / session release | core/replication/apply_gate.go CertifyRecoveryPrefix; core/transport/replica.go certifyRecoveryPrefix, markPrefixEligibility |
TestApplyGate_CertifiedRecoveryClosesBoundVersionHistory, TestApplyGate_CertifiedPrefixFreezesAcrossSessions, TestApplyGate_SyncedLiveMaximumDoesNotCoverRecoveryHole (core/replication/apply_gate_floor_test.go); TestApplyGate_HealthyRecoveryPublishesWirePrefix, TestApplyGate_WirePrefixCannotIntroduceOrReviveSession (core/replication/apply_gate_prefix_wire_test.go) |
ReplicaPrefixFloor CertifiedCoverage |
ACTIVE |
INV-REPL-NO-PER-LBA-PREFIX-BOUND |
A certified P is never zero and never above the replica's synced boundary R, its local durable frontier, at the time of certification. | M3 replica apply / session release | core/replication/apply_gate.go CertifyRecoveryPrefix |
TestApplyGate_CertifiedPrefixFreezesAcrossSessions (core/replication/apply_gate_floor_test.go) |
— | ACTIVE |
INV-REPL-REBUILD-PORT-FENCE-001 |
The dual-lane rebuild port applies the replica listener's admission rules: no frame on a primary, below the epoch floor, or before the role is known. | M3 listener admission | core/transport/replica.go EnterDualLane |
TestDualLaneRebuildPort_RefusesStaleSenderAfterFence, TestDualLaneRebuildPort_RefusesBeforeRoleKnown (core/transport/g6_dual_lane_fence_test.go) |
— | ACTIVE |
INV-REPL-APPLY-FAIL-001 |
A failed ApplyEntry on a replica closes the connection, so no barrier acknowledges past the gap. |
M3 Healthy → Degraded | core/transport/replica.go handleConn |
TestReplicaApplyFailureStopsBarrierAtTheGap (core/transport/replica_apply_error_test.go); TestReplicaApplyFailure_PrimaryDegradesRecoversAndReplaysFailedLSN (core/replication/component/replica_apply_failure_recovery_test.go) |
— | ACTIVE |
INV-REPL-INGRESS-SLOTS-001 |
Replication listeners are open only while the assignment has replica slots. | M3 role → listener lifecycle | cmd/blockvolume/replication_ingress.go roleLocked |
TestBinaryReplicationIngressFollowsAssignedSlots (cmd/blockvolume/replication_ingress_binary_test.go) |
— | ACTIVE |
INV-REPL-CATCHUP-REBUILD-001 |
The engine chooses catch-up when the gap is still in the primary's WAL and rebuild when it is not. | M3 Degraded → CatchingUp | NeedsRebuild | core/engine/apply.go decide |
TestV3_Decision_CatchUp_GapWithinWAL, TestV3_Decision_Rebuild_GapBeyondWAL (core/engine/apply_test.go) |
— | ACTIVE |
INV-REPL-PEER-TRANSITIONS-001 |
ReplicaPeer.SetState and ReplicaPeer.Invalidate apply only the transitions in the peer table; NeedsRebuild has no successor through either. |
M3 peer state | core/replication/peer.go ReplicaPeer.SetState, ReplicaPeer.Invalidate, replicaStateTransitionAllowed |
TestReplicaStateTransition_AllowedSet, TestReplicaStateTransition_RejectedSet, TestReplicaStateTransition_NeedsRebuildIsTerminalInT4c (core/replication/peer_state_machine_test.go); TestReplicaPeer_InvalidatePreservesNeedsRebuildTerminalState (core/replication/invalidate_terminal_regression_test.go); TestReplicaPeer_InvalidateNonTerminalStatesBecomeDegraded, TestReplicaPeer_InvalidateOnNeedsRebuildStillLogsReason (core/replication/invalidate_transition_test.go) |
— | ACTIVE |
INV-REPL-DURABILITY-MODE-001 |
Under sync_all a replicated Sync fails if any replica barrier fails; under sync_quorum it fails unless a majority of nodes, the primary included, are durable. |
M3 barrier evaluation | core/replication/durability.go EvaluateBarrierAcks |
TestDurabilityCoordinator_Quorum_RF3_OneReplicaFailed, TestDurabilityCoordinator_Quorum_RF3_BothReplicasFailed, TestDurabilityCoordinator_SyncAll_AnyFailure_Fails (core/replication/durability_test.go) |
— | ACTIVE |
INV-REPL-PROMOTION-READY-001 |
A replica reports promotion_ready only if it is a member, reachable, caught up, fenced at the current epoch, and has delivered its post-rebuild durable acknowledgement. An active recovery session always refuses readiness, even if delayed bounds select DecisionNone. |
M3 Supporting → promotion candidate | core/engine/promotion_ready.go BuildPromotionReadyFact |
TestBuildPromotionReadyFact_RefusesPendingFence, TestBuildPromotionReadyFact_RefusesPostCloseAckGap, TestBuildPromotionReadyFact_RefusesNotCaughtUp (core/engine/promotion_ready_test.go), TestPromotionReadyRefusesDelayedProbeDuringNewRecovery; also in core/engine/recovery_review_regression_test.go |
WALReplica I3; ReplicationFailover AckedSurvive; ReplicaReviewGuards ReadyRequiresIdle |
ACTIVE |
INV-REPL-SESSION-ONE-EXCHANGE-001 |
At most one steady-session exchange is in flight per peer: the peer queue owns ship, barrier, store learning and fence; reconciliation and promotion seeding use it too. Saturation refuses steady work while healing stays on the same worker. | M3 peer session exchange ordering | core/replication/peer.go; core/replication/peer_work_queue.go |
TestPublishHealthyDoesNotRaceStoreAttestation (core/host/volume/peer_reconcile_attestation_test.go); TestPeerSessionExchangesHaveOnlyQueuedOwners, TestPeerSessionOwnerScanFindsABypass, TestPeerSessionOwnerScanFindsAPackageMethodAlias (core/replication/session_queue_guard_test.go); TestSaturatedPeerQueueStillOwnsTheHealingExchange (core/replication/peer_work_queue_test.go) ; TestBarrierRequestUsesTheShippersWriteOwner (core/transport/barrier_write_owner_test.go) |
SessionExchange.OwnAnswer |
ACTIVE |
INV-REPL-DIVERGENT-TAIL-001 |
A peer is counted only after a reconciliation in this session finds its (last data epoch, end) in sync with the primary's epoch table; an equal length of another epoch, a tail above the frontier or data without a table is diverged: NeedsRebuild, never healed by length. | M3 Healthy → Degraded → NeedsRebuild (seed, heal) | core/replication/volume.go seedNewPeerLiveCursorsLocked, reconcilePeer, markDiverged; core/replication/peer.go HealIfInSync; core/replication/peer_work_queue.go (barrier); core/host/volume/peer_command_executor.go PublishHealthy; core/engine/apply.go decide |
TestPromotionSeed_EqualLengthDivergentEpochIsRebuilt, TestPromotionSeed_SameEpochStartingElsewhereIsRebuilt, TestPromotionSeed_EpochTableControls (core/replication/divergent_epoch_seed_test.go); TestReplicationVolume_UpdateReplicaSet_DegradesPeerAboveLocalFrontier (core/replication/divergent_tail_seed_test.go); TestPublishHealthyNeverHealsAnEqualLengthDivergentPeer (core/host/volume/peer_heal_reconcile_test.go); TestDivergentTailBeforeTheEpochIsAcceptedIsRebuilt (core/engine/divergent_tail_test.go); TestPeerAdapterRegistry_DivergentTailAboveTheFrontierAtAddIsRebuilt (core/host/volume/peer_adapter_divergent_tail_test.go) |
Promo row mut_g4_no_truncate |
ACTIVE |
INV-REPL-EPOCH-TABLE-001 |
A durable epoch -> first LSN table per volume: a live entry's row is durable before it; a recovery makes it invalid (random token) before its first byte and only that token's final replace makes it valid (invalid = diverged); a load drops rows above the next LSN; at most 512 rows. | M3 replica apply, Primary adoption, rebuild done | core/transport/epoch_table.go EpochTable.Note, Replace, SharedEnd, LastDataEpochAt; core/transport/replica.go (ship entry, rebuild done, barrier reply); core/transport/rebuild_sender.go; cmd/blockvolume/replication_ingress.go notePrimaryEpoch |
TestEpochTable_NoteIsDurableAndOrdered, TestEpochTable_InterruptEveryPersistStep, TestEpochTable_LastDataEpochAtTheDurableEnd, TestEpochTable_SharedEnd (core/transport/epoch_table_test.go); TestRebuildDoneReplacesTheEpochTableWithThePrimarysRows, TestRebuildDoneWithoutTheTableReplaceIsNotAcked, TestEpochRowsWire (core/transport/epoch_rebuild_test.go); TestCatchUpKeepsTheHistorysEpochs (core/transport/epoch_catchup_test.go); TestCatchUpWithAFailedTableReplaceLeavesItInvalid, TestRecoveryLaneCrashBeforeTheFinalBarrierLeavesTheTableInvalid (core/transport/epoch_invalid_test.go); TestEveryPeerApplyPathHasAnEpochTableRule (core/transport/peer_apply_paths_guard_test.go); TestEpochTable_OnlyTheMarksOwnerCompletes, TestOverlappingRecoveriesAStaleCompletionLeavesTheTableInvalid, TestEpochTable_OwnershipChangeWaitsForInFlightAppliesAndRefusesLaterOnes (core/transport/epoch_owner_test.go); TestEpochTable_ACatchUpOverAnInvalidTableNeedsARebuild, TestCatchUpStartRefusedUnlessTheDurableEndMatches, TestLiveEntryOfANewEpochOnlyAtTheNextLSN, TestRecoveryLaneStartWithoutItsFromLSNIsRefused, TestEpochTable_LiveAppliesAreFenced (core/transport/epoch_rules_test.go); TestPromotionRejoinNeverAcknowledgesConflictingSameLengthTail (core/replication/promotion_prefix_regression_test.go); TestDelayedOldRecoveryApplyNeverLandsUnderANewValidTable (core/replication/epoch_delayed_apply_test.go); TestDualLaneRecoveryMakesTheEpochTableValid (core/transport/epoch_dual_lane_test.go); TestEpochTableReplaceOnlyAtPrimaryAdoption (core/transport/epoch_table_writers_guard_test.go); TestPrimaryRefusesInboundRecoveryFramesOverItsTable (core/transport/epoch_primary_refuses_test.go); TestIngressPrimaryAdoptionTableStep (cmd/blockvolume/replication_ingress_epoch_test.go); TestEpochTable_TrimAboveTheRecoveredEndKeepsTheNewWritesInTheirEpoch, TestEpochTable_BoundedSoItAlwaysReloads (core/transport/epoch_table_trim_test.go); TestEpochTableHasExactlyItsListedWriters, TestEpochTableWriterCensusFindsAFourth (core/transport/epoch_table_writers_guard_test.go) |
Promo Truncate (common prefix by (epoch, LSN)) |
ACTIVE |
INV-ROLE-STALE-REPLAY-001 |
A role call below the host's current desired epoch is refused and cannot clear a newer role-admission failure. | M3 role admission | core/host/volume/host.go fenceSelfWithPeers, latchRoleAdmission |
TestG1_StaleReplayDoesNotClearANewerAdmissionFailure, TestG1_StaleSupportingReplayDoesNotClearTheLatch (core/host/volume/g1_admission_latch_test.go) |
— | ACTIVE |
INV-ROLE-READINESS-BLOCK-001 |
While local recovery blocks readiness, applyFact admits neither a primary nor a supporting role, and replays the stored fact once readiness clears. |
M3 Unassigned → Primary | Supporting (guard) | core/host/volume/host.go applyFact, replayLocalReadinessFactIfReady |
TestHost_ApplyFact_Self_LocalReadinessBlocked_SkipsReplicationAndAdapter, TestHost_ApplyFact_SupportingReplica_LocalReadinessBlocked_SkipsAdapter, TestHost_ApplyFact_Self_ReplaysAfterLocalReadinessClearsWithReplicationFirst (core/host/volume/apply_fact_test.go) |
— | ACTIVE |
INV-ROLE-SUPERSEDED-001 |
A fact naming another replica as primary, with this replica not among its peers, never reaches this host's adapter or replication, and is recorded as the other line. | M3 Primary | Supporting → Excluded | core/host/volume/host.go applyFact, recordOtherLine |
TestHost_ApplyFact_Supersede_NeverCallsAdapterOrReplication (core/host/volume/apply_fact_test.go); TestHost_BuildReport_SupersededReplicaNotReadyForPrimary (core/host/volume/frontend_targets_test.go) |
— | ACTIVE |
Notes:
INV-REPL-INGRESS-SLOTS-001: Binary test: builds and runs the realblockvolume; build tagsubprocess, not on Windows.INV-REPL-PEER-TRANSITIONS-001:ReplicaPeer.Invalidateuses the same gate asSetState; fromNeedsRebuildit keeps the state and still logs the reason (see Part A, M3; #182).INV-REPL-NO-PER-LBA-DATA-REGRESSION: advancing P drops the applied-LSN entries at or below P, and the floor keeps those LBAs stale (TestApplyGate_PrunedDurableVersionsRemainStale). Restart safety still requires substrate seeds (AppliedLSNs): a substrate that does not track them keeps only replica-lifetime history. The M3 prose in Part A states the same rules.- Enforced by reading (no test asserts it):
INV-REPL-NO-PER-LBA-PREFIX-BOUND, the never-zero half (CertifyRecoveryPrefixrefuses a zero prefix); the above-R half is asserted.
B.4 Workspace: HEAD holder, lease and takeover
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-WS-HEAD-BELT-001 |
Retired: the legacy takeover/cut belt required a confirming HEAD re-read before settling; B writes one conditional HEAD transition and handles lost replies through the session/claim rules (INV-SNAPK-HEAD-WRITE-001, INV-SNAPK-TXN-INTERRUPT-001, INV-SNAPK-START-CLAIM-001). |
legacy M4/M5 | — | — | — | ARCHIVED |
INV-WS-HEAD-BELT-COOLING-001 |
Retired: the legacy HEAD cooling delay is replaced by B's conditional HEAD transition and lease wait (INV-SNAPK-HEAD-WRITE-001, INV-SNAPK-STALE-HOLDER-001); B promises no 2.1 s cooling interval. |
legacy M4 | — | — | — | ARCHIVED |
INV-WS-HEAD-BELT-DEADLINE-001 |
Retired: the legacy belt's separate 2 s CAS/re-read deadlines are replaced by B transition and interruption rules (INV-SNAPK-HEAD-WRITE-001, INV-SNAPK-TXN-INTERRUPT-001); neither promises that deadline. |
legacy M4/M5 | — | — | — | ARCHIVED |
INV-WS-HEAD-BELT-FENCE-001 |
A publisher whose CAS failed or was not confirmed, and whose re-read shows a publication owner different from its own (another epoch, a lower one included, or another holder), fences without retrying the CAS. With an empty last known HEAD its own owner is its configured epoch and holder. | M4 Cooling → HolderFenced; M5 CAS → Fenced | core/storage/chunk_head_belt.go publicationOwnerChanged, fencePublication; core/storage/chunk_layer.go captureLocked, resolvePending, SettleDetach |
TestHeadBeltLowerEpochConflictFencesWithoutCleanup, TestHeadBeltEmptyBaseForeignPublicationFences (core/storage/chunk_head_belt_test.go) |
— | ACTIVE |
INV-WS-HEAD-MONOTONE-001 |
HEAD epoch and RemoteLSN never decrease. |
M4, M5 CAS | core/frontend/chunkstore/layout/commit.go Head.Commit (the position); core/frontend/chunkstore/layout/claim.go Head.Claim (the epoch); core/frontend/chunkstore/layout_remote.go prepareCommitLocked (a commit at another epoch is refused) |
TestCommit_PositionIsMonotonic (core/frontend/chunkstore/layout/commit_monotonic_test.go); TestMemChunkRemote_RefusesLowerRemoteLSN (core/storage/chunk_layer_lsn_order_test.go, on the in-memory remote); TestNativeReplacementCutBehindHEADRefuses (core/storage/legacy_replacement_v3_test.go) |
WorkspaceTakeover HeadMonotone |
ACTIVE |
INV-WS-HEAD-KEY-PROVENANCE-001 |
RETIRED at the cut-over to the content-named store: intents are gone and a content name may be written again. Replaced by INV-SNAPK-COMMIT-REACH-001. |
M5 Manifest → CAS | — (PrepareManifest and core/frontend/chunkstore/manifest.go were deleted) |
— | — | ARCHIVED |
INV-WS-REOPEN-FENCE-001 |
Retired: the legacy same-holder reopen replaced HEAD generation. B fences by claim id and local-root lineage (INV-SNAPK-START-ROOT-001, INV-SNAPK-START-CLAIM-001, INV-SNAPK-STALE-HOLDER-001); an ordinary same-root reopen may leave HEAD unchanged. |
legacy M4 | — | — | — | ARCHIVED |
INV-WS-SEALED-REOPEN-001 |
A same-epoch Start cannot reactivate a detached HEAD: it refuses before another HEAD update or serving, preserving its current root, position and detached state for a higher-epoch claimant. | M9 detached → higher-epoch idle | core/frontend/chunkstore/layout/start.go Start; core/frontend/chunkstore/layout/claim.go Claim |
TestCommitDetached_ProofAndLostReply, TestDetachedHEAD_RefusesEveryHolderTransition (core/frontend/chunkstore/layout/detached_test.go); TestRestoreEqualOwnerDetachedHEADStaysSealed (core/frontend/durable/provider_seed_order_test.go) |
INV-SNAPK-DETACHED-001 |
ACTIVE |
INV-WS-SEAL-REPLAY-001 |
A repeated plain seal, also after a same-epoch detached restart, succeeds only from a fresh B HEAD with exact epoch, holder and local claim id. It returns that HEAD/frontier without a new generation. An unreadable or mismatched proof cannot be answered from process memory. | B detached HEAD read | core/frontend/durable/provider_seal_replay.go replayPlainSeal, readLayoutSeal; cmd/blockvolume/workspace_lease.go workspaceLayoutDetachedGeneration |
TestLayoutPlainDetachReplayAfterRestartNeedsNoLegacyFactory (core/frontend/durable/provider_layout_plain_replay_test.go); TestWorkspaceLayoutDetachedProof (cmd/blockvolume/workspace_layout_proof_test.go) |
K1: detached proof belongs to the exact claim; PlainSealReplay SuccessNeedsFreshExactProof, ValidProofDoesNotNeedProcessMemory (mutants PlainSealReplay_memory, PlainSealReplay_no_exact, PlainSealReplay_layer) |
ACTIVE |
INV-WS-CAS-UNKNOWN-001 |
An unknown HEAD CAS outcome is settled by re-reading HEAD, never by a blind retry; until it is settled the proposal stays pending and its session stays open; settlement replays the same commit in it. | M5 CAS → Pending | core/storage/chunk_layer.go captureLocked, resolvePending; core/frontend/chunkstore/layout_remote.go |
TestChunkLayer_C6_UnknownNotAppliedNeverClaimsSuccess (core/storage/chunk_layer_contract_test.go); TestSession_UncertainCommitIsNotAbortedUntilSettled (core/storage/chunk_layer_session_test.go); TestLayoutRemote_LostReplyOfTheFirstCutIsNotAFence, TestLayoutRemote_LostReplyOfALaterCutWithAnInheritedChunkIsNotAFence, TestLayoutRemote_LostReplyOfANoOpCutIsNotAFence (core/frontend/chunkstore/layout_remote_same_proposal_test.go); TestLevelZeroCutRefusalDoesNotBecomeAnUnresolvedPublication (core/frontend/chunkstore/layout_format_refusal_test.go); TestARefusedReproposalDoesNotSettleAnEarlierUnknownWrite, TestARefusedConfirmationReadDoesNotUnpublishTheSuccessfulWrite (core/storage/chunk_head_refusal_test.go) |
— | ACTIVE |
INV-WS-CLAIM-BEFORE-SERVE-001 |
A new B holder claims HEAD at its issued epoch only after the local root is validated against the HEAD it updates; an older epoch or another holder at the same epoch is refused, and guest writes stay closed until assignment and claim. | M9 Start → Claim → Serving | core/frontend/chunkstore/layout/start.go Start; core/frontend/durable/provider_layout.go startLayoutRoot |
TestStart_ValidatesAgainstTheHeadItUpdates, TestStart_Refusals (core/frontend/chunkstore/layout/start_test.go); TestStart_TheClaimRechecksTheSeedRule (core/frontend/chunkstore/layout/start_seed_test.go); TestFreshStoreRefusesWriteBeforeAssignmentThenPublishesAfterClaim (core/frontend/durable/provider_restore_schedule_test.go) |
INV-SNAPK-START-LINEAGE-001, INV-SNAPK-START-CLAIM-001 |
ACTIVE |
INV-VOL-GEOMETRY-FLAGS-RECORD-001 |
A create-mode start whose --durable-blocks/--durable-blocksize disagree with the volume record exits 78 before any local store exists; an existing store is checked only at attach; an absent record keeps the create path; an unread record exits 75 (filer failed) or 78 (corrupt). |
blockvolume startup (before the durable provider) | cmd/blockvolume/main.go; cmd/blockvolume/chunk_remote.go geometryFlagsRefusal; core/frontend/chunkstore/layout/volume.go, start.go, create.go; core/frontend/chunkstore/catalog_b.go |
TestGeometryFlagsRefusalComparesTheRecord, TestVolumeRequiresGeometry, TestVolumeGeometryChecksAndIsImmutable, TestStartGeometryMismatchPrecedesClaim, TestBCatalogRestoreCopiesVolumeGeometry, TestVolumeGeometryLivesOnlyInVolume |
K3: immutable required VOLUME geometry; Start checks the local persisted shape before claim; restores copy source geometry; no resize or compatibility path. | ACTIVE |
INV-WS-STALE-LOCAL-ROOT-001 |
An old or rolled-back local root is refused by layout.Start before serving; synchronous and deferred attach end without retry and report the typed stale-root error and cure. A fresh root at its own epoch likewise ends with ErrMissingLocalRoot and its cure. |
M4 Claiming → Refused | core/frontend/durable/provider_layout.go startLayoutRoot; core/frontend/durable/provider_chunk.go recoverChunk, chunkAuthorityWait; core/frontend/durable/provider_startup.go endChunkStartup |
TestLayoutProviderRefusesEmptyOwnEpochAndRemountedOldRoot, TestFinalLayoutStartRefusalTable (core/frontend/durable/provider_layout_test.go, provider_layout_start_class_test.go) |
— | ACTIVE |
INV-WS-ONE-PROCESS-PER-HOST-001 |
One host runs at most one live blockvolume per volume: each takes the volume's exclusive host lock before its store opens and holds it until the store closes; a second is refused before it opens anything, whatever its --durable-root. |
M4 (start) → Attaching, Refused | core/frontend/durable/provider.go DurableProvider.lockVolumeOnHost |
TestOneLiveProcessPerVolumePerHost, TestHostVolumeLockDirectoryCreatedOrRefused, TestHostVolumeLockRefusesNonDirectoryLockPath, TestHostVolumeLockTakesReadOnlyLockFile (core/frontend/durable/one_process_per_volume_test.go); TestHostVolumeLockCreatesParent0755AndLocks0700, TestHostVolumeLockKeepsExistingDirectoryModes (core/frontend/durable/volume_lock_parent_mode_test.go); TestVolumeLockDirTestOnlyRefusedUnderSystemd (cmd/blockvolume/volume_lock_flag_test.go) |
— | ACTIVE |
INV-CHUNK-LEASE-REQUIRED-001 |
Blockvolume refuses walstore-chunk startup without --workspace-lease before any host or store is opened. The refusal names concurrent acknowledging writers and acknowledged-write loss after a forced move; plain walstore startup is unchanged. | M4 startup → Refused | cmd/blockvolume/main.go parseFlags |
TestChunkVolumeRequiresWorkspaceLeaseBeforeStart |
— | ACTIVE |
INV-WS-CONDITIONAL-HEAD-001 |
Catalog startup requires a wrong-generation conditional update of a disposable HEAD to be definitely refused and leave its bytes and generation unchanged. Unknown probe outcomes refuse admission; cleanup failures only warn with the leftover path. No volume HEAD is used. | M4 startup → Refused | core/frontend/chunkstore/swfs_catalog.go DialBCatalog; startup_head_probe.go checkConditionalHead |
TestCatalogStartupRequiresWrongGenerationHeadRefusal, TestConditionalHeadNextStartCleansCrashLeftovers, TestConditionalHeadSweepWaitsAndLeavesNewProbes, TestCatalogStartupDoesNotWaitForUndeletableProbe, TestLayoutIdentityWriterAndReaders |
— | ACTIVE |
INV-WS-CHUNK-CONDITION-PROBE-001 |
Catalog startup and sw-block metadata writers turn the chunk guard on only if the filer definitely refuses a mismatched chunk-condition update of a disposable HEAD; any other answer leaves the page re-read as the only check. No version string is read; the startup log and /status/chunk name it. | M4 startup | core/frontend/chunkstore/startup_head_probe.go probeChunkCondition, ProbeChunkGuard; catalog_b.go Store, MetadataGuard, Usage; cmd/sw-block/chunk_b.go bCatalog |
TestTheStartupProbeTurnsTheChunkGuardOnOnlyForAFilerThatEnforcesIt (core/frontend/chunkstore/startup_chunk_condition_probe_test.go), TestAFailedChunkGuardProbeLeavesTheGuardOff (core/frontend/chunkstore/chunk_guard_report_test.go), TestCatalogStartupRequiresWrongGenerationHeadRefusal (core/frontend/chunkstore/startup_head_probe_test.go), TestStatusServer_StatusChunkUsage (core/host/volume/status_chunk_test.go), TestOpsChunkWritingCatalogRunsTheChunkConditionProbe, TestOpsChunkWritingCatalogProbeIsBoundedByTheTimeout (cmd/sw-block/chunk_guard_probe_test.go) |
MetaABA r2, checked outside the repository: guard on = safe_chunks_equal; the fallback is the re-read, which a chunk still queued for deletion defeats (mut_reread_delayed) |
ACTIVE |
INV-WS-SINGLE-FILER-001 |
Startup requires all configured masters to answer and agree on a leader; only that leader listing exactly the target filer and confirming leadership afterward admits. Followers' lists do not decide. Unknown views retry within 60 s. This census does not fence later filer registration. | M4 (startup) → Refused | core/frontend/chunkstore/single_filer.go CheckSingleFiler; cmd/blockvolume/chunk_remote.go newChunkWiring; cmd/sw-block/chunk.go refuseUnlessSingleFiler |
TestSingleFilerCensusUsesTheAgreedLeader; TestCheckSingleFilerRefusesAnotherOrSeveralFilers, TestCheckSingleFilerFailsClosed, TestCheckSingleFilerNeedsEveryMasterToAnswer, TestIsTargetComparesScopedAddresses, TestCheckSingleFilerPasses (core/frontend/chunkstore/single_filer_test.go), TestChunkWiringRefusesAMultiFilerGroup (cmd/blockvolume/single_filer_test.go), TestOpsChunk_WritingCommandsRunTheSingleFilerCheck (cmd/sw-block/chunk_start_check_test.go), TestOpsChunk_VerifyRunsTheSingleFilerCheck (cmd/sw-block/chunk_verify_test.go) |
— | ACTIVE |
INV-CLI-SINGLE-FILER-CLIENT-001 |
Chunk metadata commands refuse missing, typed-nil and non-SWFS clients before catalog access; only a live SWFS client can run the census. | M4 startup client admission | cmd/sw-block/chunk.go checkSingleFiler, refuseUnlessSingleFiler |
TestSingleFilerCheckRefusesUnsupportedClients, TestOpsChunkWritingRefusesUnsupportedFilerBeforeCatalogAccess |
— (client capability guard) | ACTIVE |
INV-WS-LEASE-REGRANT-001 |
Re-grant after expiry keeps the same holder and epoch, with no pending move or revocation, a certain store, and one durable write after the horizon/deadline plus skew barrier. Restart begins a new session and voids the old; ordinary reopen keeps HEAD identity (epoch, holder, claim) unchanged. | M2 Expired → Granted; M9 Start | core/authority/workspace_lease_view.go regrantWorkspaceLease; core/authority/workspace.go forcedMoveBarrierLocked; core/frontend/chunkstore/layout/start.go Start |
TestWorkspaceLeaseExpiredSameHolderRegrantIsDurable, TestWorkspaceLeaseRegrantWaitsForFullSkew, TestWorkspaceLeaseRegrantDefeatsAlreadyPassedForcedPreflight, TestWorkspaceLeaseForcedIssueDefeatsOldHolderRegrant, TestWorkspaceLeaseRegrantWaitsForDurabilityAndLatchesFailure (core/authority/workspace_regrant_test.go); TestWorkspaceLeaseRegrantPreservesLocalLogThroughFirstCut (core/authority/workspace_regrant_storage_test.go); TestStart_OwnEpochFreshRootRefusedBeforeClaim, TestStart_OwnEpochSameRootContinues (core/frontend/chunkstore/layout/start_test.go); TestClaim_WritesItsClaimID, TestRunClaim_VoidsTheOldSession (core/frontend/chunkstore/layout/claim_test.go); TestLocalReopenClaimsBeforeServing (core/frontend/durable/provider_reopen_belt_test.go) |
WorkspaceRegrant NoDualServingInc, RegrantNoLoss, DiskCoversMemory; INV-SNAPK-START-ROOT-001 |
ACTIVE |
INV-WS-LEASE-001 |
A host admits frontend I/O and cuts only under an unexpired lease for its exact {volume, replica, epoch}; a fenced guard never reopens, even on a late renewal reply. |
M4 lease guard: Valid → Fenced | core/host/volume/workspace_lease.go permits, Refresh |
TestWorkspaceLeaseExpiryFencesWithoutTimerAndCannotReopen, TestWorkspaceDelayedRenewalCannotUndoExpiry (core/host/volume/workspace_lease_test.go); TestWorkspaceHostRequiresLeaseBeforeFrontendAndCut (core/host/volume/workspace_runtime_test.go); TestWorkspacePausedGranteeRefusedAtAttach (core/host/master/workspace_paused_grantee_test.go) |
WorkspaceTakeover NoDualServing |
ACTIVE |
INV-WS-RECORDED-REVOKE-FINAL-001 |
A renewal for the current revoking lease with a matching recorded ACK returns typed FINAL. The restarted holder exits once with status 79, which shipped units do not restart. Without a recorded ACK, revocation retains its drain/retry answer. | M2 Acked renewal, M4 startup final exit | core/authority/workspace_lease_view.go; core/host/master/workspace_service.go; core/host/volume/master_wait.go; cmd/blockvolume/process_exit.go; deploy/systemd |
TestRevokingRenewalIsFinalOnlyAfterRecordedAck, TestRevokingRenewalRPCIsFinalOnlyWhenAckIsRecorded, TestRestartedRecordedRevocationExitsFinalOnce, TestBlockvolumeUnitsPreventRestartAfterRecordedRevocation, TestRecordedRevocationFinalRequiresTypedFailedPrecondition |
WorkspaceTakeover CleanNoLoss; no authority state change | ACTIVE |
INV-WS-REVOKE-ACK-RECORDED-001 |
A matching recorded revocation stop is answered before lease checks without writing or extending the lease. An expired lease still refuses a first ACK, and a changed replica, epoch, holder or stopped position never replays another ACK. | M2 revocation ACK replay, no state change | core/authority/workspace.go AckWorkspaceRevocation |
TestRecordedRevocationAckRetryAfterDeadline, TestRecordedAckLostReplyAfterMasterDeadlineDrainsWithoutRetryExit, TestUnrecordedRevocationAckStillRefusesAfterDeadline |
WorkspaceTakeover CleanNoLoss; replay stutters | ACTIVE |
INV-WS-REVOKE-ACK-001 |
A host acknowledges a revocation only after its frontend and cuts have stopped; a cancelled or expired drain sends no acknowledgement. | M4 lease guard: Revoking → Acked | core/host/volume/workspace_lease.go drain |
TestWorkspaceRevocationAckOnlyAfterFrontendAndCutsStop (core/host/volume/workspace_lease_test.go); TestWorkspaceHostCancelOrExpiryDuringRevokeDrainNeverACKs (core/host/volume/workspace_runtime_test.go); TestWorkspaceRevocationAckOutlastsTheMastersBoundedSteps, TestWorkspaceRevocationAckIsCutAtTheLeaseDeadline (core/host/volume/workspace_ack_budget_test.go); TestWorkspaceRevocationAckIsAskedAgainAfterALostAnswer, TestWorkspaceCloseoutFitsTheUnitsStopBudget (cmd/blockvolume/process_exit_ack_retry_test.go) |
WorkspaceTakeover CleanNoLoss |
ACTIVE |
INV-WS-REVOKE-ACK-RETRY-001 |
A holder's revocation ACK is asked again only after a call that got no answer (DeadlineExceeded, Unavailable), within its lease deadline and the units' stop budget (19 s closeout); the master answers a repeat of a recorded ACK as recorded while the line is revoking. |
M4 lease guard: Revoking → Acked; M2 Revoking → Revoked | core/host/volume/workspace_lease.go drain, retryableAckError; cmd/blockvolume/process_exit.go workspaceLeaseCloseoutTimeout; core/authority/workspace.go AckWorkspaceRevocation (a repeat returns nil) |
TestWorkspaceRevocationAckIsAskedAgainAfterALostAnswer, TestWorkspaceCloseoutFitsTheUnitsStopBudget (cmd/blockvolume/process_exit_ack_retry_test.go); TestWorkspaceRevocationAckIsCutAtTheLeaseDeadline (core/host/volume/workspace_ack_budget_test.go); TestWorkspaceRevocationAckRetryAgainstTheRealMaster (core/host/master/workspace_ack_retry_test.go) |
— | ACTIVE |
INV-WS-STOP-PENDING-001 |
From when the detach hook of a chunk detach runs until the lease guard fences, or until that detach's resume clears stop-pending, each sleep of the guard after a completed renewal is at most 250 ms on the local monotonic clock. | M4 lease guard: Valid → StopPending → Valid | Fenced | core/host/volume/workspace_lease.go StopPending, ClearStopPending, renewDelay, Run; core/host/volume/workspace_runtime.go WorkspaceStopPending, WorkspaceStopResumed; core/frontend/durable/provider_chunk.go DetachVolume, detachVolume, resumeAfterDetach; cmd/blockvolume/main.go run (wiring) |
TestWorkspaceLeaseStopPendingSchedule, TestWorkspaceHostStopResumedClearsOnlyTheLatestAttempt, TestWorkspaceHostFailedDetachStopPendingByOutcome, TestWorkspaceHostDetachHookFencesWithinPoll, TestWorkspaceLeaseStopPendingNeverBlocks (core/host/volume/workspace_lease_stop_pending_test.go); TestWALStoreChunk_DetachHookPrecedesDrain, TestWALStoreChunk_DetachResumeHookOnlyOnProvenAbort, TestWALStoreChunk_DetachCallsStopHook (core/frontend/durable/provider_chunk_detach_hook_test.go) |
— | ACTIVE |
INV-WS-BINDING-RECONCILE-001 |
After an interruption before or after any binding Retire, startup replay converges to the retirements required by issued cross-host moves; clean-release ACKs retain the same-host restart reservation. | M2 restart recovery (existing move/ACK journal replay; no new transition) | core/host/master/workspace_binding.go reconcileWorkspaceBindings; Host.New |
TestWorkspaceBindingReconcileInterruptedAtEveryRetireConverges (core/host/master/workspace_binding_reconcile_interrupt_test.go; supported directory-fsync host required) |
- (product restart regression) | ACTIVE |
INV-WS-BINDING-AUTHORITY-001 |
Replaying binding retirements does not change durable authority history. | M2 restart recovery (existing move/ACK journal replay; no new transition) | core/host/master/workspace_binding.go reconcileWorkspaceBindings |
TestWorkspaceBindingReconcileInterruptedAtEveryRetireConverges (core/host/master/workspace_binding_reconcile_interrupt_test.go; supported directory-fsync host required) |
- (authority history compared across restart) | ACTIVE |
INV-WS-BINDING-REPLAY-001 |
Repeating recorded binding retirements preserves the persisted binding bytes. | M2 restart recovery (existing move/ACK journal replay; no new transition) | core/lifecycle/workspace_bindings.go Retire, update |
TestWorkspaceBindingReconcileInterruptedAtEveryRetireConverges (core/host/master/workspace_binding_reconcile_interrupt_test.go; supported directory-fsync host required) |
- (byte-identical replay) | ACTIVE |
INV-WS-BINDING-WATERMARK-001 |
A retirement replay at an already-recorded epoch preserves a re-prepared binding and its watermark. | M2 restart recovery (existing move/ACK journal replay; no new transition) | core/lifecycle/workspace_bindings.go Retire, Register |
TestWorkspaceBindingReconcileInterruptedAtEveryRetireConverges (core/host/master/workspace_binding_reconcile_interrupt_test.go; supported directory-fsync host required) |
- (post-recovery watermark protection; hidden legacy prefix not directly observed) | ACTIVE |
INV-WS-BINDING-SAME-HOST-001 |
An issued same-host move does not schedule retirement of its own target reservation. | M2 restart recovery (existing move/ACK journal replay; no new transition) | core/host/master/workspace_binding.go reconcileWorkspaceBindings |
TestWorkspaceBindingReconcileInterruptedAtEveryRetireConverges (core/host/master/workspace_binding_reconcile_interrupt_test.go; supported directory-fsync host required) |
- (call-selection coverage; not an active-successor liveness test) | ACTIVE |
INV-WS-SAME-HOST-CLEAN-MOVE-001 |
A same-host move issues a higher epoch: a clean move needs the current holder's sealed HEAD and its recorded epoch/holder/position ACK, and the successor reads that sealed image; a forced move needs the normal lease barrier and a durable lost-range record. | M2 Acked or Expired → Moved; M9 detached → higher-epoch idle | core/authority/workspace.go validateWorkspaceMoveRequest, prepareWorkspaceMoveLocked; core/host/master/workspace_service.go workspaceMoveCheckLocked; core/frontend/chunkstore/layout/start.go Start, core/frontend/chunkstore/layout/claim.go Claim; cmd/sw-block/volume_start_release.go prepareVolumeStart, startLineOwner |
TestWorkspaceSameHostForcedMoveRecordsLostRange (core/authority/workspace_same_host_forced_test.go); TestWorkspaceRPCSameHostForcedRecoveryRecordsLoss (core/host/master/workspace_same_host_forced_test.go); TestWorkspaceSameHostCleanMoveUsesOvernightSeal (core/authority/workspace_same_host_clean_test.go); TestWorkspaceRPCSameHostCleanMoveKeepsTheReleasedBinding (core/host/master/workspace_same_host_clean_test.go); TestLayoutSameHostCleanSuccessorReadsSealedImage (core/frontend/durable/provider_layout_same_host_clean_test.go); TestVolumeStopThenStartMovesBeforeEnablingTheUnit, TestVolumeStartLostMoveAnswerUsesTheVisibleGrant, TestVolumeStartRevokedWithoutReleaseRefusesBeforeTheUnit (cmd/sw-block/volume_start_release_test.go); TestVolumeStartReleaseAgainstRealMaster (cmd/sw-block/volume_start_release_master_linux_test.go); TestVolumeStartWithOperatorMutualTLS (cmd/sw-block/volume_start_operator_linux_test.go); TestVolumeStartNeverRegistersBindings, TestVolumeStartMovedAwayNeverPrintsAForceCommand (cmd/sw-block/volume_start_release_test.go); TestVolumeStartPreparedTargetNeverBecomesTheLineOwner (cmd/sw-block/volume_start_owner_history_linux_test.go); TestVolumeStartFreshSpecBeforeAnyPublishedLine (cmd/sw-block/volume_start_owner_history_linux_test.go); TestVolumeStartNewFreshAndOlderMasterUseTheirOwnPaths, TestVolumeStartNeverPublishedCannotOverrideAuthorityHistory (cmd/sw-block/volume_start_release_test.go); TestVolumeStopWithoutBindingKeepsTheLegacyMode (cmd/sw-block/volume_release_test.go) |
WorkspaceRegrant SameHostLoadsSealed; INV-SNAPK-DETACHED-001. The B provider test performs a real plain detach, same-host higher-epoch fresh-root Start, and reads the sealed bytes. |
ACTIVE |
INV-WS-DELETE-NO-LIVE-HOLDER-001 |
A workspace volume is marked deleting only with no live holder (TERM-LIVE-HOLDER-001): no line, a clean revocation ACK for the line, or HEAD below the line's epoch. A sealed HEAD without an ACK, a live or unreadable one is refused; the HEAD compare-and-swap to deleting fences a later claim. |
M2 none/Granted/Revoking/Expired → Deleting | core/authority/workspace_holder_state.go WorkspaceHolderState; core/authority/workspace.go RecordWorkspaceDeletion; core/host/master/services.go MarkVolumeDeleting, deleteHolderEvidence |
TestWorkspaceHolderState (core/authority/workspace_holder_state_test.go); TestDeleteAdmitsANeverStartedLine (core/host/master/workspace_delete_never_started_test.go); TestDeleteAdmissionVerdicts (core/authority/workspace_delete_admission_test.go); TestMarkVolumeDeleting_RefusedWhileAssigned (core/host/master/volume_deleting_test.go) |
NeverStarted r2 DeleteNeverStrandsALiveHolder, NoServedWriteLost, re-run can finish, re-run can settle (exhaustive, 21 of 21 configurations as expected). Not modelled: two delete processes at the same instant; the gap between HEAD deleted and the volume marked deleted. Limit (v1): a never-started line that holds a lease is deleted once its lease horizon passed (about 60 s; the reservation refuses a live lease before it); the immediate exit is 1.0.1 |
ACTIVE |
INV-WS-CLEAN-MOVE-001 |
A clean move is granted only with a detached HEAD from the expected holder and a revocation ACK matching its epoch, holder and published position; generation is readout only. | M2 lease: Acked → Moved | core/authority/workspace.go prepareWorkspaceMoveLocked, AckWorkspaceRevocation; core/host/master/workspace_layout_head.go NewLayoutWorkspaceHEADReader |
TestWorkspaceCleanMoveNeedsDetachedHEADAndRevocationAck (core/authority/workspace_test.go); TestWorkspaceLayoutHEADUsesTheMasterIdentity, TestWorkspaceLayoutHEADRefusalsAndStates, TestWorkspaceLayoutHEADReaderWiring; also in core/host/master/workspace_layout_head_test.go, cmd/blockmaster/workspace_layout_head_test.go |
WorkspaceTakeover CleanNoLoss |
ACTIVE |
INV-WS-FORCED-MOVE-001 |
A forced move is admitted only after the granted or restart deadline plus the clock-skew bound has passed for the lease the last move issue started (never a predecessor's; INV-WS-RESTART-GRACE-001): see M2 Expired → Moved (forced). |
M2 lease: Expired → Moved (forced) | core/authority/workspace.go prepareWorkspaceMoveLocked, WorkspaceForcedMoveAdmitted, forcedMoveAdmissionLocked, forcedMoveBarrierLocked, workspaceHeadAdmits; core/host/master/workspace_service.go MoveWorkspace, workspaceMoveCheckLocked |
TestWorkspaceSkewSeparatesOldServingFromForcedGrant (core/host/master/workspace_skew_test.go); TestWorkspaceClockSkewPersistsAndProtectsRestart (core/authority/workspace_skew_test.go); TestWorkspaceForcedMoveRequiresExplicitForceAndLeaseExpiry (core/authority/workspace_test.go); TestForcedAdmissionIgnoresAPersistedHorizon (core/authority/workspace_restart_grace_test.go); TestWorkspaceRenewalRPCDuringHeldSameVolumeReservation (core/host/master/workspace_lease_horizon_test.go); TestWorkspaceUnclaimedGrantForcedReassignAfterExpiry, TestWorkspaceUnclaimedGrantHEADRule, TestWorkspaceLateClaimThenUnclaimedGrantForcedReassign (core/authority/workspace_unclaimed_grant_test.go); TestWorkspaceForcedMoveAdmittedMatchesMoveAdmission (core/authority/workspace_forced_admission_test.go); TestWorkspaceUnclaimedGrantForcedReassignOverRPC (core/host/master/workspace_unclaimed_grant_test.go); TestWorkspacePausedGranteeRefusedAtAttach (core/host/master/workspace_paused_grantee_test.go); TestProcedureMasterUnreachableFencesBeforeForcedMove (cmd/blockvolume/master_loss_integration_test.go, tags subprocess chunkstore_integration) |
— | ACTIVE |
INV-WS-FORCED-MOVE-REPLY-001 |
The lease expiry the master reports to a host is the granted expiry (the deadline), never a persisted value. | M2 Granted → Granted; Granted → Revoking | core/authority/workspace_lease_view.go RenewWorkspaceLease, WorkspaceLeaseReply, replyExpiryNS; core/host/master/workspace_service.go RevokeWorkspace |
TestWorkspaceSameVolumeRenewalDuringHeldWrite (core/authority/workspace_lease_horizon_test.go); TestWorkspaceUnclaimedGrantForcedReassignAfterExpiry (core/authority/workspace_unclaimed_grant_test.go) |
— | ACTIVE |
INV-WS-FORCED-MOVE-HALF-SKEW-001 |
The validity the master gives a host with a lease ends half the clock-skew bound before the reported lease expiry. | M2 Granted → Granted (reply); M4 NoLease, Valid → Valid | core/authority/workspace_lease_view.go WorkspaceLeaseValidity, workspaceLeaseValidityAt; core/host/master/workspace_service.go leaseFact; core/authority/workspace.go AckWorkspaceRevocation; core/host/volume/workspace_lease.go Refresh |
TestWorkspaceLeaseFactUsesPublisherClockAndSkew (core/host/master/workspace_skew_test.go); TestWorkspaceAckUsesGrantedHalfSkewBoundary (core/authority/workspace_validity_test.go); TestWorkspaceSkewSeparatesOldServingFromForcedGrant (core/host/master/workspace_skew_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-READOUT-001 |
Every issued forced grant the master returns, also on a replay and after a restart, carries the lost range stored in the authority store before the issue, never a recomputed one: see M2 Moved → epoch issued. | M2 lease: Expired → Moved (forced); Moved → epoch issued | core/authority/workspace_lost_range.go recordLostRangeLocked, WorkspaceLostRangeReadouts, encodeLostRangeEnvelope; core/authority/workspace.go prepareWorkspaceMoveLocked; core/host/master/workspace_layout_head.go NewLayoutWorkspaceHEADReader; core/host/master/workspace_service.go grantWithLostRange, issuedRecord; core/rpc/wsclient/wsclient.go Readout |
TestWorkspaceForcedMoveRecordsTheLostRange, TestWorkspaceForcedMoveLostRangeOrdering, TestWorkspaceForcedReservationResumeNeedsItsRange (core/authority/workspace_lost_range_test.go); TestWorkspaceForcedMoveStoresHeadFilerTime (core/authority/workspace_lost_range_readout_test.go); TestWorkspaceForcedMoveLostRangeOverRPC (core/host/master/workspace_lost_range_readout_test.go); TestReadoutWording (core/rpc/wsclient/wsclient_test.go); TestWorkspaceForceMove_Row3and4_SentAndGranted (cmd/sw-block/workspace_test.go); TestWorkspaceForceMoveAgainstRealMaster (cmd/sw-block/workspace_master_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-QUERY-001 |
QueryWorkspaceLostRange returns the stored ranges unchanged: every issued forced move's range in issue order, or the single range of a given request id. |
M2 lease: Moved → epoch issued (readout) | core/authority/workspace_lost_range.go WorkspaceLostRangeReadouts; core/host/master/workspace_service.go QueryWorkspaceLostRange; core/rpc/wsclient/wsclient.go LostRanges; cmd/sw-block/workspace.go runWorkspaceLostRange |
TestWorkspaceLostRangeAccumulatesInIssueOrder (core/authority/workspace_lost_range_readout_test.go); TestLostRangesBindsTheAnswer (core/rpc/wsclient/wsclient_test.go); TestWorkspaceLostRangeListsAllInOrder (cmd/sw-block/workspace_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-FAILCLOSED-001 |
If an issued forced move's range record is missing or fails its range or HEAD-time checksum, the readout fails: the grant carries no range but the reason, the query returns DataLoss, the CLI exits 4; none reports the move as no loss. |
M2 lease: Moved → epoch issued | core/authority/workspace_lost_range.go LoadWorkspaceLostRanges, decodeLostRangeHeadTimes, WorkspaceLostRangeReadouts; core/host/master/workspace_service.go grantWithLostRange, QueryWorkspaceLostRange; core/rpc/wsclient/wsclient.go classify, checkRange; cmd/sw-block/workspace.go runWorkspaceForceMove, runWorkspaceLostRange |
TestWorkspaceLostRangeReadoutFailsClosed, TestWorkspaceLostRangeHeadTimeTamperFailsClosed, TestWorkspaceLostRangeSkippedWriteIsDetected (core/authority/workspace_lost_range_readout_test.go); TestForceMoveGrantWithoutRangeIsUnproven (core/rpc/wsclient/wsclient_test.go); TestWorkspaceForceMove_Row7_ReadoutUnproven (cmd/sw-block/workspace_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-AUDIT-001 |
The master's log records every issued forced move it answers, a replay and an answer that failed after the issue included. | M2 lease: Moved → epoch issued | core/host/master/workspace_service.go MoveWorkspace, logForcedGrant |
TestWorkspaceForcedMoveLostRangeOverRPC (core/host/master/workspace_lost_range_readout_test.go); TestWorkspaceForceMovePostIssueFailureKeepsTheOutcome (cmd/sw-block/workspace_postissue_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-CLIENT-UNKNOWN-001 |
The operator client reports an Internal or transport failure of a forced move as an unknown outcome and directs a rerun with the same request id, never a new one. |
M2 lease: Moved → epoch issued (client side) | core/rpc/wsclient/wsclient.go classify, ForceMove; cmd/sw-block/workspace.go runWorkspaceForceMove, shellCommand |
TestWorkspaceForceMove_Row6_OutcomeUnknown, TestWorkspaceForceMove_Row8_RerunSameRequestID, TestWorkspaceForceMoveRecoveryCommandRuns (cmd/sw-block/workspace_test.go); TestWorkspaceForceMovePostIssueFailureKeepsTheOutcome (cmd/sw-block/workspace_postissue_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-UNCERTAIN-001 |
A move whose issuing write may have reached the store while memory shows it unissued fails with ErrWorkspaceOutcomeUncertain, is answered Internal as an unknown outcome (restart, then the same request id) and is logged as unknown, never as a refusal. |
M2 lease: Moved → epoch issued | core/authority/authority.go applyWithWorkspaceMove; core/authority/workspace.go WorkspaceMoveOutcomeError, MoveWorkspace; core/host/master/workspace_service.go MoveWorkspace |
TestWorkspaceUncertainIssueWriteIsTyped (core/authority/workspace_outcome_uncertain_test.go); TestWorkspaceForceMoveUncertainIssueWriteIsUnknown (cmd/sw-block/workspace_uncertain_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-PRE-ISSUE-001 |
Except for the unknown outcomes of INV-WS-LOST-RANGE-UNCERTAIN-001 and INV-AUTH-UNCERTAIN-001 and for cancellation or deadline, a move refused or failing before its issue is answered FailedPrecondition, and the operator client reports a refusal (exit 1). |
M2 lease: Acked or Expired → (move refused, nothing written); Expired → Moved (forced) | core/host/master/workspace_service.go workspaceError, MoveWorkspace, workspaceMoveCheckLocked; core/rpc/wsclient/wsclient.go classify; cmd/sw-block/workspace.go runWorkspaceForceMove |
TestWorkspaceUncertainIssueWriteIsTyped (core/authority/workspace_outcome_uncertain_test.go); TestWorkspaceMoveUnknownPrecedesAdmissionRefusals (core/host/master/workspace_uncertain_precedence_test.go); TestWorkspaceForceMove_Row5_MasterRefusal (cmd/sw-block/workspace_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-CLIENT-GRANT-001 |
The operator client accepts a forced grant only if it is issued, of kind forced, and matches the request's id, volume, expected holder and epoch, target replica and host, with a higher new epoch; otherwise the outcome is unknown. | M2 lease: Moved → epoch issued (client side) | core/rpc/wsclient/wsclient.go checkGrant, ForceMove |
TestForceMoveBindsGrantAndRange (core/rpc/wsclient/wsclient_test.go); TestWorkspaceForceMoveRejectsAMismatchedAnswer (cmd/sw-block/workspace_test.go) |
— | ACTIVE |
INV-WS-LOST-RANGE-CLIENT-RANGE-001 |
The operator client accepts a grant's lost range only if it names the grant's volume, request id, old and new epochs, old replica and HEAD generation, and starts at the grant's remote LSN; otherwise the readout is unproven. | M2 lease: Moved → epoch issued (client side) | core/rpc/wsclient/wsclient.go checkRange, ForceMove |
TestForceMoveBindsGrantAndRange, TestForceMoveGrantWithoutRangeIsUnproven (core/rpc/wsclient/wsclient_test.go) |
— | ACTIVE |
INV-CLI-FORCED-LOSS-001 |
An issued forced-move JSON answer retains the kept HEAD generation and LSN; proven lost ranges carry their kept-through LSN and time bound, while unproven ranges are explicit and supply no guessed bounds. | M2 forced move readout, output only | cmd/sw-block/workspace.go workspaceForceMoveAnswer.issued |
TestWorkspaceForceMoveJSONGoldenAnswers, TestWorkspaceForceMoveJSONKeepsLocalConfirmationAndIssuedReadoutExits |
MoveAdmission.ReadForMove; no transition change | ACTIVE |
INV-CLI-FORCED-JSON-001 |
Force-move JSON reports typed admission, barrier and refusal code; only a validated issued grant supplies a move id and target epoch, host and replica. Failure exits use the shared policy and documented compatibility rows. | M2 Expired → Moved (forced), output only | cmd/sw-block/workspace.go; core/rpc/wsclient/wsclient.go; core/host/master/workspace_service.go |
TestWorkspaceForceMoveJSONGoldenAnswers, TestWorkspaceForceMoveJSONDoesNotGuessAdmission, TestWorkspaceForceMoveJSONKeepsLocalConfirmationAndIssuedReadoutExits, TestWorkspaceForcedMoveLostRangeOverRPC |
MoveAdmission.ReadForMove; no transition change | ACTIVE |
INV-WS-FORCED-CONFIRM-001 |
The OSS operator client (sw-block ops workspace force-move, wsclient.ForceMove) sends force: true only when --confirm-forced is exactly <volume>@<expected epoch> (that volume, a positive decimal epoch), and then as kind forced at that epoch with the operator's request id. |
M2 lease: Expired → Moved (forced) (the explicit-force guard) | core/rpc/wsclient/wsclient.go ParseConfirmation, request, ForceMove; cmd/sw-block/workspace.go runWorkspaceForceMove |
TestParseConfirmation, TestForceMoveSendsForceOnlyWithTheConfirmation (core/rpc/wsclient/wsclient_test.go); TestWorkspaceForceMove_Row3and4_SentAndGranted (cmd/sw-block/workspace_test.go); TestWorkspaceForceMoveAgainstRealMaster (cmd/sw-block/workspace_master_test.go) |
— | ACTIVE |
INV-WS-FORCED-CONFIRM-LOCAL-001 |
A missing or malformed --confirm-forced is refused before any connection or RPC, with exit 2. |
M2 lease: Expired → Moved (forced) (the explicit-force guard) | cmd/sw-block/workspace.go runWorkspaceForceMove; core/rpc/wsclient/wsclient.go ParseConfirmation, request |
TestWorkspaceForceMove_Row1_ConfirmationRefusedLocally (cmd/sw-block/workspace_test.go); TestParseConfirmation (core/rpc/wsclient/wsclient_test.go) |
— | ACTIVE |
INV-WS-FORCED-CONFIRM-HOLDER-001 |
A confirmation at an epoch the master reports no holder for, in its lease or its move journal, is refused without sending a move. | M2 lease: Expired → Moved (forced) (the explicit-force guard) | core/rpc/wsclient/wsclient.go holderAt, request |
TestForceMoveResolvesTheHolder (core/rpc/wsclient/wsclient_test.go) |
— | ACTIVE |
INV-WS-FORCED-CONFIRM-NO-BYPASS-001 |
No force-move flag bypasses the confirmation, and --dry-run is never a confirmation: it sends only a preview, which needs the same confirmation. |
M2 lease: Expired → Moved (forced) (the explicit-force guard) | cmd/sw-block/workspace.go runWorkspaceForceMove, workspacePreview; core/rpc/wsclient/wsclient.go PreviewForcedMove |
TestWorkspaceForceMove_Row2_DryRunPreview, TestWorkspaceHelpText (cmd/sw-block/workspace_test.go) |
— | ACTIVE |
INV-ATTACH-ASSIGNMENT-BOUND-001 |
Without a master wait, the assignment allowance is checked between attach attempts; it never cancels a granted attempt's manifest read. Per-fetch bounds, recovery progress and provider Close still apply. | M1 Recovering to Serving (wait scheduling only) | DurableProvider.chunkAuthorityWait |
TestDefaultAttachAt262144EntriesOutlivesAssignmentWait, TestDefaultGrantedAttachFailureEndsAtAssignmentAllowance (core/frontend/durable/default_attach_attempt_test.go); TestRestoreDeferredAssignmentWaitEndsOnDeadlineAndClose (core/frontend/durable/provider_assignment_test.go) |
none (scheduling; authority guards unchanged) | ACTIVE |
INV-WS-STARTUP-RETRY-001 |
A workspace primary exits 75 on assignment timeout or lease expiry after bounded cleanup. A master fact newer than nonzero observed-own, or an exact foreign HEAD at/above the assigned epoch, permits 78. Newer HEAD/store format: 78. ACK and signal keep normal exit; lease and claim gates never relax. | M2 restart | cmd/blockvolume/process_exit.go superviseProcess, workspaceRetryOutcome; core/frontend/durable/provider_layout.go startLayoutRoot; core/frontend/durable/provider_startup.go ChunkStartupIdentityRefused, ChunkStartupNewerVersion, endChunkStartup; cmd/blockvolume/process_exit.go chooseChunkStartupExit, durableOpenFatalExit |
TestANewerHeadVersionExits78NotRestartable, TestAStoreOfANewerFormatExits78 (cmd/blockvolume/newer_version_exit_test.go); TestChunkStartupNewerVersionIsGenerationBound (core/frontend/durable/provider_startup_internal_test.go); TestChunkAssignmentTimeoutExposesCurrentRecoveryOutcome (core/frontend/durable/provider_startup_outcome_test.go); TestChunkStartupOutcomeRejectsOldGenerationAndCoalescesWake (core/frontend/durable/provider_startup_internal_test.go); TestWorkspaceDisplacedClaimUsesAssignedEpoch, TestWorkspaceRetryUsesNewestOwnAssignment, TestWorkspaceForeignHeadClaimChoosesNoRetry, TestWorkspaceOldLocalHolderForeignHeadChoosesNoRetry (cmd/blockvolume/process_exit_authority_test.go); TestWorkspaceExitFirstOutcomeIsLatched, TestWorkspaceExitDoesNotWaitForBlockedFrontendClose, TestWorkspacePlannedStopKeepsSuccess (cmd/blockvolume/process_exit_test.go) |
Existing WorkspaceRegrant restart transition; no new grant rule | ACTIVE |
INV-WALSTORE-NO-EMPTY-STORE-001 |
A plain walstore holder (single replica, or a replicated volume's line primary) creates its store only on the master's creating answer. Once its store is recorded, or its volume predates attestation, a missing store exits 78 store_lost; an unreadable record exits 75. Neither writes anything. | Holder startup, before the durable open | cmd/blockvolume/store_admission.go decideStoreAdmission; cmd/blockvolume/main.go runVolume (before InitReplicaFloor); core/host/master/store_attestation.go GetReplicaStore, ReplicaStoreState; core/frontend/durable/provider.go openOrCreate (ErrLostStore) |
TestRF1HolderOnAWipedStateDirectoryRefusesStoreLost (cmd/blockvolume/rf1_store_lost_test.go, process-level); TestBlockvolumeAsksTheMasterBeforeCreatingItsStore (cmd/blockvolume/lost_store_exit_test.go); TestStoreAdmissionCreatesOnlyOnAnExplicitCreatingAnswer (cmd/blockvolume/store_admission_test.go); TestRF3WipedPrimaryRefusesAndASurvivorServesItsData (cmd/blockvolume/rf3_primary_store_lost_test.go, process-level); TestGetReplicaStoreAnswersFromTheMastersCreationFact (core/host/master/get_replica_store_test.go); TestGetReplicaStoreAnswersAReplicatedPrimaryFromItsOwnStore (core/host/master/primary_store_answer_test.go); TestAnEndedVolumeWithoutItsStoreRefusesAndCreatesNothing (core/frontend/durable/lost_store_test.go) |
MasterCreate NoEmptyHeadOverLineage projected onto the holder's local store (mutant RecreateWhenReady, here recreate_when_ended); CreateEvid2 creation fact; KnownZero (walstore has no HEAD to hydrate from). A replicated volume's non-primary replica keeps the peer rebuild: a fresh store has no durable LSN and is not the recorded store, so it never counts as a survivor or a promotion candidate | STUB |
INV-WS-SERVE-AFTER-OWN-STORE-001 |
A new volume's primary acknowledges no write until the master has recorded every initial replica's store, its own included (a single-replica volume waits for its own). So a replica's recorded store precedes every write it acknowledges. | Volume creation: stores awaited, then Serving | core/host/master/store_attestation.go awaited; core/host/master/services.go assignmentFact; core/host/volume/workspace_startup.go ReplicaStoresAwaited; core/host/volume/projection_bridge.go replicaStoresAwaited |
TestAnRF1PrimaryAwaitsItsOwnStoreBeforeServing (core/host/master/primary_store_answer_test.go); TestNewVolumeAssignmentWaitsForReplicaAttestations (core/host/master/store_record_wait_test.go); TestNewVolumePrimaryServesNothingBeforeReplicaAttestations (core/host/volume/replica_stores_wait_test.go) |
CreateEvid2: a recorded store may hold acknowledged data, which is what lets INV-WALSTORE-NO-EMPTY-STORE-001 read a recorded store as creation ended |
ACTIVE |
INV-WS-MASTER-WAIT-001 |
Startup waits without a bound while the master gives no reply or refuses credentials or identity; after contact it ends 30 s beyond the later of recovery's first reply or the master barrier. Typed MOVED or DELETED ends it with 78, including a confirmed moved source without an own assignment. | M2 Awaiting assignment → Process exited | core/host/volume/master_wait.go masterWait (contact from heartbeat, stream and renewal results; the refusal kind from the status detail only); core/frontend/durable/provider_chunk.go chunkAuthorityWait (ChunkMasterWait); cmd/blockvolume/process_exit.go chooseChunkStartupExit; core/host/master/workspace_service.go leaseRefusal, renewalMoved; core/authority/workspace.go WorkspaceSourceMoved; core/host/master/services.go SubscribeAssignments; core/authority/workspace_lease_view.go LeaseBarrierError; core/host/volume/workspace_lease.go renewDelay (sleeps until just past the barrier time, jittered, at most 2 min; then a 200 ms poll for 5 s); core/rpc/link/link.go MasterReconnect |
TestChunkAuthorityWaitStartsAtFirstContact, TestLeaseGuardSleepsUntilTheBarrier, TestStatusShowsTheMasterWait, TestCredentialsRefusedForAnHourWaitsAndLogs, TestHeartbeatLogsTheMasterWait, TestFlappingMasterNeverExpiresEarly (core/host/volume/master_wait_test.go); TestMasterLinkReconnectsWithinTwoSeconds (core/host/volume/master_reconnect_test.go); TestChunkAuthorityWaitFollowsTheMasterWait, TestChunkAuthorityWaitPassesItsOwnStart, TestChunkGrantedAttachThatKeepsFailingIsBounded, TestChunkAuthorityWaitAttachesAGrantOnTheBoundsTick (core/frontend/durable/provider_master_wait_test.go); TestIdentityRefusalWaitsVisibly, TestChunkAuthorityWaitAfterASlowOpenGetsItsFullLimit, TestIdentityRefusalEndsAndDecays (core/host/volume/master_wait_test.go); TestIdentityRefusalEndsOnADeliveredAssignment (cmd/blockvolume/process_exit_authority_test.go); TestIdentityRefusalIsTyped (core/host/master/workspace_lease_refusal_kind_test.go); TestLeaseRefusalKinds, TestRenewalReplicaMismatchAtOlderLineEpochIsOther (core/host/master/workspace_lease_refusal_kind_test.go); TestChunkStartupExitFinalGives78, TestRestartedMovedSourceExits78WithoutAnOwnLine (cmd/blockvolume/process_exit_authority_test.go); TestWorkspaceSourceMovedProof, TestMovedSourceProofCallers, TestMasterWaitFinalSites, TestMovedAssignmentStreamIsFinalWithoutAnyOwnAssignment; also in core/authority/workspace_source_moved_test.go, core/host/master/workspace_moved_source_guard_test.go |
Real systemd moved-source and prestarted-target controls remain qualification gates. | ACTIVE |
-
INV-WS-DELETE-NO-LIVE-HOLDER-001: the verdict is the first admission's only. A rerun of a delete whose token already holds the reservation (or a committed one) is admitted without a new verdict and goes on to the catalog step, whose HEAD compare-and-swap is the fence: a HEAD a holder claimed in between is refused there and the reservation given back, so an interrupted delete strands neither the volume nor its id. A reservation may hold several tokens (one per delete request); a new token on an admitted reservation is decided by the verdict; on a committed one it skips the verdict too (committed only once the HEAD is being purged, so no holder can claim it). The HEAD read before the lock still runs for a rerun, and its result is then unused: it is kept outside the workspace lock on purpose. Availability window: a delete admitted for a never-started line that stops before it marks HEAD leaves the volume reserved for deletion; if the holder then claims HEAD, the volume cannot be used until that delete is re-run (the catalog step then refuses the live HEAD and gives the reservation back). Re-run an interrupted delete. -
INV-WS-STARTUP-RETRY-001: a startup ended on a HEAD written by a newer version exits 78head_newer_version, and a fatal open of a local store written by a newer format exits 78store_format_newer: no restart of this binary can read either, so neither restarts. Exit 78 is also permitted by a NEWER observed master fact for this volume naming another holder (compared with nonzero observed-own assignment; never-assigned zero retries75 unless the master proves this server was an issued move's source and returns typed MOVED), or by the exact refused HEAD claim image proving another holder at or above the assigned epoch. The provider binds the latter proof to its recovery generation. Both existing-root checks and claim CAS readback use the same epoch-qualified supersede classifier. A lower-epoch foreign HEAD on an existing root retains the move-back diagnostic; a displaced lower-epoch claim on a fresh root retries 75 without serving. A same-holder higher-epoch HEAD fence retries 75. Unknown/no line, same replica at a higher epoch, and status codes alone mean retry 75. A wrong retry costs a bounded restart loop; a wrong 78 causes an outage until an explicit operator start. Sealed same-epoch recovery remains up for read-only replay after assignment; stale local roots, corrupt WAL and I/O faults retain diagnostic wait. The first chosen outcome wins. Process cleanup reusesWorkspaceDrainTimeout(5 s), including a blocked Close; only main exits the process. -
INV-WS-MASTER-WAIT-001: every reply produced by blockmaster's handler starts or continues a contact streak; a transport failure (Unavailable,DeadlineExceeded,Canceled) ends it. So a master that answers and drops in turn postpones the 30 s bound for as long as it flaps, also for an obsolete unit; it never ends the wait early (TestFlappingMasterNeverExpiresEarly). The barrier time travels as a duration the master computes from the same two predicates as admission, added by the volume to its own monotonic request start; the master re-checks the barrier on every re-grant, so a wrong duration only moves the 75 exit. The status codes alone still mean retry 75 (INV-WS-STARTUP-RETRY-001); only the typedWorkspaceLeaseRefusaldetail (MOVED, DELETED) permits the early 78. Scale: after a master restart every lapsed volume has the same barrier time T and the master grants them one at a time, each grant one store write W under the publisher lock, so the last of N volumes is granted about T + 0.1 s + N x W; a volume whose grant comes 30 s past T exits 75 and is started again, so that starts at N >= 30 s / W. Measured: W p50 1.03 ms, p99 2.33 ms, max 14.5 ms (400 writes of the file authority store on an NVMe ext4 disk,TestWorkspaceGrantStoreWriteTime), so 200 volumes about T + 0.6 s and the 30 s point near 12,900 volumes (p99); 20 real volume processes served at most 0.81 s after T (TestManyVolumesServeTogetherAfterMasterRestart). The bound holds for that store device: on a device whose flushes stall (an fsync held for seconds), one stalled write puts every waiting volume behind it, so the blockmaster store's device is a deployment premise of serving within 2 s of the barrier. A granted process whose attach keeps failing (the chunk store unreachable) retries inside the same bound and then exits 75: it does not hold the lease while never serving. An identity refusal has no bound until an identity-checked call (a renewal, a delivered assignment) is accepted, or until 30 s of replies pass with no new identity refusal; the window then opens again. A serving holder that starts getting identity refusals is outside this row: its lease expires and it fences and exits 75 (lease_expired). -
Part T lineage evidence:
recordSelfAssignmentrecords the newest identity-validated observed-own assignment before local-readiness admission;EngineProjectionis the adopted-own lineage. Exit compares the former; fencing compares the latter. Both useIsSupersededwith explicit lineage; zero lineage selects retry75 and no fence; neither fact grants I/O.TestWorkspaceExitAndFenceUseNamedLineages,TestWorkspaceExitLineageIncludesBlockedOwnAssignment, andTestWorkspaceObservedLineageNeverTrailsAdoption(core/host/volume/workspace_startup_test.go) keep the distinction causal. -
Part T evidence scope:
workspaceRetryOutcomeis the one retry/no-retry decision. StartupchooseChunkStartupExitsupplies the recovery-generation-bound refused-claim HEAD proof; runtime lease-end supplies none. Both combine that input with a foreign master line newer than nonzero observed-own; absent proof means retry 75. -
Part T fence ownership:
Host.FenceWorkspaceLeaseusesWorkspaceLeaseGuard.fenceLocked, including before runtime publication; the zero-validity terminal guard preserves the first cause through installation and can grant no I/O. No second host fence latch exists.TestWorkspaceHostFencePublishesOneTerminalCause,TestWorkspaceInstalledHostFenceRecordsCause,TestWorkspaceFenceBeforeHeldInstallIsTerminal(core/host/volume/workspace_terminal_test.go). -
Startup arbitration: sealed-replay/stale-local-root dispositions suppress the same wait's deadline defer (
TestChunkStartupRetainedDispositionWinsExpiredAttachContext,core/frontend/durable/provider_startup_outcome_test.go). A stop request retires startup monitoring and its atomic-choice callback before resource cleanup; success is chosen only after the guard's ACK (TestWorkspacePlannedDrainOwnsStartupExpiryUntilAck,cmd/blockvolume/process_exit_authority_test.go). Provider-validated startup selection briefly takes the process startup mutex; cancellation takes only that mutex. No reverse provider-lock acquisition or remote call occurs. -
ACK closeout: the guard sets
revokedunder its mutex before callingdrainand invoking the stop callback. After a drain reply, each ACK call is bounded by the original lease deadline and the 5 sWorkspaceAckTimeout(above the master's 2 s HEAD read plus its ACK write and reconcile). A call that got no answer (DeadlineExceeded,Unavailable) is made again until the lease deadline: the master answers a repeat of a recorded ACK as recorded (AckWorkspaceRevocation), and any other answer is final. The 19 s closeout wait therefore expires before a newly selected retry's 5 s supervisor bound starts, and drain (5 s) + closeout (19 s) + exit wait (5 s) stays under the units'TimeoutStopSec=30s; a prior nonzero decision remains immutable. A restart can ACK the sealed HEAD only while the original revoking lease is still valid. Once it expires, re-grant refuses revoking/ACKed leases: repeated 75 is not recovery of an unconfirmed ACK, and operator recovery is required; no lease or ACK gate is bypassed.
Notes:
INV-WS-SINGLE-FILER-001: the same census runs in everysw-block ops chunkcommand that writes chunk metadata (snapshot-delete, retain, volume-delete), and in verify, which writes nothing but would report false findings against a split filer view, before it reads or writes; other read-only commands and modes do not run it.INV-WS-HEAD-CAS-001: The integration test needs build tagchunkstore_integrationand a pinnedweedbinary.INV-WS-CAS-UNKNOWN-001: An unknown-outcome CAS is not in the TLA+ models (docs/spec/README.md, Limits).INV-WS-HEAD-KEY-PROVENANCE-001: No test asserts it yet in this change. The legacy verifier that observed a key HEAD named, dropped and named again is removed; on the content-named layout a name is its content, so the case does not arise there.INV-WS-FORCED-MOVE-001: TLA+:W4_driftfound the gap before #158; the skew margin itself is not in the model. Extended for a new holder that dies between its grant and its HEAD claim: the move issue starts its lease, admission uses that grant's lease, HEAD is read after admission, an older-epoch HEAD is accepted (its generation and remote LSN may have moved by an earlier holder's late claim), and a returning holder is refused by two fences, its lease-gated attach and the higher HEAD epoch.WorkspaceTakeovermodels one move from A to B and does not cover a second move away from an unclaimed grant; that model check is open and not claimed here.INV-WS-LOST-RANGE-READOUT-001: The HEAD time is the HEAD filer entry's mtime from the same HTTP metadata response as its content and generation (the legacy fixture reader usesLast-Modified; both reflect the entry's stored time, at 1 s resolution). chunkstore writes that mtime from the clock of the host that wrote the entry (the cut); the readout labels it "(publishing host clock as recorded in the filer, 1 s resolution)", and it is not a master time; there is no HEAD format change. The HEAD times sit beside the v1 ranges in the lost-range file with their own checksum, so a binary that predates them still verifies the file; a record without one reads as unknown. The readout reads the ranges loaded at startup: damage after startup shows at the next load. The no-HEAD form ("no remote image exists") is defensive: the master refuses a forced move without a published HEAD. The header is checked against test HTTP servers only; thechunkstore_integrationtest does not assert it. Not in the TLA+ models.INV-WS-FORCED-CONFIRM-001: A client-side rule: the master's own guards (explicit force, admission, expected epoch) areINV-WS-FORCED-MOVE-001. The holder's logical replica id is read fromQueryWorkspace(the lease, or the journal on a rerun). The holder check (INV-WS-FORCED-CONFIRM-HOLDER-001) sends that oneQueryWorkspaceRPC; only the move is withheld.INV-WS-FORCED-MOVE-001,INV-WS-FORCED-MOVE-REPLY-001,INV-WS-FORCED-MOVE-HALF-SKEW-001: the persisted lease horizon is at least every grant (INV-WS-LEASE-HORIZON-001). blockmaster reads HEAD only after the forced admission holds; HEAD must be the expected holder's at the expected epoch, or any HEAD at an older epoch; the lost range starts at that HEAD's remote LSN: see M2 Expired → Moved (forced) (testsTestWorkspaceUnclaimedGrantForcedReassignOverRPC,TestWorkspaceUnclaimedGrantHEADRule,TestWorkspaceForcedMoveRecordsTheLostRange). The publisher checks the admission again when it issues the move. The host counts its validity from the start of its renewal request: see M4 NoLease, Valid → Valid. The authority-ownedWorkspaceLeaseValiditycomputes duration on the publisher clock with its configured TTL and the larger configured/persisted skew, including legacy leases with no stored bound. Renewal admission, RPC replies and revocation ACK admission share that calculation; ACK uses the granted deadline clamped to the durable horizon.INV-WS-LOST-RANGE-READOUT-001: a stored range holds the kept HEAD's remote LSN; the forced-move barrier as LostUntil, in master time; the kept HEAD's generation (via the move record); and the HEAD entry's filer mtime read with that HEAD, or "unknown". A missing or damaged record isINV-WS-LOST-RANGE-FAILCLOSED-001. A failure after the issue (for example the binding reconciliation) is answeredInternalnaming the move ISSUED, never as a refusal: see M2 Moved → epoch issued.PreviewWorkspaceMoveruns the forced admission, reads HEAD only once admitted, and writes nothing: see M2 Expired → Moved (forced) (testsTestWorkspaceForcedMovePreviewWritesNothing,TestWorkspaceForceMove_Row2_DryRunPreview).INV-WS-LOST-RANGE-UNCERTAIN-001,INV-WS-LOST-RANGE-PRE-ISSUE-001: on a volume already uncertain, every failed move, an admission refusal or a HEAD-read error included, is answered as an unknown outcome and logged as unknown; only the request's own cancellation or deadline stays typed, and an issued move's replay still returns its stored grant: seeINV-AUTH-UNCERTAIN-001and M2 Uncertain → Uncertain (move answer).- Enforced by reading (no test asserts it): the publisher's second admission check when it issues a forced move (
prepareWorkspaceMoveLockedcallsforcedMoveAdmissionLocked). INV-WS-STOP-PENDING-001:WorkspaceTakeoverhas no renewal cadence (a host may renew at any step), so StopPending adds no state to the model and no configuration is re-run;INV-WS-LEASE-001andINV-WS-REVOKE-ACK-001hold in StopPending unchanged. Stop-pending changes only when the guard renews, never what it admits, fences or acknowledges: see M4 Valid → StopPending. It clears only for the latest detach attempt, provably not applied, with serving resumed: see M4 StopPending → Valid. The 250 ms bound is on scheduling only; it does not bound the time from a revocation to its acknowledgement, which also includes a renewal already in flight, the drain and the ACK. The detach hook runs on the plain path only after the idle stop succeeds, so a busy plain detach never sets stop-pending.INV-WS-HEAD-BELT-001andINV-WS-HEAD-BELT-COOLING-001describe the retired flat-HEAD publication belt. The old 2.1 s cooling assumption is not a B guarantee.INV-WS-CAS-UNKNOWN-001remains active for B's pending-session settlement and same-commit replay.
B.5 Workspace: the cut pipeline
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-CUT-COW-OWNER-001 |
Before any read-visible native mutation, a pending candidate has one saving owner; copying/saving collisions wait. The immutable cut buffer is exactly the image at H. | M5 OpenWindow → Copy | chunk_cut_cow.go claim, beforeCOWMutation; Write/WriteBatch/applyEntryV3 pre-publication hooks |
TestCutCOWV3_MutationCompletesWhileEarlierChunkCopyIsHeld, TestCutCOWV3_CopyingChunkWaitsButPendingChunkSaves, TestCutCOWV3_TwoWritersOneSaveAndCloseJoinsSavedReader, TestCutCOWV3_OverlappingRealBatchesPreserveCut |
CutCOW2 BufFrozen/HeadImage; writer/batch multiplicity tested, not modelled | ACTIVE |
INV-CUT-COW-DRAIN-001 |
Terminal invalidation forbids new references; aborting owners release themselves before join. Side cleanup and destructive transitions wait for actual I/O references. Store Close cannot miss first attachment; every Close waits for full shutdown. | M5 Closed/Aborted → Drain; M1 Close/Recover | chunk_cut_cow.go abort, join, holdChunkDestructive; WALStore.Close; attach capture admission |
TestCutCOWV3_RecoveryAndCloseDrainSavingOwner, TestCutCOWV3_CloseJoinsHeldLiveCopy, TestCutCOWV3_CloseSnapshotRejectsFirstAttachAndSharesCompletion, TestCutCOWV3_DestructiveSnapshotRetriesFirstAttachment, TestCutCOWV3_SpillIsEphemeralAndCleanupIsPrefixScoped, TestCutCOWV3_ProcessCrashDropsSideAndRestoresSyncedImage |
CutCOW2 SideOnlyInCut, abortNoJoin RED; real lifecycle races tested separately | ACTIVE |
INV-CUT-PLAIN-DETACH-001 |
Plain detach excludes entering/admitted I/O, then seals within its handle's window, including a closed idle frontend, with a settle reserve inside that bound. Publication and unknown/fenced settlement remain enforced. Closed frontend handles never reopen; absent/false preserves live policy. | M5 Admit -> PlainStop -> Quiesce | core/frontend/durable/provider_chunk.go detachVolume; storage_adapter.go stopPlainDetachIfIdle; core/host/volume/chunk_control.go |
TestPlainDetachAfterPrecopyRefusalRequiresIdleFrontend, TestPlainDetachSkipsPrecopyCostAdmission, TestChunkDetachPlainFieldDispatch, TestChunkDetachPlainAdapterAndBusyResponse ; TestOfflineSealUsesCallerDeadline, TestOfflineSealCallerCancelCanRetry (core/frontend/durable/provider_offline_seal_test.go); TestChunkPlainDetachRequiresExplicitBound (core/host/volume/chunk_offline_seal_test.go); TestLayoutPlainDetachThatOutlastsItsBoundAnswersAborted; also in core/frontend/durable/provider_plain_detach_test.go, core/host/volume/chunk_plain_detach_test.go, core/frontend/durable/provider_layout_plain_settle_budget_test.go |
PlainDetach IdleAtStop; physical byte and HEAD controls remain native |
ACTIVE |
INV-CUT-ADMISSION-PROJECTION-001 |
A capture admission waits for the store owner's projection only within the cut's context: a cancelled cut ends with its cause and frees the capture. At most one projection read per provider is outstanding; an admission uses only a read started after it began; Close joins it within its bound. | M5 Admit (initial, pre-CAS, COW claims); M1 Close | core/frontend/durable/provider_projection_flight.go projectionWithin, startProjectionReadLocked, joinProjectionReader; core/storage/chunk_layer.go admit (the cut's ctx); DurableProvider.Close |
TestACutWaitingOnTheProjectionEndsWhenCancelled, TestCloseReturnsWhileTheProjectionIsHeld, TestAnAdmissionWhoseContextEndedAsItsReadCompletedIsRefused, TestCancelledAdmissionsLeaveAtMostOneProjectionRead, TestAnAdmissionUsesOnlyAReadThatBeganAfterIt, TestAnAdmissionDuringAnOlderReadSeesALaterFence, TestCloseJoinsABlockedProjectionReadWithinItsBound, TestNoProjectionReadStartsAfterClose |
CutTime Admit (the admission's checks); the single flight's bound and freshness are tested, not modelled | ACTIVE |
INV-STOP-FLIP-CUTOFF-001 |
A detach logs 'admission closed at' = the backend's flip, recorded under its mu just after operational goes false: an I/O whose gate ran before it is admitted and drained by StopIO; every gate after it refuses. Logged only on a successful stop. | M5 detach (StopIO / plain stop / pre-copy TryStopIO) | core/frontend/durable/storage_adapter.go setOperationalLocked, TryStopIO, StopFlipAt; provider_chunk.go detach log |
TestStopFlipIsTheAdmissionCutoff, TestLiveDetachLogsWhenAdmissionClosed (core/frontend/durable/stopio_began_log_test.go) |
— (no state machine change; the cutoff test is the proof form) | ACTIVE |
INV-WS-FREEZE-ACCOUNTING-001 |
Frozen detach validates its origin and rechecks elapsed + known estimate against 5 s; override is explicit. Storage reports its admission estimate and quiesce slack using same-host monotonic durations. Stale advice is rechecked before upload; override and actual elapsed remain visible. | G frozen detach (M5) | core/storage/chunk_frozen_budget.go WithFrozenDetach, admitFrozenAt; core/frontend/durable/provider_chunk.go DetachVolumeFrozen |
TestFrozenBudgetInputValidation, TestFrozenBarrierConsumesElapsedWithoutNewAllowance, TestFrozenFinalOverrideIsVisibleEvenWhenEstimateFits, TestFrozenValidationPrecedesAnyProviderAccess; TestCandidateTailReportsCompleteFrozenBudget, TestFrozenRefusalRetainsUnknownCompleteEstimate, TestChunkFrozenRequestRefusalCarriesNoBudget, TestFrozenDrainObservationPreservesKnownBeforeReasonMutation, TestFrozenSaturatedTailRemainsKnownButNonActionable |
FrozenDetachBudget BudgetAtAdmission, OverrideVisible, ReportSlackSound |
ACTIVE |
INV-WS-FREEZE-REFUSAL-001 |
HTTP 400 invalid_freeze_budget, retryable=false, is returned only by frozen-detach request validation, before any provider admission or mutation. |
M5 frozen detach admission: [*] → Refused (invalid frozen request) | core/host/volume/chunk_control.go handleChunkDetach, chunkErrorCode; core/storage/chunk_frozen_budget.go WithFrozenDetach; core/frontend/durable/provider_chunk.go DetachVolumeFrozen |
TestChunkFrozenValidationHasDistinctPreMutationCode (core/host/volume/chunk_frozen_budget_test.go); TestFrozenValidationPrecedesAnyProviderAccess (core/frontend/durable/frozen_validation_before_access_test.go) |
— (wire classification; validation/admission guards unchanged) | ACTIVE |
INV-WS-FREEZE-REFUSAL-INPUTS-001 |
The validation refuses a frozen request whose freeze origin is missing, zero or future, or that sets plain, and allowOverBudget without frozen. Premise: the caller and blockvolume run on the same host with the same wall clock source; a cross-host caller would need a skew bound. | M5 frozen detach admission: [*] → Refused (invalid frozen request) | core/host/volume/chunk_control.go handleChunkDetach; core/storage/chunk_frozen_budget.go WithFrozenDetach |
TestChunkFrozenValidationHasDistinctPreMutationCode (core/host/volume/chunk_frozen_budget_test.go) |
— | ACTIVE |
INV-WS-FREEZE-REFUSAL-PRECEDENCE-001 |
A chunk-control error that joins invalid_freeze_budget with a terminal cause (a closed or fenced layer) or an unknown publication outcome reports the other cause's code. |
M5 frozen detach admission: [*] → Refused (invalid frozen request) | core/host/volume/chunk_control.go chunkErrorCode |
TestChunkFrozenValidationHasDistinctPreMutationCode (core/host/volume/chunk_frozen_budget_test.go) |
— | DORMANT |
INV-CUT-PRECOPY-001 |
A frozen attempt gives up at 5 s and resumes IF it can prove the stop did not happen; if it cannot prove it, writes stay stopped until it can. Unknown outcomes retry settlement. Resume grants waiters FIFO under one lock; handoff requires settled publication. | M5 tentative admission -> ordinary COW or FinalFreeze | chunk_precopy.go; chunk_frozen_budget.go; precopy_admission.go; storage_adapter.go; provider_chunk.go |
TestFrozenDetachRejectsBeforeStagingOrUpload, TestFrozenDetachRechecksBudgetAtBarrierWithoutUpload, TestFrozenBarrierConsumesElapsedWithoutNewAllowance, TestCheckpointTailScanIncludedInTotalAndFixedCosts, TestCheckpointTailUsesLiteralLatestThreeConservativeRate, TestFrozenDetachForcedFinalCommitsSamePoint, TestFrozenFinalOverrideKeepsAuthorityAndCloseGuards, TestFrozenRetryDoesNotHideUnknownPublication, TestFrozenProviderFlagOffRefusesWithoutUploadThenFinalCommits, TestCheckpointTailMeasuresWritesAfterItsCut, TestChunkCutFixedSpansAttributeManifestAndCleanup, TestPrecopyLiveBarrierSpansExplainOverage, TestPrecopyFixedPartsDoNotDoubleCountSyncPhases, TestPrecopyProviderBusyOwnerKeepsServing, TestPrecopyProviderBusyOwnerRetryRetainsSlowFixedSample, TestPrecopyDetachBusyOwnerExhaustsWithoutStopping, TestPrecopyDetachBusyOwnerRetainsSlowFixedCost, TestPrecopyDetachRefusedFinalCutKeepsChangedBytes, TestPrecopyDetachRefusedFinalCutRetainsSlowFixedCost, TestPrecopyDetachRetryResolvesPreviouslyAppliedDetachedCut, TestPrecopyDetachAppliedRetryRetainsSlowFixedCost, TestPrecopyAttemptDiagnosticsSeparateTimeoutFromFit, TestPrecopyAttemptDiagnosticsRetainSlowFixedCost, TestPrecopyStopIOReturnTimestampPrecedesFinalPublication, TestPrecopyCountsWarmAttemptsSeparatelyFromMeasurementRounds, TestPrecopyUnknownPreviousCannotClaimProgress, TestPrecopyCallerExpiryVersusClose, TestPrecopySmokeTraceAmendment4, TestPrecopyFixedWindowDecays, TestPrecopyFinalAttemptFreezeCeiling, TestPrecopyFixedCostSmallTailCommitsBySecondAttempt, TestPrecopyLargeTailStillRefusesFixedCostException, TestPrecopyFixedCommitRuleKeepsProgressAndFreezeBounds, TestPrecopyFixedPartsStayWithLargestObservation, TestPrecopyFixedPartsMeasureCASAndReadbackSeparately, TestPrecopyFixedExceptionFinishUsesDeclaredFreeze (core/storage/chunk_precopy_fixed_commit_test.go), TestPrecopyFiftyIOPSSyncConvergesFirstAttempt (first eligible allowance or plateau attempt), TestPrecopyFiftyIOPSSlowMeasuredCostsKeepServing (retained slow cost, declared admission or refusal, active owner and exact local bytes), TestPrecopyFiftyIOPSColdCostsKeepAdmissionHonest, TestPrecopyFiftyIOPSRoundAccounting (five total physical rounds, including success and measurement rounds), TestPrecopyHostDrainDoesNotCompleteHeldGuestIO, TestPrecopyTargetCloseDropsHeldCommandWithoutCompletion, TestPrecopyDrainLetsAnAdmittedWriterReachTheBarrier, TestPrecopyDrainReceives100MillisecondBound, TestPrecopyDrainTimeoutReopensWithoutWaitingUnderCapture, TestPrecopyLateGateCallerCannotCrossFreeze, TestPrecopyResumeReleasesAllWaiters (FIFO grants under one lock, concurrent outstanding I/O), TestPrecopyResumedArrivalDoesNotInheritExpiredPause, TestPrecopyQueueBoundStartsAtCommandArrival, TestPrecopyResumeGrantVersusExpiry, TestPrecopyGrantedWaiterFollowsReplacementPause, TestPrecopyNewPauseCannotEraseObservedStalePrimary, TestPrecopyStopFallbackPreservesQueuedPause, TestPrecopyQueueUsesFiveSecondCutoverBudget, TestPrecopyRollingUploadReopensTentativeAdmission, TestPrecopyDetachRefusedFinalCutKeepsChangedBytes, TestPrecopyDetachSustainedWrapFlushAndFreshRestore; also in core/storage/chunk_frozen_budget_test.go, core/storage/chunk_fixed_spans_test.go, core/storage/chunk_candidate_tail_test.go, core/frontend/durable/provider_frozen_budget_test.go, core/frontend/durable/provider_chunk_precopy_test.go, core/storage/chunk_precopy_detach_test.go, core/frontend/durable/precopy_stop_boundary_test.go, core/storage/chunk_precopy_amendment4_test.go, core/frontend/durable/precopy_expiry_close_test.go, core/frontend/durable/precopy_fifty_iops_test.go, core/frontend/durable/precopy_fifo_test.go, core/frontend/nvme/precopy_target_drain_test.go, core/frontend/durable/precopy_drain_test.go, core/frontend/durable/precopy_resume_test.go, core/frontend/durable/precopy_arrival_test.go, core/frontend/durable/precopy_stale_retry_test.go, core/frontend/durable/precopy_rolling_pause_test.go |
PrecopyFixedAdmission.tla (ordinary admission), FrozenDetachBudget.tla (forecast/barrier budget, upload guard, explicit override and stable-authority publication); controlled callers and measured latency are not a model proof |
DORMANT |
INV-CUT-FROZEN-DETACH-REFUSED-001 |
A detach request with frozen set is refused with HTTP409 frozen_detach_unsupported, retryable=false, before any provider call, admission or cut work. |
M5 [*] → Refused (valid frozen request) | core/host/volume/chunk_control.go handleChunkDetach |
TestChunkDetachFrozenRefusedBeforeProvider (core/host/volume/chunk_frozen_refused_test.go), TestChunkFrozenDetachWireContractAndPrecedence, TestChunkFrozenRequestRefusalCarriesNoBudget (core/host/volume/chunk_frozen_budget_test.go) |
— (request refusal) | ACTIVE |
INV-CUT-PRECOPY-FLAG-REFUSED-001 |
blockvolume refuses to start with --chunk-detach-precopy set: flag validation fails with "--chunk-detach-precopy is not supported in this release", so no blockvolume process runs the pre-copy detach. |
M5 Admit (pre-copy admission never entered) | cmd/blockvolume/chunk_remote.go validateChunkFlags |
TestChunkDetachPrecopyFlagRefused (cmd/blockvolume/chunk_remote_test.go) |
— (startup validation) | ACTIVE |
INV-CUT-QUIESCED-001 |
HEAD is exactly the image at a quiesced cut H, and H is a synced LSN. | M5 Quiesce → Copy → CAS | core/storage/chunk_layer.go captureLocked |
TestChunkLayer_C1_HeadIsQuiescedCutImage, TestChunkLayer_C3_EveryHeadIsExactUnderConcurrentWrites (core/storage/chunk_layer_contract_test.go) |
CutPipeline HeadImage; CutCapture HeadImage |
ACTIVE |
INV-CUT-BIRTH-001 |
Retired: B does not store per-chunk BirthLSN; INV-SNAPK-COMMIT-REACH-001 protects the published object graph, and the surviving barrier-image test protects the cut image. |
legacy M5 | — | — | — | ARCHIVED |
INV-CUT-STAGED-REUSE-001 |
Completed uploads survive a refused point in-process, under their intents. A chunk pre-copied outside the barrier is used only if HEAD generation is unchanged and no write and no same-open Recover touched it after staging; otherwise it is copied again in the native COW window. |
M5 Stage → Copy | core/storage/chunk_layer.go captureLocked, stage |
TestChunkStageV3_SpillBudgetTriggersPrecopy (core/storage/chunk_cut_progress_test.go); TestChunkStageV3_AbortedPointReusesUploads (core/storage/chunk_cut_progress_test.go); TestChunkPrecopy_RedirtiedStagedChunkIsRecopied (core/storage/chunk_layer_precopy_test.go); TestNativeReplacementRecoverInvalidatesStagedImage (core/storage/legacy_replacement_v3_test.go); TestChunkStageV3_MidUploadAbortReducesRetryBytes (core/storage/chunk_abort_upload_bytes_test.go); TestCutRevokedMidUploadKeepsItsUploads (core/storage/chunk_cut_revoke_reuse_test.go) |
CutPipeline HeadImage |
ACTIVE |
INV-LAYOUT-REMOTE-CAPABILITIES-001 |
A provider attaches only a layout remote with commit checking, a bounded HEAD step and identity-only HEAD reads. Its wrapper refuses missing check/read capabilities and never substitutes a full manifest read or a successful check. | M1 attach; M5 object check and HEAD confirmation | LayoutRemote compile-time assertions; DurableProvider.newChunkLayer; closeBoundRemote |
TestCloseBoundRemoteRefusesMissingCapabilities, TestProviderRefusesLayoutRemoteMissingRequiredCapabilityAtStart, TestCloseBoundRemoteForwardsCapabilitiesAndClose (core/frontend/durable/remote_capabilities_test.go) |
existing adapter contract (no state or transition change) | ACTIVE |
INV-CUT-RETRY-FAIRNESS-001 |
New staging retries without backoff; zero progress backs off. Dirty-start cleaning waits for a completed store attempt or one maintenance interval. K=3 admitted stalled background attempts yield reusable staging, never a pending or active/newer cut. | M5 Stage, M6 Clean (CUT-BUDGET B1/B3) | core/frontend/durable/provider_chunk.go; core/frontend/durable/chunk_snapshot_schedule.go; core/storage/chunk_periodic_cut.go |
TestCutLoopProgressRetriesWithoutBackoff, TestScheduledSnapshotProgressRetriesWithoutBackoff, TestDirtyStartCleaningWaitsForFirstCutAttempt, TestDirtyStartCaptureRefusalsDoNotReleaseCleaning, TestStalledCutYieldsSessionToCleaning (core/frontend/durable/cut_progress_test.go); TestDiscardStagedRechecksCaptureState (core/storage/chunk_stalled_discard_test.go); TestLayoutStalledSessionYieldAllowsCleaning (core/frontend/chunkstore/layout_stalled_discard_test.go) |
CommitReach CBegin (existing session exclusion; scheduling only) |
ACTIVE |
INV-CUT-STAGED-COUNT-001 |
Stats.StagedChunks counts each chunk staging finished (remembered for reuse) in every cut attempt, an interrupted round included, and only grows; a re-staged chunk counts again; it is in-process. A cut's PayloadNs includes its staging rounds whether or not they uploaded. |
M5 Stage (before the barrier) | core/storage/chunk_cut_payload.go rememberPayload, streamCutPayloads; core/storage/chunk_layer.go captureLocked |
TestChunkStage_StagedChunksCountsFailedAttempts, TestChunkStage_StagedChunksCountsAnInterruptedRound, TestChunkStage_PayloadTimeCountsStagingWithoutUploads (core/storage/chunk_stage_accounting_test.go) |
— | ACTIVE |
INV-CUT-BITMAP-001 |
The owned map never under-reports: its checkpoint coverage is durable before WAL recycling; UNKNOWN is cleared only after definite HEAD publication (a cut, or a fresh store's claim: INV-CUT-FRESH-KNOWN-ZERO-001) and an unchanged capture token. |
M5 CAS → Settled; M1 InExtent → Checkpointed | core/storage/walstore_map_checkpoint_v3.go publishCheckpointV3; core/storage/chunk_layer_map_v3.go persistCapturedMapV3 |
TestWALStoreV3_AutomaticMapCheckpoint (core/storage/walstore_map_checkpoint_v3_test.go); TestChunkLayerV3_ChangedCaptureTokenKeepsUNKNOWN (core/storage/chunk_layer_map_v3_test.go) |
CutCapture HeadImage |
ACTIVE |
INV-CUT-FRESH-KNOWN-ZERO-001 |
A store this start created (in memory) and still fresh at its attach (marker present, no BASE) starts known-zero for each chunk its claimed HEAD does not name whose entry is still {LSN 0, UNKNOWN}. Order: retire the marker, then make the marking durable, then serve. | M1 Recovering → Serving (fresh attach: commit, marking, then serving) | core/storage/chunk_fresh_known_zero.go freshKnownZeroCandidates, ApplyFreshKnownZero; core/frontend/durable/provider_chunk.go attachChunk; core/frontend/durable/provider.go openOrCreate (createdThisStart; non-chunk implementations refuse chunk roots) |
TestRedFirstCutOfAFreshVolumeScansOnlyWrittenChunks, TestFirstCutAgainstAClaimedHeadCertifiesUnnamedChunks, TestFirstCutOfARestoreTargetKeepsItsHydrationPath, TestExplicitWALStoreRefusesAFreshChunkRoot (core/frontend/durable/first_cut_known_zero_test.go); TestNoWriteReachesAFreshStoreBeforeItsAttachCommit, TestNoFetchOrFillReachesAFreshStoreBeforeItsAttachCommit, TestFreshKnownZeroNotAfterARestartBeforeTheAttachCommit, TestFreshKnownZeroNotAfterARestartBeforeAnyAttach, TestFreshKnownZeroCrashBetweenMarkerRetireAndMarking (core/frontend/durable/known_zero_premise_test.go); TestFreshKnownZeroNeverCertifiesARecordedWrite, TestFreshKnownZeroNotWithoutTheFreshPremise, TestFreshKnownZeroSkipsAChunkWrittenAfterTheSample, TestFreshKnownZeroNeedsThisStartsCreate (core/storage/chunk_fresh_known_zero_test.go) |
KnownZero. Premise: no write, fill or other implementation reaches a store before its attach commit; a marker an earlier start, an older binary or another opener left is never trusted (created-this-start is in memory). A crash between retirement and marking costs one scan. |
ACTIVE |
INV-CUT-RECOVER-BARRIER-001 |
Native Recover aborts and drains OPEN COW owners before lower locks, with admission held through recovery and a hook snapshot recheck. No recovered record above H can enter a HEAD labelled H. |
M5 Quiesce; M1 Recovering | core/storage/walstore.go WALStore.Recover; chunk_cut_cow.go holdChunkDestructive |
TestCutCOWV3_RecoveryAndCloseDrainSavingOwner (core/storage/chunk_cut_cow_lifetime_test.go); TestCutCOWV3_DestructiveSnapshotRetriesFirstAttachment (core/storage/chunk_cut_cow_lifetime_test.go); TestCutCOWV3_RecoveryAndCloseDrainSavingOwner (core/storage/chunk_cut_cow_lifetime_test.go) |
— | ACTIVE |
INV-CUT-UPLOAD-FROM-BUFFER |
CopyFinish owns an immutable at-H slot. Every PUT retry sends that slot, without rereading local bytes; transient failures keep the point until the caller deadline, window abort or 30-second object deadline. Guest writes to a copied chunk need no save. | M5 Copy -> Upload | chunk_cut_cow.go copyCOWEntry; chunk_upload.go putCaptured |
TestCutUploadRetriesPastThreeAttemptsAtSamePoint, TestChunkCutUploadDeadlineBoundRetainsDirt, TestCutCOWV3_PutRetryUsesFrozenSlot (core/storage/chunk_cut_alignment_test.go); also in core/storage/chunk_review271_test.go, core/storage/chunk_upload_retry_test.go |
CutCOW2 BufFrozen; separate upload action extension pending | ACTIVE |
INV-CUT-NO-WAL-PIN |
A cut window pins no WAL space and does not defer the flusher. Logical readers validate their resolved record and retry against the dirty map/extent after retirement and reuse. | M1 Checkpoint / M5 Copy | walstore_v3.go readDirtyV3; flusher.go flushOnceInternal |
TestCutCOWV3_CaptureDoesNotPinWAL (core/storage/chunk_cut_alignment_test.go) |
CutFlush refinement; native real ring-reuse control | ACTIVE |
INV-CUT-ATTEMPT-OBSERVED-001 |
A failed cut logs completed compares, staging results and uploads instead of discarding partial batch work. Manifest reads, root/segment preparation and commit checks retain elapsed time on failure. These observations never authorize publication. | M5 diagnostics (no transition) | core/storage/chunk_cut_observation.go; chunk_cut_payload.go; chunk_layer.go; core/frontend/chunkstore/layout_remote.go |
TestAbortedCutLogsEachCompletedCompareAndUpload; TestAbortedStagingLogsCompletedWork; TestFailedLayoutCutLogsRepeatedPreparationTime |
— | ACTIVE |
INV-CUT-READ-LOGICAL-001 |
Every cut read of a chunk (COW copy, COW save and pre-copy staging) resolves each block through the dirty map first, validates the whole WAL record it read and re-resolves on a mismatch, and reads the extent only for a block with no dirty entry; no cut path reads the extent region directly. | M5 Stage / Copy | core/storage/chunk_cut_cow.go readCOWChunk, readLocalBlock; core/storage/chunk_layer.go readChunk; core/storage/walstore_v3.go readDirtyV3Into |
TestCutCOWV3_CaptureDoesNotPinWAL (core/storage/chunk_cut_alignment_test.go); TestCutCOWV3_SaverUsesValidatedWALBatchAndLazyHEAD (core/storage/chunk_cut_cow_lifetime_test.go) |
— | ACTIVE |
INV-CUT-HOOK-BEFORE-APPEND |
The COW hook owns/saves the at-H image before a read-visible WAL mutation, under shared capture admission. | M1 Write / M5 Save | walstore.go Write, WriteBatch; chunk_cut_cow.go beforeChunkMutation |
TestCutCOWV3_MutationCompletesWhileEarlierChunkCopyIsHeld, TestCutCOWV3_OverlappingRealBatchesPreserveCut |
CutCOW2 SaveStart before Write | ACTIVE |
INV-CUT-FILL-FROM-BASE |
Lazily absent blocks are filled from this cut's fixed base HEAD, never a newer remote HEAD. Remote fetch runs after releasing local ownership. | M5 Copy / lazy fill | chunk_cut_cow.go readCOWChunk, fillMissing |
TestCutCOWV3_LazySaverSpillImageIsExact, TestCutCOWV3_SaverUsesValidatedWALBatchAndLazyHEAD |
Remote fill not modelled; native byte-image controls | ACTIVE |
INV-CUT-GUEST-BOUNDED-WAIT-001 |
Inside an open cut window, a guest write to a candidate chunk waits only for local work, never for a remote fetch or upload: at most 250 ms for a saver slot (then only the cut aborts) and one local capture of the chunk's at-H image. | M5 OpenWindow → Copy (guest write during Copy / Upload) | core/storage/chunk_cut_cow.go beforeCOWMutation, claim, acquireSaver, readCOWChunk, fillMissing |
TestCutCOWV3_SaverUsesValidatedWALBatchAndLazyHEAD, TestCutCOWV3_CopyingChunkWaitsButPendingChunkSaves (core/storage/chunk_cut_cow_lifetime_test.go); TestCutCOWV3_RemoteUploadDoesNotParkCopiedChunk, TestCutCOWV3_SaverBurstWaitsAndPublishes (core/storage/chunk_cut_cow_spillcap_test.go); TestCutCOWV3_HeldFillIsCancelledByAbortAndDrained (core/storage/chunk_cut_cow_fill_test.go) |
CutCOW2 Blocked defines which writes wait; remote I/O is not modelled |
ACTIVE |
PROGRESS-DESTRUCTIVE |
Supported guest zero-data writes use ordinary COW and do not abort every update. Unsupported DSM/discard/write-zeroes opcodes reach no storage mutation. Administrative Recover/reset/BASE still invalidate and drain; progress assumes these lifecycle transitions eventually stop. | M1 Write / M5 Save | chunk_cut_cow.go beforeCOWMutation; frontend dispatch |
TestCutCOWV3_ZeroWritesDoNotAbortUpdates (core/storage/chunk_cut_alignment_test.go); TestDispatch_UnsupportedOperations (core/frontend/ublk/dispatch_test.go); TestT2Batch11a_IdentifyController_ONCSAllZero (core/frontend/nvme/identify_test.go) |
Guest/lifecycle distinction not modelled; native controls | ACTIVE |
INV-CUT-PAYLOAD-BOUNDED-001 |
One volume's cut upload workers, active COW savers and cached COW saves together hold at most its payload byte budget (default max(64 MiB, six chunks)), whatever the number of candidate chunks. | M5 Stage / Copy / Upload | core/storage/chunk_cut_payload.go cutPayloadWorkers; core/storage/chunk_cut_cow.go installCOWWindow, save |
TestCutPayloadBudgetBoundsSlots (core/storage/chunk_cut_payload_budget_test.go); TestCutBudgetRefusesBeforeBarrier (core/storage/chunk_cut_budget_test.go); TestWALStoreChunk_InitialWriteAnonymousMemory (isolated Linux RSS arms, core/frontend/durable/provider_initial_memory_linux_test.go) |
CutPipeline AbortPoint covers refused-point stutter; byte counts and filesystem/transport resource costs are not modelled |
ACTIVE |
INV-CUT-PAYLOAD-MIN-001 |
A chunk layer is not attached with a negative payload budget or an explicit one below six chunks; zero selects the default. | M5 Stage / Copy / Upload (layer attach) | core/storage/chunk_layer.go attachChunkLayerImpl |
TestChunkLayerPayloadBudgetRejectsUndersized (core/storage/chunk_cut_payload_budget_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-BUDGET-COW-001 |
With a host Budget, each COW save reserves its chunk bytes on the cut's ticket while holding no window lock; a refused reservation or a revocation aborts only that cut, never the write. | M5 Copy → Aborted (budget revocation) | core/storage/chunk_cut_cow.go save; core/storage/chunk_cut_budget.go reserve; core/storage/chunk_layer.go captureLocked |
TestCutBudgetCOWRefusalAbortsOnlyCut (core/storage/chunk_cut_budget_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-BUDGET-RELEASE-001 |
A cut's host Budget ticket is released only after all of that cut's COW savers and upload workers have returned, also after a revocation. | M5 Aborted, Closed | core/storage/chunk_layer.go captureLocked; core/storage/chunk_cut_cow.go join; core/storage/chunk_upload.go uploadBatch |
TestCutBudgetRevocationJoinsBeforeRelease (core/storage/chunk_cut_budget_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-SCRATCH-001 |
Reading one block from a WAL batch record allocates block-sized scratch, not the record's size, and still verifies the whole-record CRC. | M5 Copy (cut read) | core/storage/walstore_v3.go readRecordV3, readDirtyV3Into |
TestV3ReadLargeBatchScratchIsBlockBounded (core/storage/chunk_review271_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-STREAM-001 |
Each staging or cut upload worker holds one chunk image at a time, from its read through its PUT and retries; there is no payload queue and no whole-round copy. | M5 Stage, Copy → Upload | core/storage/chunk_cut_payload.go streamCutPayloads; core/storage/chunk_upload.go uploadBatch, putCapturedWith |
TestCutPayloadReadsOverlapEarlierUploadsWithinBudget (core/storage/chunk_review271_test.go); TestCutCOWV3_RemoteUploadDoesNotParkCopiedChunk (core/storage/chunk_cut_cow_spillcap_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-SPILL-001 |
A copy window's side-file bytes never exceed its cut's side-file cap (COWSpillLimit, default 1 GiB, lowered by free space: Part E); a save that would exceed it aborts the cut, returns its chunks to the dirty set and lets the write proceed. |
M5 Copy → Aborted | core/storage/chunk_cut_cow.go save, cowSpillLimit; cutCOWWindow.abort; core/storage/chunk_layer.go attachChunkLayerImpl, requeueCut |
TestCutCOWV3_SpillCapAbortsTheCut, TestChunkLayer_COWSpillLimitDefaultAndRefusal, TestCutCOWV3_ChangedImageExceedsSpillCap, TestChunkStageV3_ChangedImageExceedsSpillCap, TestCutCOWV3_OverwriteStormAbortsAndRetries (core/storage/chunk_cut_cow_spillcap_test.go); TestCOWSpillLimit_FromFreeSpace (core/storage/chunk_cut_cow_spillfree_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-SPILL-SOURCE-001 |
Only a COW save made before a store mutation (WriteContext, WriteBatchContext or applyEntryV3) consumes side-file bytes; copy and upload workers never write the side file. |
M5 Copy (COW save) | core/storage/chunk_cut_cow.go beforeCOWMutation, copyCOWEntry; core/storage/walstore.go WriteContext, WriteBatchContext; core/storage/base_install_v3.go applyEntryV3 |
TestCutCOWV3_SpillWithinCapIsAccounted (core/storage/chunk_cut_cow_spillcap_test.go) |
— | ACTIVE |
INV-CUT-PAYLOAD-JOIN-001 |
Every upload worker of a cut or staging round has returned before that round's intents are cleaned up or its outcome is settled, also after an upload failure or cancellation. | M5 Upload → Closed, Aborted | core/storage/chunk_upload.go uploadBatch; core/storage/chunk_layer.go captureLocked |
TestChunkUploads_FailureJoinsBeforeIntentCleanup (core/storage/chunk_upload_parallel_test.go) |
— | ACTIVE |
INV-CUT-ERROR-PRECEDENCE-001 |
A chunk-control error body reports cut_aborted for a local cut abort even when the abort cancelled a remote upload, but an unknown CAS outcome, a fence or a closed or detached layer joined to it keeps its own code (outcome_unknown, fenced, closing). |
M5 Copy, Upload → Aborted (HTTP error body) | core/host/volume/chunk_control.go chunkErrorCode |
TestStatusServer_ChunkErrorBodyIsTyped (core/host/volume/chunk_control_test.go) |
— | ACTIVE |
INV-CUT-REMOTE-FULL-001 |
An assign answer that names no free volumes (no free volumes left) is storage.ErrChunkRemoteFull on both assign paths; any other assign failure stays a plain remote failure (remote_unavailable). |
M5 Upload → Aborted | core/frontend/chunkstore/swfs.go assignErr (Put, reserve) |
TestSWFS_AssignOnAFullStoreIsRemoteFull (core/frontend/chunkstore/swfs_test.go), TestIntegration_FullStoreAnswersRemoteFull (core/frontend/chunkstore/full_store_integration_test.go, real weed) |
— | ACTIVE |
INV-CUT-REMOTE-FULL-002 |
One object's retries and a cut's upload batch keep a full-store failure over plainer ones, since SeaweedFS names a full store only to the assign that tries to grow a volume. | M5 Upload → Aborted | core/storage/chunk_upload.go putCapturedWith, uploadBatch, keepFull |
TestChunkUploadKeepsTheFullStoreAnswer (core/storage/chunk_cut_failure_status_test.go) |
— | ACTIVE |
INV-CUT-REMOTE-FULL-003 |
The HTTP error body answers a full store as 503 remote_full, retryable, checked before remote_unavailable; a local cut abort, an unknown outcome, a fence or a closed layer joined to it keeps its own code. |
M5 Upload → Aborted (HTTP error body) | core/host/volume/chunk_control.go chunkErrorCode |
TestStatusServer_ChunkErrorBodyIsTyped (core/host/volume/chunk_control_test.go) |
— | ACTIVE |
INV-CUT-LAST-FAILURE-001 |
Every failed cut, whatever requested it, sets Chunk.Stats.LastCutFailure (code, cause of at most 1024 bytes, time, repeats with that code); a successful cut clears it and a refusal leaves it. |
M5 Upload → Aborted; Commit → Published | core/storage/chunk_layer.go recordCut, noteCutFailureLocked, cutFailureCode |
TestChunkCutFailureStatusNamesAFullStore (core/storage/chunk_cut_failure_status_test.go) |
— | ACTIVE |
INV-CUT-LAST-FAILURE-002 |
The holder logs one cuts failing WARN per change of the failure's code, not one per retry. |
M5 Upload → Aborted | core/storage/chunk_layer.go noteCutFailureLocked |
TestChunkCutFailureStatusNamesAFullStore (core/storage/chunk_cut_failure_status_test.go) |
— | ACTIVE |
INV-CATALOG-HEAD-CONFLICT-001 |
A catalog transition that lost its conditional HEAD write (layout.ErrPrecondition, such as a snapshot delete raced by a cleaning's begin) reports head_conflict (409, retryable), never internal; it decides last, so any other cause joined to it keeps its own code. |
M6 snapshot delete (HTTP error body) | core/host/volume/chunk_control.go chunkErrorCode |
TestSnapshotDeleteRacedByACleanBeginIsAHeadConflict, TestSnapshotDeleteUnderAPersistentConflictIsNeverInternal (core/host/volume/chunk_delete_head_conflict_test.go); TestStatusServer_ChunkErrorBodyIsTyped (core/host/volume/chunk_control_test.go) |
— | ACTIVE |
INV-HOST-CUT-BUDGET-001 |
A cooperating cut process holds a host OS slot from its admission, before staging or the capture barrier: see M7 free → admitted. | M7 free → admitted | core/hostlimit/limiter.go Admit; core/storage/chunk_cut_budget.go; blockvolume host-limit flags |
TestSlotsUrgentAndJoinedRelease (core/hostlimit/limiter_test.go); TestHostCutLimitDoesNotGateGuestIO (core/frontend/durable/host_limit_test.go) |
HostBudget HeldUntilJoined/PayloadBound/SpillBound (bounded OS-lock abstraction; fallback excluded) |
ACTIVE |
INV-HOST-CUT-BUDGET-RESERVE-001 |
Each admitted slot, urgent included, carries at most PayloadBytes of cut payload and at most COWBytes of COW side bytes; a reservation beyond COWBytes revokes the slot and aborts its cut. | M7 admitted | core/hostlimit/limiter.go Admit, ReserveCOW; core/storage/chunk_cut_budget.go |
TestHostCOWCapAbortsCutAndRetainsPermitUntilJoin (core/storage/chunk_host_budget_test.go); TestSlotsUrgentAndJoinedRelease (core/hostlimit/limiter_test.go) |
HostBudget PayloadBound/SpillBound |
ACTIVE |
INV-HOST-CUT-BUDGET-SETTLE-001 |
A slot's OS lock is released only after its cut's workers settle and Release is called; cancellation, hold expiry and limiter Close abort the cut but keep the slot until then. | M7 draining → joined → released | core/hostlimit/limiter.go Release, releaseLoop, revoke, Close; core/storage/chunk_layer.go captureLocked |
TestCOWAbortHoldsSlotUntilWorkerSettlement, TestHoldExpiryAndCloseDoNotSteal, TestKilledProcessReleasesButLiveHolderDoesNot (core/hostlimit/limiter_test.go); TestHostCOWCapAbortsCutAndRetainsPermitUntilJoin (core/storage/chunk_host_budget_test.go) |
HostBudget HeldUntilJoined |
ACTIVE |
INV-MAINTENANCE-BATCH-001 |
Cleaning releases HEAD activity after min(1000 decisions, 5 s), checked between decisions. Preparation normally stays outside; re-entry validates its HEAD. Unknown close settles before cursor advancement. Busy answers are typed retryable layout_busy. | M8 Running → Running | core/frontend/chunkstore/clean_b.go endCleanBatch; core/frontend/chunkstore/layout/remove.go ResetReachability |
TestMaintenanceFiveSecondBatchLetsSnapshotDeleteFinish, TestMaintenanceSlowPreparationDoesNotHoldSession, TestMaintenanceBatchRefusesPublicationAfterPreparation, TestMaintenanceBatchPreparationAbsentHeadRefuses, TestMaintenanceLongPassReleasesLayoutBetweenBatches, TestMaintenanceBatchDropsReachabilityAfterPublication, TestMaintenanceBatchSettlesUnknownCloseBeforeReentry, TestMaintenanceDelayedClosePublicationInvalidatesNextPage, TestSnapshotDeleteLayoutBusyIsTypedRetryable, TestSnapshotDeleteCLILayoutBusyIsTypedRetryable, TestSnapshotDeleteCLIRetriesBusyWithSameIdentityWithinWindow |
SnapshotRemoval BeginClean/EndClean; StaleClean r2 159-161 | STUB |
INV-MAINTENANCE-LIVENESS-001 |
Three refusals without advancing the stuck page arm activity-held preparation for every revisit until that position advances. Its reads share the session hold cap. A waiting same-catalog publisher enters before the next batch; cancellation withdraws its mark. | M8 Running -> Running | core/frontend/chunkstore/clean_b.go RemoveUnreachableAll; core/frontend/chunkstore/clean_admission.go; core/frontend/chunkstore/layout_remote.go beginSessionLocked |
TestMaintenanceRepeatedPreparationPublicationFallsBackAfterThreeRefusals, TestMaintenanceFallbackPreparationSharesSessionCap, TestMaintenanceWaitingPublisherRunsBeforeNextBatch, TestMaintenanceCancelledPublisherWithdrawsItsMark, TestMaintenanceRetainPublisherPrecedesANewCleanPass, TestMaintenanceNestedCatalogPublishersDoNotSelfDeadlock, TestMaintenancePartialMultiVolumeAdmissionUnwindsOnCancellation, TestMaintenanceReleasedBatchContextCannotBypassANewBatch, TestMaintenanceCrossVolumeCallbackDoesNotWaitWhileHoldingAClean, TestBCatalog_OperatorSnapshotDeleteDuringACleaning |
CleanBatch r2 NoStarve / HoldCap / PubWaitOne | STUB |
INV-MAINTENANCE-NO-PROGRESS-001 |
Maintenance has no total deadline. Only a strict advance of the finite (phase, cursor) work position renews its window; requests are separately bounded. No progress for the window fails typed no_progress; cancellation joins before release and the existing cursor resumes later. | M8 Running → Armed | core/frontend/durable/maintenance_progress.go maintenancePass; core/frontend/chunkstore/layout/remove.go removePlanned; core/frontend/chunkstore/maintenance_request.go maintenanceCall |
TestMaintenanceProgressingPastOneMinuteCompletes, TestMaintenanceRepeatedPositionDoesNotHideAStall, TestMaintenanceSilentPassReturnsTypedNoProgress, TestCleaningReportsProcessedObjects, TestRealMaintenanceProgressingPastOneMinuteCompletes, TestRealMaintenancePreparationAndRemovalEachOutliveWindow, TestMaintenanceListPreparationReportsOnlyAuthenticatedPages, TestMaintenanceReachabilityProgressesAcrossTheWindow, TestMaintenanceLookupRetriesItsOwnDeadlineWithoutProgress, TestMaintenanceReplayedPhaseCannotRenewWindow, TestMaintenanceFiniteStagesCanCompleteAcrossWindow, TestMaintenanceTagPositionCountsCompletedWorkOnly, TestMaintenanceIntentCursorAdvancesAcrossPages, TestMaintenanceProgressStateDoesNotAllocatePerObject, TestMaintenanceProgressRetainedBytesStayBounded, TestMaintenanceFenceWithNilSettlementDoesNotCountSuccess, TestMaintenanceUnknownCreateKeepsLinkedUploadAndSettles, TestMaintenanceBlobPutDoesNotRepeatUnknownAssignment |
CutTime window rule; GRID-v11-r8 maintenance pass × wall time | STUB |
INV-HOST-HOLD-NO-PROGRESS-001 |
A held slot is revoked only after its no-progress window passes with no reported progress of its work (a chunk compared, staged or uploaded by its cut): work that keeps progressing is never revoked, and a stalled hold is revoked within the window. | M7 admitted → draining (revoked) | core/hostlimit/limiter.go Admit, Progress, expire; core/storage/chunk_cut_budget.go BudgetProgress, budgetProgress; core/storage/chunk_cut_observation.go progressed; core/storage/chunk_layer.go captureLocked |
TestStalledHoldIsRevokedWithinTheWindow, TestProgressRenewsTheHold (core/hostlimit/limiter_progress_test.go); TestProgressRacingTheExpiryIsHonoured, TestProgressDoesNotWaitForTheLimiterLock, TestProgressStampIsMonotonicElapsed (core/hostlimit/limiter_review_test.go); TestCutReportsProgressToItsBudget (core/storage/chunk_cut_hold_progress_test.go) |
SlotShare (its progress-window rule; the share rule is a later change) | ACTIVE |
INV-HOST-FETCH-CAP-001 |
A chunk fetch holds one of the host's FetchSlots across its remote read only; a limiter's first fetch checks the host configuration (ErrConfig on a mismatch). With all held it waits, never refused: unordered, bounded by its context alone. Only non-blocking tries: an ended wait leaves nothing. | M7 (fetch slots, beside the cut slots) | core/hostlimit/fetch.go HoldFetch, checkFetchConfig, waitFetch; core/hostlimit/limiter.go configGuard; core/storage/chunk_layer.go fillOnce; core/storage/chunk_cut_budget.go BudgetFetch |
TestHoldFetchTakesAFreeSlotAtOnce, TestHoldFetchCapHoldsAcrossLimiters, TestHoldFetchAWaiterThatGivesUpLeavesNoSlotHeld, TestHoldFetchTakesAnotherSlotThatFreesFirst (core/hostlimit/fetch_test.go); TestHoldFetchFirstFetchChecksTheHostConfiguration, TestHoldFetchSlotDiesWithItsProcess, TestHoldFetchEndedWaitsLeaveNothingBehind, TestHoldFetchCancelledAtTheHandoffHoldsNothing, TestHoldFetchAPassedWaiterEndsByItsDeadline (core/hostlimit/fetch_review_test.go); TestChunkFetchHoldsAHostSlotAroundItsRemoteRead (core/storage/chunk_fetch_cap_test.go) |
— (a resource cap with no state of its own) | ACTIVE |
INV-HOST-CUT-YIELD-001 |
A Normal hold at least YieldAfter old yields its slot at its cut's next staging batch only while another cut on the host holds a live ticket it has not judged stalled; the attempt ends as yielded, never a failure, and keeps what it staged. A lone or urgent hold never yields. | M7 admitted → released (yielded) | core/hostlimit/limiter.go ShouldYield, waiterLive; core/storage/chunk_layer.go stage; core/storage/chunk_cut_budget.go ErrCutYielded, budgetYield; core/frontend/durable/provider_chunk.go cutPolicy.after |
TestShouldYieldOnlyAfterSWithALiveWaiter (core/hostlimit/yield_test.go); TestCutYieldsAtABatchBoundaryAndKeepsItsStaging (core/storage/chunk_cut_yield_test.go); TestChunkLoop_AYieldIsRetriedAtOnceAndCountedApart (core/frontend/durable/cut_loop_yield_test.go) |
SlotShareN (yield on the waiting probe, a new ticket at the back); SlotShare rows 189 to 193 | ACTIVE |
INV-HOST-CUT-BUDGET-CONFIG-001 |
A busy configuration lock or a mismatched pool configuration refuses every class, urgent included, with no fallback. | M7 free → admitted (refused) | core/hostlimit/limiter.go pool, Admit |
TestConfigurationLockContentionRefusesAllClasses (core/hostlimit/limiter_test.go) |
— | ACTIVE |
INV-HOST-CUT-BUDGET-FALLBACK-001 |
Only urgent admissions (urgent move-final cuts and named seals) proceed while the pool is unavailable, on a per-process fallback that claims no host-wide bound, leaves uploads unpaced while only fallback leases live, and is reported as fallback while any such lease lives. | M7 free → admitted (pool unavailable) | core/hostlimit/limiter.go Admit, releaseLoop, WaitUpload |
TestUnusablePoolClassPolicy, TestLastFallbackReleaseClearsActiveStatus, TestUrgentFallbackUploadIsNotPaced, TestFallbackDoesNotUnpaceAHealthyLease, TestConfigurationLockFailurePreservesPoolPolicy (core/hostlimit/limiter_test.go); TestChunkControl_NamedSnapshotUsesUrgentFallback (core/host/volume/chunk_control_adapter_test.go) |
HostBudget (fallback excluded) |
ACTIVE |
INV-HOST-CUT-BUDGET-PACING-001 |
A process's upload pacing debt carries across its own leases, and a new process starts with no debt. | M7 admitted (upload pacing) | core/hostlimit/limiter.go WaitUpload |
TestPacingDebtSurvivesOwnLeaseTurnover, TestPacingFreshProcessesDoNotShareDebt (core/hostlimit/limiter_test.go) |
— | ACTIVE |
INV-HOST-POOL-CONFIG-001 |
A pool configuration is invisible until its complete synced temporary file is atomically renamed under the OS configuration lock. A killed initializer cannot leave a partial visible configuration that strands successors. | M7 configuration preparation/publication | core/hostlimit publishConfig |
TestKilledInitializerDoesNotPublishPartialConfiguration |
HostBudget NoPartialConfig/ConfigBeforeAdmission (filesystem atomicity checked natively) |
ACTIVE |
INV-HOST-URGENT-PENDING-001 |
While urgent work holds urgent-pending (its slot's lease or HoldUrgentPending), Normal admissions on the host are refused with ErrUrgentPending, a wait. Urgent work waits at most 200 ms for that hold and otherwise proceeds without it; a probe never blocks it. | M7 host cut admission (Normal before a slot) | core/hostlimit/limiter.go pool, Admit; core/hostlimit/pending.go HoldUrgentPending |
TestNormalWaitsWhileUrgentPendingIsHeld, TestUrgentLeaseHoldsThePendingSignal (core/hostlimit/pending_test.go); TestSlotsUrgentAndJoinedRelease (core/hostlimit/limiter_test.go) |
— | ACTIVE |
INV-HOST-LAUNCH-CHECK-001 |
blockvolume refuses to start with a --host-limit-dir that is missing or not a directory, under a temporary directory, on a network file system, or already in use with different host-limit flags. | M7 host cut admission (process start) | core/hostlimit/launch.go CheckLaunch; core/hostlimit/remotefs_linux.go; cmd/blockvolume/main.go |
TestCheckLaunch (core/hostlimit/pending_test.go) |
— | ACTIVE |
INV-LOCAL-HEADROOM-001 |
blockvolume refuses to create a volume when the durable root's free space is below the volume size plus its WAL, naming both numbers, before it creates the store, WAL or fresh marker, and warns at start when an existing volume's remaining sparse growth plus the WAL exceed the free space. | M1 open/create (durable provider start) | core/frontend/durable/headroom.go; core/frontend/durable/provider.go createFresh, openExisting |
TestCreateRefusesWithoutLocalHeadroom, TestOpenWarnsWithoutLocalHeadroom (core/frontend/durable/headroom_test.go) |
A lab build (tag swblock_lab_bigvol, scale rehearsals only) warns instead of refusing (TestLabBuildCreatesWithoutLocalHeadroom); CI keeps the tag out of every image and release build (.github/scripts/lab-tag-check.sh) |
ACTIVE |
INV-CREATE-MAX-SIZE-001 |
blockmaster refuses a new volume above MaxNewVolumeBytes (InvalidArgument) and, at format level 0, above 256 GiB (FailedPrecondition SIZE_REQUIRES_FORMAT_LEVEL_1), at CreateVolume and a cluster-spec import, before any record or store. An existing volume keeps opening under MaxVolumeBytes. |
create admission (CreateVolume, cluster-spec import) | core/geometry/volume_size.go ValidateNewVolumeSize, ValidateNewVolumeSizeAtLevel; core/host/master/services.go createLifecycleVolume; core/lifecycle/store.go CreateVolume; cmd/blockmaster/cluster_spec.go loadClusterSpec; core/host/master/services.go CreateVolume (restore geometry) |
TestCreateVolumeRefusesAVolumeAboveTheMaximum (core/host/master), TestClusterSpecRefusesAVolumeAboveTheMaximum (cmd/blockmaster), TestValidateNewVolumeSizeAtAndAboveTheMaximum, TestANewVolumeAboveTheLegacyBoundNeedsFormatLevel1 (core/geometry), TestCreateAboveTheLegacyBoundFollowsTheFormatLevel, TestClusterSpecImportAboveTheLegacyBoundFollowsTheFormatLevel (core/host/master), TestCreateVolumeRejectsBeyondUint32LBACap (core/lifecycle) |
FormatGate CreateBig / NoBigAtLevel0 (mutation big_at_level0); In a lab build (tag swblock_lab_bigvol, scale rehearsals only) MaxNewVolumeBytes is MaxVolumeBytes (TestLabBuildLiftsTheCreateCap); a release build keeps 1 TiB (TestReleaseBuildKeepsTheCreateCap, TestANewVolumeOfOneTiBIsCreated); the 256 GiB bound at level 0 holds in any build, and CI keeps the tag out of every image (.github/scripts/lab-tag-check.sh, scripts/refuse-lab-binary.sh) |
ACTIVE |
INV-HOST-TICKET-ORDER-001 |
A waiting timer cut is admitted only when no earlier ticket on the host is live and not stalled; dead tickets are removed, stalled ones (head free for 2 s) skipped. A volume waits at most (V-1) x T_cut,max plus the window's urgent work plus one poll per hand-off. | M7 waiting → admitted (reason: under random retry, 9 of 20 volumes on one host made zero cuts in 720 s) | core/hostlimit/tickets.go TakeTicket, headCheck, reap; core/hostlimit/limiter.go pool, Admit; core/frontend/durable/provider_chunk.go chunkLoop |
TestTicketsAdmitInDueOrder, TestDeadEarlierTicketIsRemoved, TestStalledEarlierTicketIsSkipped, TestNoSkipWhileTheSlotIsHeld, TestTicketRemovedBeforeItsLockIsRetaken, TestOneStalledTicketCostsOneSkipNotEveryHandoff, TestConfigurationLockHeldPastTheBoundIsAWait, TestTakeTicketDoesNotRecreateARemovedPool (core/hostlimit/tickets_test.go); TestCutPolicy_TicketOrderWaitBound (core/frontend/durable/cut_policy_test.go); TestChunkLoop_TicketKeptForAWaitDroppedOtherwise (core/frontend/durable/cut_loop_fence_test.go) |
HostTickets OrderedAdmission, BoundedWait, NoLostTicket, SingleHolder |
ACTIVE |
INV-HOST-TICKET-REENTRY-001 |
A timer cut never cuts without a ticket (a failed ticket creation waits for the next poll), and once an attempt of a turn was admitted and failed, every later ticket of that turn is at the back of the queue, never at the schedule's earlier due time. | M7 waiting → admitted | core/frontend/durable/provider_chunk.go chunkLoop |
TestChunkLoop_AConsumedAttemptRetriesAtTheBack, TestChunkLoop_NoTicketNoCut, TestChunkLoop_ARequeuedTurnStaysAtTheBackAcrossAWaitAndADrop (core/frontend/durable/cut_loop_ticket_order_test.go) |
SlotShareN (a cut that yields or retries takes a new ticket at the back) | ACTIVE |
INV-HOST-CUT-PACING-HOST-001 |
Coordinated cut transfers on one host upload at most the budget in total, plus at most H x PayloadBytes once per change of H (H = held normal and urgent slots); a lone transfer may use the whole budget. Fallback leases are excluded. | M7 admitted (upload pacing) | core/hostlimit/limiter.go WaitUpload, heldCodedSlots |
TestPacingUsesTheBudgetOverHeldSlots (core/hostlimit/tickets_test.go); TestPacingDebtSurvivesOwnLeaseTurnover (core/hostlimit/limiter_test.go) |
— | ACTIVE |
INV-HOST-SLOT-HOLD-VISIBLE-001 |
M7 cannot break a lock held by a live process: a stalled slot holder keeps its slot, a stalled urgent-pending holder keeps Normal admissions refused. A slot holder records its pid and take time in the slot file, and status reports them, so the supervisor can find and remove it. | M7 admitted | core/hostlimit/limiter.go Snapshot, slotFilesHeld, writeHolder |
TestSnapshotShowsSlotsHeldSince, TestSnapshotHeldSinceFollowsTheHolderAcrossAHandOff, TestSnapshotShowsUrgentPendingHeldSince (core/hostlimit/tickets_test.go) |
— | ACTIVE |
INV-HOST-URGENT-NOT-BLOCKED-001 |
Urgent work (a seal, a detach, a snapshot, a cut with a minimum LSN) is never refused for a waiter: it waits at most 200 ms for its urgent-pending hold and 50 ms for the configuration lock, then proceeds without the hold (counted) or answers ErrSlotsHeld (retryable). | M7 idle → admitted (Urgent) | core/hostlimit/pending.go holdSharedBounded, HoldUrgentPending; core/hostlimit/limiter.go Admit |
TestUrgentProceedsPastAStalledProbe, TestUrgentWaitsBrieflyForTheConfigurationLock, TestConfigurationLockHeldPastTheBoundIsAWait (core/hostlimit/tickets_test.go); TestRefusedUrgentAdmissionReleasesItsPendingHold (core/hostlimit/urgent_refusal_test.go) |
HostTickets UrgentNotBlocked, UrgentNotRefused |
ACTIVE |
INV-HOST-POOL-ERROR-CURRENT-001 |
A pool error the limiter reports (LastPoolError) is cleared by the next admission through the pool, so status shows a pool error only while it still holds. | M7 free → admitted | core/hostlimit/limiter.go Admit |
TestPoolErrorClearsOnTheNextGoodAdmission (core/hostlimit/tickets_test.go) |
— | ACTIVE |
INV-HOST-SLOT-BUSY-CODE-001 |
The chunk control API refuses a cut, snapshot or detach that host admission refused because every slot is held (or urgent work is pending) with 503 host_slot_busy, retryable; every other capture refusal keeps capture_refused. | M7 free → admitted (refused, wait) | core/host/volume/chunk_control.go chunkErrorCode |
TestHostSlotHeldHasItsOwnCode (core/host/volume/chunk_host_slot_code_test.go) |
— | ACTIVE |
INV-CUT-INTENT-FIRST-001 |
A cut or staging round begins (or replays) its holder session before any chunk or segment PUT. All upload waves use that session until commit. Payload I/O and pacing hold no adapter lock, so independent uploads and HEAD reads proceed. | M5 Begin → Upload → CAS | core/storage/chunk_cut_payload.go streamCutPayloads; core/storage/chunk_layer.go captureLocked, stage; core/frontend/chunkstore/layout_remote.go LayoutRemote.Begin |
TestSession_BegunBeforeFirstUploadAndClosedByCommit, TestSession_FailedBeginUploadsNothing (core/storage/chunk_layer_session_test.go); TestCutPayloadSessionBeginsIndependentOfCandidates, TestCutPayloadReadsOverlapEarlierUploadsWithinBudget (core/storage/chunk_review271_test.go); TestChunkPrecopy_StagedUploadsAreCoveredByIntents (core/storage/chunk_layer_precopy_test.go); TestLayoutRemoteUploadsOverlapWithoutBlockingHead, TestLayoutRemoteHeadReadDoesNotWaitForUpload (core/frontend/chunkstore/layout_upload_concurrency_test.go) |
ChunkLifecycleFixed GCSafe; WorkspaceTakeover NoLiveIntentExpired |
ACTIVE |
INV-CUT-INTENT-CLOSE-001 |
The session lives as long as the staged uploads: it is aborted only when they are dropped (Close, fenced, a HEAD moved past the commit's base, a settled proposal), never while a proposal's commit is unresolved; a refused cut that keeps its uploads keeps its session for the retry. | M5 Close | core/storage/chunk_layer.go Close, captureLocked, discardStaged, requeueCut |
TestChunkCloseAbortsTheOpenSessionUnlessACommitIsUnresolved (core/storage/chunk_review271_test.go); TestSession_AdmissionRefusedBeforeCommitKeepsReusableUploads (core/storage/chunk_layer_session_test.go); TestHeadBeltOldCASUnconfirmedKeepsSessionAndFrontier, TestHeadBeltLowerEpochConflictFencesWithoutCleanup, TestHeadBeltEmptyBaseForeignPublicationFences (core/storage/chunk_head_belt_test.go) |
— | ACTIVE |
INV-CUT-HYDRATION-WAIT-001 |
A read command shares its arrival deadline across chunks. A timed-out waiter returns typed pending without cancelling a shared fill. Per-layer worker and distinct-flight limits bound remote work; Close wakes waiters and joins issued fills before storage release. Physical/hash errors remain terminal. | M4 Holder (hydration wait) | core/storage/chunk_hydration.go; core/storage/walstore.go ReadContext; core/frontend/durable/storage_adapter.go readStorageBlock; core/frontend/nvme/session.go handleRead |
TestDurableHydration_MultipleChunksShareOneDeadline, TestDurableHydration_NVMePreservesPhysicalAndHashErrors, TestSessionReadBudgetIncludesQueueResidence, TestChunkHydration_QueueAndWorkerLimitsAreBounded, TestChunkHydration_CloseWakesCallerAndJoinsUninterruptibleGet, TestChunkHydration_ContextlessReadAllowsSlowFill, TestChunkHydration_NewGenerationDoesNotJoinStaleGet, TestChunkHydration_StaleCompletionKeepsReplacement, TestDurableHydration_RMWFenceWinsCallerExpiry |
— | ACTIVE |
INV-CUT-HYDRATION-PROGRESS-001 |
The status reports per volume the HEAD-named chunks still to hydrate (AbsentChunks) and the chunks hydrated so far (Hydration.Completed, cumulative); a read of an un-hydrated chunk moves both by one, a repeat read neither. Observation only. |
M5 hydration (reader; no transition) | core/storage/chunk_layer.go Stats (absentHydratable); core/storage/chunk_hydration.go hydrationWorker |
TestHydrationProgressCountersFollowFirstReads (core/frontend/durable/hydration_progress_test.go) |
— | ACTIVE |
INV-CUT-READMISS-001 |
A block fetched from HEAD after a move is installed only if it does not overwrite a newer local extent version; a newer WAL-only write still wins on reads, and HEAD's value may be installed beneath it as the backing value, which is correct if a crash loses that unsynced write. | M4 Holder (lazy restore) | core/storage/chunk_layer.go OnReadMiss, installFetchedBlock; core/storage/walstore.go readFromExtent |
TestChunkLayer_WALOnlyOverlapReadNeverReturnsUntouchedZero (core/storage/chunk_layer_races_test.go); TestWALStore_PostReadMissRechecksWALFormat (core/storage/walstore_read_miss_v3_test.go; real-store v2/v3 dispatch) |
— | ACTIVE |
INV-CHUNK-LOCAL-BEFORE-FETCH-001 |
A block that reaches the extent while its chunk is absent is local to the chunk layer before any fetch can install over it: a store opened for chunk use drains nothing to the extent and takes no BASE until its chunk layer attaches. | M4 Holder (lazy restore) | core/frontend/durable/provider.go (open and create of walstore-chunk, before Recover); core/storage/walstore.go HoldExtentDrainUntilChunkLayer, writeExtentUnlocked (refuses while held, the backstop); core/storage/flusher.go flushOnceInternal (every drain, the stop's included, checked with the snapshot under store.mu); core/storage/base_install_v3.go BeginBaseInstall; core/storage/chunk_layer.go attachChunkLayerImpl (releases the hold) |
TestReplayedWriteIsNotDrainedBeforeTheChunkLayerAttaches, TestACycleStartedBeforeTheHoldDoesNotDrainTheRecoveredWrite, TestAStopBeforeAttachDrainsNothing, TestABaseInstallIsRefusedWhileTheDrainIsHeld, TestAHeldStoreRefusesAnyExtentWriteUntilAttached, TestExtentWritersAreEnumerated (core/storage/chunk_replay_before_attach_test.go); TestProviderHoldsTheDrainOfAChunkStoreOnCreateAndOpen (core/frontend/durable/provider_drain_hold_test.go) |
— | ACTIVE |
INV-CUT-API-VERSION-001 |
Cut replies carry integer version 1; clients send none. CLI accepts own/N-1 holders or valid unversioned initial 200, never newer holders. Unsupported versions name both versions and exit unknown 3: HTTP status cannot prove non-admission; no re-POST or outcome claim. | M5 response validation | handleChunkCut; cutAPIAnswer; chunkObserveCut |
TestManualCutAPIVersionCoversEveryCutAnswer, TestCutCLINewerClientAcceptsOwnAndOneOlderHolder, TestCutCLIOlderClientRefusesNewerHolder, TestCutCLIUnsupportedVersionNeverStartsAnotherCut, TestCutCLIInvalidUnversionedInitialTerminalAnswerIsUnknown, TestCutCLIUnsupportedInitialErrorNeverProvesNonAdmission, TestCutCLILegacyTerminalAnswerNeedsNoPolling |
CutTime Poll response validation; lifecycle unchanged; native qualification owed | STUB |
INV-CUT-HANDLE-LIFETIME-001 |
A manual handle survives until its own Wc after terminal; send and later work never retire or replace it. Four retained handles per volume bound admission, with no eviction. The control owns and joins workers; observer cancellation does not cancel admitted work. | M5 manual admission / retained answer | core/host/volume/manual_cut.go; core/storage/chunk_manual_cut.go |
TestManualCutHandlesKeepLostTerminalRepliesUntilTheirOwnWindow, TestManualCutHTTPReturnsHandleAndCloseJoinsWorker, TestManualCutBusyNamesTheRunningCaptureWithoutQueueing, TestManualCutObserverCancellationDoesNotCancelAdmittedWork, TestManualCutDefaultPostUsesHandleAndPromptProgress, TestManualCutExplicitDeadlineCancelsTheHandleWorker (core/host/volume/manual_cut_test.go); TestManualCutCaptureAdmissionNeverQueuesAndNamesItsOwner (core/storage/chunk_manual_cut_test.go) |
CutTime r6 Admit/Poll/ReplyLost/Retire, supplied30/30; ledger465-467 | STUB |
INV-CUT-PUBLISH-SETTLE-001 |
Pending proposals carry invocation tags. Inherited settlement renews W and sequence once before the own barrier, never supplying its result. Own read-back progress renews; a foreign HEAD terminates without renewal. Settlement silence is unknown, never cut_stalled. | M5 PublishLost/Settle/SettleStall | chunk_manual_cut.go captureManualCut; chunk_layer.go resolvePendingWithProgress; chunkObserveCut |
TestManualCutSettlesLostPublicationWithoutUploadingAgain, TestManualCutUnansweredSettlementIsUnknownNeverStalled, TestManualCutForeignHeadFenceTerminatesSettlement, TestManualCutInheritedPublicationCannotReplaceItsOwnBarrier, TestManualCutPendingProposalsHaveDistinctInvocationTags, TestManualCutInheritedSettlementRenewsBeforeOwnWorkExceedsTheWindow, TestCutCLISettlementUnknownEndsWithoutRepostingOrWaitingAnotherWindow |
CutTime r8c NoFalseFailure, OwnResult, NoRetryAfterFence, SettleInherited; supplied BFS 46/46 | STUB |
INV-CUT-PROGRESS-WINDOW-001 |
A cut has no total cap. Only completed own-plan upload/verification/adoption steps renew W; failed, conflicted or timed-out calls do not. Each call has a deadline. Silence before uncertain publication yields cut_stalled and retains work. Uncertain publication follows INV-CUT-PUBLISH-SETTLE-001. | M5 Copy/Upload/Verify/Publish | core/storage/cut_progress_window.go; core/storage/chunk_upload.go; core/frontend/chunkstore/cut_verification_window.go; layout.allOwnedBySession; DurableProvider.chunkCutContext; StatusServer.handleChunkCut |
TestManualCutProgressingBeyondFiveMinutesFinishesWithOneAdmission, TestManualCutCallTimeoutRetriesWithoutEndingTheWindow, TestManualCutSilenceReturnsTypedStallAtItsWindow, TestManualCutStallRetryKeepsProgressAndReportsAttemptCounters, TestManualCutTimedOutCallsDoNotRenewProgress (core/host/volume/cut_progress_window_test.go); TestCutVerification262144ObjectsAfterUploadRenewsTheWindow, TestCutVerificationConflictedAdoptionsDoNotRenewTheWindow, TestCutVerificationTimeoutRetriesTheIndividualLookup, TestCutVerificationRetriesTheProductionGRPCDeadline (core/frontend/chunkstore/cut_verification_window_test.go); TestCutSilenceWindowIncludesUploadWithBackgroundCaller; TestCutWindowErrorPreservesCallerDeadlineAfterWorkerCancellation |
CutWindow r1 Complete/CallTimeout/Fail/Tick/Retry/Publish; CutTime r6 Complete, own per-object set; supplied 30/30 | ACTIVE |
INV-CLI-CUT-PROGRESS-WINDOW-001 |
The CLI POSTs once, then polls its in-memory cut ID. Only a strictly rising own sequence renews Wc. Silence, restart or the absolute deadline returns unknown; cut_stalled returns failure. Admission cut_busy is retryable. No re-POST or persisted cut receipt. | Cut CLI Admission/Busy/Polling/Success/Failed/Unknown | cmd/sw-block/cut_progress_poll.go |
TestCutCLIStartsOnceThenOnlyPollsTheReturnedID, TestCutCLIProgressingFor46MinutesPollsOneCutID, TestCutCLIRestartLosesTheHandleWithoutClaimingFailure, TestCutCLIBusyIsDistinctAndDoesNotStartAnotherCut, TestCutCLIUnchangedSequenceCannotRenewItsWindow, TestCutCLIAbsoluteDeadlineEndsAProgressingCut, TestCutCLIUnansweredRequestEndsUnknownWithinItsOwnWindow, TestCutCLIForeignSequenceCannotRenewItsWindow, TestCutCLIStalledAnswerIsAFailure (cmd/sw-block/cut_progress_poll_test.go); TestOpsChunk_OversizedResponseIsRefused, TestOpsChunk_LostResultFailsTheCommand, TestOpsChunk_HTTPCommandsSendSpecRequests, TestOpsChunk_HTTPFailureIsTyped, TestOpsChunk_ErrorsAreJSONOnStdout (cmd/sw-block/chunk_output_test.go, cmd/sw-block/chunk_test.go) |
CutTime r6 458-467 Poll/InProgress/CliSilent/CliGiveUp/HolderRestart/Retire/ReplyLost; supplied BFS 30/30 in docs/spec/cuttime | STUB |
INV-CUT-DETACH-HANDLE-001 |
An observed plain detach takes one reserved handle beside the four manual ones, so four live manual handles never refuse it. While it is live, a new manual cut is refused cut_busy. | M5 plain detach admission / handle | core/host/volume/plain_detach_handle.go startPlainDetach, settlePlainDetach; core/frontend/durable/provider_chunk.go retryUnknownDetach; cmd/sw-block/cut_progress_poll.go chunkObserveHandle; core/storage/chunk_preempt.go PreemptScheduledCapture, LinkCutProgress; core/frontend/durable/provider_preempt.go |
TestAStopWithFourLiveManualCutHandlesSucceeds, TestAStopDuringARunningManualCutWaitsAndKeepsRising, TestAStopPreemptsARunningScheduledCut, TestAnObservedPlainDetachIsPolledOnTheCutStatusRoute, TestAStopWithALostPublishAnswerSettlesOnTheSameHandle, TestAStopWhoseSettlementMakesNoProgressEndsTypedUnknown, TestAStopWhoseSettlementReadBacksCompleteOutlivesItsWindow, TestAStopQueuedBehindASilentManualCutDoesNotStall, TestAManualCutIsRefusedWhileAStopIsLive, TestAStopQueuedBehindAManualCutStallsOnASilentFinalCut (core/host/volume/plain_detach_handle_test.go); TestChunkPlainDetachWindowOutOfRangeIsRefusedBeforeWork, TestChunkPlainDetachAnswersCarryTheCutAPIVersion (core/host/volume/chunk_plain_detach_test.go); TestOpsChunkPlainDetachHandleEndedUnknownIsReportedAtOnce (cmd/sw-block/chunk_plain_test.go); TestPreemptCancelsOnlyAScheduledCaptureHolder, TestLinkedCutProgressCreditsOnlyStepsAfterTheLink, TestALinkedStepRenewsTheWaitingWindow, TestALinkMadeDuringAStepIsNotCreditedWithIt, TestAScheduledHolderIsPreemptibleTheMomentItOwnsTheLock, TestAQueuedStopsWindowStartsAtItsCaptureAdmission (core/storage/chunk_preempt_test.go); TestOpsChunkPlainDetachFirstAnswerUnknownWithItsIDIsUnknown (cmd/sw-block/chunk_plain_test.go) |
CutTime r7 Preempt/DetachQ/OtherStep/OtherEnd, NoManualPreempt, ProgressKept; CutTime r8b PublishLost/Settle/SettleStall, NoFalseFailure, CliUnknownOnlySilent; r8d detach priority (NoQueuedStall, mutant manual_overtakes; BFS 48/48) | ACTIVE |
INV-CUT-DETACH-PREEMPT-001 |
With no manual cut running, an observed plain detach preempts a scheduled capture (whose staged uploads are reused) and never a manual one. | M5 plain detach admission / handle | core/host/volume/plain_detach_handle.go startPlainDetach, settlePlainDetach; core/frontend/durable/provider_chunk.go retryUnknownDetach; cmd/sw-block/cut_progress_poll.go chunkObserveHandle; core/storage/chunk_preempt.go PreemptScheduledCapture, LinkCutProgress; core/frontend/durable/provider_preempt.go |
TestAStopWithFourLiveManualCutHandlesSucceeds, TestAStopDuringARunningManualCutWaitsAndKeepsRising, TestAStopPreemptsARunningScheduledCut, TestAnObservedPlainDetachIsPolledOnTheCutStatusRoute, TestAStopWithALostPublishAnswerSettlesOnTheSameHandle, TestAStopWhoseSettlementMakesNoProgressEndsTypedUnknown, TestAStopWhoseSettlementReadBacksCompleteOutlivesItsWindow, TestAStopQueuedBehindASilentManualCutDoesNotStall, TestAManualCutIsRefusedWhileAStopIsLive, TestAStopQueuedBehindAManualCutStallsOnASilentFinalCut (core/host/volume/plain_detach_handle_test.go); TestChunkPlainDetachWindowOutOfRangeIsRefusedBeforeWork, TestChunkPlainDetachAnswersCarryTheCutAPIVersion (core/host/volume/chunk_plain_detach_test.go); TestOpsChunkPlainDetachHandleEndedUnknownIsReportedAtOnce (cmd/sw-block/chunk_plain_test.go); TestPreemptCancelsOnlyAScheduledCaptureHolder, TestLinkedCutProgressCreditsOnlyStepsAfterTheLink, TestALinkedStepRenewsTheWaitingWindow, TestALinkMadeDuringAStepIsNotCreditedWithIt, TestAScheduledHolderIsPreemptibleTheMomentItOwnsTheLock, TestAQueuedStopsWindowStartsAtItsCaptureAdmission (core/storage/chunk_preempt_test.go); TestOpsChunkPlainDetachFirstAnswerUnknownWithItsIDIsUnknown (cmd/sw-block/chunk_plain_test.go) |
CutTime r7 Preempt/DetachQ/OtherStep/OtherEnd, NoManualPreempt, ProgressKept; CutTime r8b PublishLost/Settle/SettleStall, NoFalseFailure, CliUnknownOnlySilent; r8d detach priority (NoQueuedStall, mutant manual_overtakes; BFS 48/48) | ACTIVE |
INV-CUT-DETACH-QUEUE-001 |
Behind a running manual cut, the detach waits with its own window held: only that cut's steps after the link, plus one at its end, raise its sequence, and its own window starts at its capture admission. | M5 plain detach admission / handle | core/host/volume/plain_detach_handle.go startPlainDetach, settlePlainDetach; core/frontend/durable/provider_chunk.go retryUnknownDetach; cmd/sw-block/cut_progress_poll.go chunkObserveHandle; core/storage/chunk_preempt.go PreemptScheduledCapture, LinkCutProgress; core/frontend/durable/provider_preempt.go |
TestAStopWithFourLiveManualCutHandlesSucceeds, TestAStopDuringARunningManualCutWaitsAndKeepsRising, TestAStopPreemptsARunningScheduledCut, TestAnObservedPlainDetachIsPolledOnTheCutStatusRoute, TestAStopWithALostPublishAnswerSettlesOnTheSameHandle, TestAStopWhoseSettlementMakesNoProgressEndsTypedUnknown, TestAStopWhoseSettlementReadBacksCompleteOutlivesItsWindow, TestAStopQueuedBehindASilentManualCutDoesNotStall, TestAManualCutIsRefusedWhileAStopIsLive, TestAStopQueuedBehindAManualCutStallsOnASilentFinalCut (core/host/volume/plain_detach_handle_test.go); TestChunkPlainDetachWindowOutOfRangeIsRefusedBeforeWork, TestChunkPlainDetachAnswersCarryTheCutAPIVersion (core/host/volume/chunk_plain_detach_test.go); TestOpsChunkPlainDetachHandleEndedUnknownIsReportedAtOnce (cmd/sw-block/chunk_plain_test.go); TestPreemptCancelsOnlyAScheduledCaptureHolder, TestLinkedCutProgressCreditsOnlyStepsAfterTheLink, TestALinkedStepRenewsTheWaitingWindow, TestALinkMadeDuringAStepIsNotCreditedWithIt, TestAScheduledHolderIsPreemptibleTheMomentItOwnsTheLock, TestAQueuedStopsWindowStartsAtItsCaptureAdmission (core/storage/chunk_preempt_test.go); TestOpsChunkPlainDetachFirstAnswerUnknownWithItsIDIsUnknown (cmd/sw-block/chunk_plain_test.go) |
CutTime r7 Preempt/DetachQ/OtherStep/OtherEnd, NoManualPreempt, ProgressKept; CutTime r8b PublishLost/Settle/SettleStall, NoFalseFailure, CliUnknownOnlySilent; r8d detach priority (NoQueuedStall, mutant manual_overtakes; BFS 48/48) | ACTIVE |
INV-CUT-DETACH-SETTLE-001 |
A lost publish answer is settled on the same handle inside its window: each completed read-back renews the window and raises the sequence; a settlement without a completed read-back for the window ends outcome_unknown, which the CLI reports at once. | M5 plain detach admission / handle | core/host/volume/plain_detach_handle.go startPlainDetach, settlePlainDetach; core/frontend/durable/provider_chunk.go retryUnknownDetach; cmd/sw-block/cut_progress_poll.go chunkObserveHandle; core/storage/chunk_preempt.go PreemptScheduledCapture, LinkCutProgress; core/frontend/durable/provider_preempt.go |
TestAStopWithFourLiveManualCutHandlesSucceeds, TestAStopDuringARunningManualCutWaitsAndKeepsRising, TestAStopPreemptsARunningScheduledCut, TestAnObservedPlainDetachIsPolledOnTheCutStatusRoute, TestAStopWithALostPublishAnswerSettlesOnTheSameHandle, TestAStopWhoseSettlementMakesNoProgressEndsTypedUnknown, TestAStopWhoseSettlementReadBacksCompleteOutlivesItsWindow, TestAStopQueuedBehindASilentManualCutDoesNotStall, TestAManualCutIsRefusedWhileAStopIsLive, TestAStopQueuedBehindAManualCutStallsOnASilentFinalCut (core/host/volume/plain_detach_handle_test.go); TestChunkPlainDetachWindowOutOfRangeIsRefusedBeforeWork, TestChunkPlainDetachAnswersCarryTheCutAPIVersion (core/host/volume/chunk_plain_detach_test.go); TestOpsChunkPlainDetachHandleEndedUnknownIsReportedAtOnce (cmd/sw-block/chunk_plain_test.go); TestPreemptCancelsOnlyAScheduledCaptureHolder, TestLinkedCutProgressCreditsOnlyStepsAfterTheLink, TestALinkedStepRenewsTheWaitingWindow, TestALinkMadeDuringAStepIsNotCreditedWithIt, TestAScheduledHolderIsPreemptibleTheMomentItOwnsTheLock, TestAQueuedStopsWindowStartsAtItsCaptureAdmission (core/storage/chunk_preempt_test.go); TestOpsChunkPlainDetachFirstAnswerUnknownWithItsIDIsUnknown (cmd/sw-block/chunk_plain_test.go) |
CutTime r7 Preempt/DetachQ/OtherStep/OtherEnd, NoManualPreempt, ProgressKept; CutTime r8b PublishLost/Settle/SettleStall, NoFalseFailure, CliUnknownOnlySilent; r8d detach priority (NoQueuedStall, mutant manual_overtakes; BFS 48/48) | ACTIVE |
INV-CLI-VOLUME-OBSERVED-001 |
sw-block volume stop observes its cut and sw-block volume backup its snapshot operation: one admission, then reads of the same handle. A terminal answer counts only for its own cut or operation, in a supported cut API version. |
Cut CLI Admission/Polling/Unknown (volume verbs) | cmd/sw-block/volume_verbs.go volumeCut; cmd/sw-block/volume_backup.go volumeSnapshot, observeSnapshotOperation |
TestVolumeStopObservesALongCutByItsID, TestVolumeStopGivesUpUnknownWhenItsCutStopsProgressing, TestVolumeStopAcceptsOnlyItsOwnCutInItsProtocol (cmd/sw-block/volume_verbs_test.go); TestVolumeBackupWaitsOnTheSnapshotOperation, TestVolumeBackupStalledOperationIsUnknown, TestVolumeBackupSynchronousHolderIsUnsupported, TestVolumeBackupOperationHandleLostSilentOrForeignIsUnknown (cmd/sw-block/volume_backup_test.go); TestChunkSnapshotSynchronousHolderIsUnsupported (cmd/sw-block/chunk_request_loop_test.go) |
CutTime r7 Poll/InProgress/CliSilent/CliGiveUp | ACTIVE |
INV-CLI-VOLUME-WAIT-001 |
For the stop only a rise of its cut's sequence renews --timeout (plus slack); the backup bounds each read and its operation ends itself (stalled). Silence, an unknown handle or --deadline is an unknown outcome; the stop then leaves the unit running. | Cut CLI Admission/Polling/Unknown (volume verbs) | cmd/sw-block/volume_verbs.go volumeCut; cmd/sw-block/volume_backup.go volumeSnapshot, observeSnapshotOperation |
TestVolumeStopObservesALongCutByItsID, TestVolumeStopGivesUpUnknownWhenItsCutStopsProgressing, TestVolumeStopAcceptsOnlyItsOwnCutInItsProtocol (cmd/sw-block/volume_verbs_test.go); TestVolumeBackupWaitsOnTheSnapshotOperation, TestVolumeBackupStalledOperationIsUnknown, TestVolumeBackupSynchronousHolderIsUnsupported, TestVolumeBackupOperationHandleLostSilentOrForeignIsUnknown (cmd/sw-block/volume_backup_test.go); TestChunkSnapshotSynchronousHolderIsUnsupported (cmd/sw-block/chunk_request_loop_test.go) |
CutTime r7 Poll/InProgress/CliSilent/CliGiveUp | ACTIVE |
INV-CLI-VOLUME-SYNC-001 |
The stop accepts an older holder's valid initial unversioned synchronous answer for its own volume (INV-CUT-API-VERSION-001); the backup reports a synchronous answer as an unsupported holder, naming the upgrade. |
Cut CLI Admission/Polling/Unknown (volume verbs) | cmd/sw-block/volume_verbs.go volumeCut; cmd/sw-block/volume_backup.go volumeSnapshot, observeSnapshotOperation |
TestVolumeStopObservesALongCutByItsID, TestVolumeStopGivesUpUnknownWhenItsCutStopsProgressing, TestVolumeStopAcceptsOnlyItsOwnCutInItsProtocol (cmd/sw-block/volume_verbs_test.go); TestVolumeBackupWaitsOnTheSnapshotOperation, TestVolumeBackupStalledOperationIsUnknown, TestVolumeBackupSynchronousHolderIsUnsupported, TestVolumeBackupOperationHandleLostSilentOrForeignIsUnknown (cmd/sw-block/volume_backup_test.go); TestChunkSnapshotSynchronousHolderIsUnsupported (cmd/sw-block/chunk_request_loop_test.go) |
CutTime r7 Poll/InProgress/CliSilent/CliGiveUp | ACTIVE |
INV-CUT-TIMER-RESTART-001 |
A successful cut of any kind restarts the periodic timer, which runs on in-process monotonic time (a restart starts a fresh schedule; wall-clock steps move nothing). | M5 periodic trigger (before Admit) | core/frontend/durable/provider_chunk.go chunkLoop |
TestWALStoreChunk_ExplicitCutRestartsTheTimer, TestWALStoreChunk_ExplicitCutOverlappingTheTimerRestartsIt (core/frontend/durable/provider_chunk_sched_test.go); TestCutPolicy_TimerRunsOnObservationTime, TestCutPolicy_StaggerPreservesExplicitTimerReset (core/frontend/durable/cut_policy_test.go) |
— | ACTIVE |
INV-CUT-TIMER-SKIP-001 |
A periodic cut decided from an older last cut is skipped under the capture lock: no automatic cut follows another within the interval. | M5 periodic trigger (before Admit) | core/storage/chunk_periodic_cut.go CutUnlessCutSince; core/frontend/durable/provider_chunk.go chunkLoop |
TestChunkPeriodicCut_SkipsAfterANewerCut, TestChunkPeriodicCut_SkipsANewerCutWithAnOlderStamp (core/storage/chunk_periodic_cut_test.go); TestWALStoreChunk_ExplicitCutOverlappingTheTimerRestartsIt (core/frontend/durable/provider_chunk_sched_test.go) |
— | ACTIVE |
INV-CUT-TIMER-SLOT-WAIT-001 |
A periodic cut refused for held host slots, pending urgent work or an earlier ticket is a wait, not a failure: no backoff or minimum spacing; it retries at the next poll in ticket order, and status reports the wait until any later cut succeeds. Other errors keep the backoff. | M5 periodic trigger (before Admit) | core/frontend/durable/provider_chunk.go cutPolicy.after, chunkLoop; core/hostlimit/limiter.go ErrSlotsHeld |
TestCutPolicy_HostSlotBusyIsAWaitNotAFailure, TestCutPolicy_SuccessDuringSlotWaitEndsTheWait, TestCutWaitSlot_StatusEndsTheWaitAfterALaterCut, TestCutPolicy_TicketOrderWaitBound (core/frontend/durable/cut_policy_test.go); TestTimerCutRunsSoonAfterHostSlotFrees, TestSlotWaitEndsWithASuccessfulDetachSeal (core/frontend/durable/host_slot_wait_test.go); TestAdmitClosedDuringPoolAcquisitionIsRevoked (core/hostlimit/limiter_test.go) |
— | ACTIVE |
INV-SNAPSHOT-ANSWER-COUNT-001 |
Newly produced snapshot creation and listing answers omit the uncomputed chunk count; no manifest scan is added to answer a snapshot. | M9 snapshot answer projection (no transition change) | core/frontend/chunkstore/control_types.go, api.go; core/host/volume/chunk_control.go |
TestSnapshotAfter200MiBWritesOmitsUncomputedChunkCount (core/host/volume/snapshot_chunk_count_test.go) |
NONE (pure projection of the published snapshot; no authority or persisted format change) | STUB |
INV-SPEC-DELETE-RETIRE-001 |
Retire spec-removed metadata only under a permanent reservation after no-live-lease and a subsequent HEAD read proves deleted or absent. Read errors, live HEAD and deleting HEAD keep the records. Retirement never removes the reservation or store data. | M4 delete retirement | core/host/master/spec_retirement.go; core/authority/workspace_retirement.go, authority_store_file.go |
TestSpecRetirementReadsHeadOnlyAfterLeaseAndKeepsTombstone, TestSpecRetirementRequiresDeletedOrAbsentAndReadableHead, TestSpecRetirementDoesNotUseAbsentHeadWithoutReservation, TestRetirementKeepsReservationAndWaitsForLiveLease, TestFileAuthorityRetirementSurvivesReloadAndKeepsOtherRecords, TestSpecRetirementBackgroundBoundsReadsAndCachesTerminalProof, TestSpecRetirementLocalFailureDoesNotStopOtherVolumesOrProductTick |
DeleteRetire.ReadOK; DeleteRetire.RetireLine; DeleteRetire.RetirePlace; DeleteRetire.HostRetire | STUB |
INV-SPEC-DELETE-RETRY-001 |
Startup lease barriers schedule one more retirement pass after the latest observed barrier, independently of the product loop. The pass rechecks every lease and HEAD guard, logs skipped volumes, and is cancelled and joined before stores close. | M4 delete retirement scheduling | core/host/master/host.go Start, Close; spec_retirement.go startPostFloorRetirement |
TestStandaloneRestartRetriesSpecRetirementAfterLeaseFloor, TestRetirementLeaseBarrierIsOnlyASchedulingHint, TestPostFloorRetirementTimerJoinsOnCancellation |
DeleteRetire.ReadOK; DeleteRetire.RetireLine; DeleteRetire.RetirePlace | STUB |
INV-SPEC-UNUSED-PLACEMENT-001 |
A spec startup prunes an undesired placement only before serving and with no volume record, authority line, binding or deletion reservation, and no skipped authority recovery. The desired spec and seed are one keep set. | M4 registration input | cmd/blockmaster/main.go; core/host/master/spec_retirement.go |
TestClusterSpecImportRemovesUnusedPlacementMissingFromSpec, TestClusterSpecCleanupKeepsRecordsBindingsAuthorityAndSeed |
NONE (registration-only cleanup before controller activity) | STUB |
INV-CHECK-DELETING-001 |
A post-lease reserved volume with HEAD deleting, deleted or absent holds no serving work. Its status is informational and checks issue no lease or holder requests for it. Another volume's failures remain visible. | M9 delete observation | core/host/master/observation_snapshot.go, journal_isolation.go; cmd/sw-block/shell_check.go |
TestSpecRetirementRequiresDeletedOrAbsentAndReadableHead, TestSpecRetirementReadsHeadOnlyAfterLeaseAndKeepsTombstone, TestClusterCheckDoesNotProbeDeletingOrDeletedVolumes |
DeleteRetire.HostRetire | STUB |
INV-CLI-DELETE-RETRY-001 |
Only the final lease barrier after a committed volume-delete reservation permits retryable true/exit 75 at its horizon. A live-holder Reserve refusal requires stopping the volume first (not_admitted, non-retryable, exit 1). No lease guard is bypassed. | M9 delete admission result projection | cmd/sw-block/chunk_volume_delete.go authorityErr; cmd/sw-block/chunk.go chunkResult |
TestVolumeDeleteAdmissionRetryAnswer; TestOpsChunkVolumeDeleteRefusalSaysNothingWasPersisted |
MoveAdmission.DelRead; MoveAdmission.DelMark (unchanged guards) | STUB |
INV-SNAPSHOT-REPLAY-FLAG-001 |
A successful same-ID snapshot admission reports replayed true without changing HEAD or its retained outcome. First creation reports false; the flag decorates only the response. | M9 snapshot outcome projection | core/host/volume/snapshot_operation.go, chunk_control.go; cmd/sw-block/snapshot_operation.go |
TestSnapshotReplayFlagDoesNotRewriteOutcome, TestSnapshotCLIUsesReplayedAdmissionAnswer |
SnapOps.Poll; SnapOps.Start (no transition change) | STUB |
INV-CLI-UNSENT-REQUEST-001 |
An observed operation's initial typed dial failure sends no admission and is remote_unavailable (75) through the shared classifier. A lost answer after send, or a dial failure while polling an admitted handle, retains outcome_unknown. | CLI pre-admission error projection; no server transition | cmd/sw-block/cut_progress_poll.go chunkObserveHandle; chunkTransportFailure, chunkFail |
TestPlainDetachRefusedDialIsRemoteUnavailable, TestPlainDetachLostAnswerAfterSendStaysUnknown, TestPlainDetachPollDialFailureKeepsAdmittedOutcomeUnknown, TestOpsChunk_ErrorsAreJSONOnStdout |
CutTime Poll/CliGiveUp boundary; pre-admission transport proof | ACTIVE |
INV-CLI-CATALOG-ERROR-001 |
The chunk CLI preserves admission evidence and definite domain/certificate answers. Possibly-sent requests require replay/poll. Incomplete verify never exits 3; non-retryable server answers never exit 75. Absent snapshot delete is snapshot_not_found. | M9 client error projection; M4 census refusal, no transition change | core/rpc/answer Lookup; cmd/sw-block/chunk_answer.go chunkAnswer; cmd/sw-block/chunk.go chunkResult; cmd/sw-block/catalog_snapshot_operation.go catalogSnapshotDeleteRefusal; core/frontend/chunkstore/single_filer.go CheckSingleFiler; core/frontend/chunkstore/layout/delete.go RunMarkDeleting |
TestOpsChunkTransportFailureMatrix, TestOpsChunkVerifyUnreachableCensusPreservesTransport, TestCheckSingleFilerKeepsTransportCause, TestSingleFilerConfigurationErrorDeadlineBetweenReads, TestCheckSingleFilerSlowDialOrdering, TestDialBCatalogKeepsCustomCallerDeadline, TestMasterCensusKeepsCustomCallerDeadline, TestCheckSingleFilerValidatesAllMasterAddressesBeforeCensus; TestOpsChunkCatalogUnavailableIsTyped, TestCatalogTransportClassificationKeepsDefiniteAnswers, TestSnapshotDeleteAbsentCLIUsesContractCodeAndKeepsReceipt; TestLinkNeverTurnsASentRequestIntoSafeResend; TestChunkHTTPPostLostAnswerIsUnknown; TestCommandFamilyTransportGrid; TestLocalCredentialsFailBeforeDialWithTypedPolicy; TestHTTPCancellationBeforeDispatchKeepsOperationPhase; TestDeclaredDomainCodesHaveRegistryRows; TestOwnedClientTransportsKeepAdmissionEvidence; TestPresentationFailsClosedForUnknownContract; TestUnsentRPCWithMixedPeerFailuresIsRetryable; TestRPCPeerCertificateFailureDoesNotHideHandshakeTimeout; TestRPCSucceedsOnGoodPeerAfterBadCertificate; TestPeerCertificateProofRequiresEveryFreshCompletedAttempt; TestPeerDiagnosticTruncationNeverAuthorizesTerminalClassification; TestTypedRemoteUnavailableRespectsRetryable; TestNonRetryableServerAnswerNeverInvitesTemporaryRetry; TestVerifyStartCheckLostAnswerNeverLooksLikeFindings; TestVerifyIncompleteTransportPreservesPartialProgress; TestOpsFailoverUsesSharedDefiniteExitProjection; TestBlobHTTPAnswerSurvivesLayoutFetch; TestPlaintextPrefaceFailureKeepsUnsentRetryAndTLSHint; TestHTTPPartialCustomTraceCannotProveUnsentAfterReceivedPOST; TestHTTPRegisteredProtocolCannotProveUnsentAfterReceivedPOST; TestHTTPOwnedTransportDoesNotInheritRegisteredDefault; TestDelayedPeerNotificationCannotRefreshAnOldTLSFailure; TestObservedTLSForwardsPerCallAuthorityValidation; TestChunkCensusPreflightPreservesOpaqueContextCause |
SnapOps.Poll; CutTime.Poll; CutTime.CliGiveUp (result projection; no new transition) | STUB |
INV-CLI-CHUNK-LOOP-001 |
Above the per-request bound, sw-block ops chunk snapshot|detach repeats the SAME request (same name and request id) only after a retryable or outcome_unknown answer. Manual cut and plain detach use the separate one-POST/read-only-poll contract. | client (no state machine): the CLI side of M5 requests | cmd/sw-block/chunk_loop.go chunkPostLoop; cmd/sw-block/chunk.go chunkPostUntil |
TestChunkSnapshotRepeatsTimedOutRequestsWithTheSameBody, TestChunkSnapshotLoopReusesTheGeneratedRequestID, TestChunkLoopRepeatsAnOutcomeUnknownNotMarkedRetryable (cmd/sw-block) |
— | ACTIVE |
INV-CLI-CHUNK-LOOP-002 |
Above the per-request bound, sw-block ops chunk snapshot|detach stops at the first definite answer (success or non-retryable refusal). | client (no state machine): the CLI side of M5 cut requests | cmd/sw-block/chunk_loop.go chunkPostLoop |
TestChunkLoopStopsOnANonRetryableRefusal, TestChunkDetachOutcomeUnknownSettles (cmd/sw-block) |
— | ACTIVE |
INV-CLI-CHUNK-LOOP-003 |
Non-plain detach and snapshot admission obey a positive total --timeout. Snapshot observation keeps the same ID with bounded calls and no total deadline. Manual cut and plain detach use the separate inactivity-window contract. | client (no state machine): the CLI side of M5 cut requests | cmd/sw-block/chunk_loop.go chunkPostLoop; cmd/sw-block/chunk.go chunkPostUntil |
TestChunkLoopEndsAtTheTimeout, TestChunkLoopHeldProgressReadSendsNoRequestAfterTheTimeout, TestChunkLoopSlowAnswersAreBoundedByTheTimeout, TestChunkNonPositiveTimeoutIsRefused (cmd/sw-block) |
— | ACTIVE |
INV-CLI-CHUNK-LOOP-004 |
Above the per-request bound, a sw-block ops chunk snapshot|detach request that ended before its own deadline is repeated only after a backoff (no hot loop). | client (no state machine): the CLI side of M5 cut requests | cmd/sw-block/chunk_loop.go chunkPostLoop |
TestChunkLoopPauseDoublesToItsCap, TestChunkLoopEndsAtTheTimeout (cmd/sw-block) |
— | ACTIVE |
| Cut-window wording is split between the short ledger statement and the detailed transition/grid rows: own-plan completion is counted once per object per attempt. This does not weaken conflict nonrenewal or cancellation, fencing and admission authority. The legacy CLI total-timeout rows exclude manual cut because it now has its own observation contract. |
A guest read has a cooperative arrival budget; internal contextless readers keep the owned fill timeout (default 30 s). With five immediate host retries, cold fills slower than roughly 20–24 s can still end in guest EIO despite shared work; retry-delay advertisement remains separate. A changed generation replaces its promise without abandoning the old worker. AllBlocks returns an error and no partial image on a failed read; the rebuild sender propagates it before sending blocks.
Notes:
-
INV-CLI-CATALOG-ERROR-001: Linux qualification remains pending; native CLI and receipt controls alone do not activate this row. A failed NoLiveLease observation keeps its transport cause under ErrHolderActive: the wrapper refuses progress but does not prove a live holder. Unsent transport failures permit the same operation to be resent; possibly-admitted failures require replay or polling; actual authority refusals stay definite. The existing volume-delete retry window now presents its exhausted remote failure as remote_unavailable rather than unavailable. -
INV-CUT-TIMER-RESTART-001,INV-CUT-TIMER-SKIP-001: cuts are identified and ordered by the layer's in-processCutSeq, never by theLastCutNswall stamp: aCutSeqnot seen before is a success at the moment it is observed, and a periodic decision is skipped onceCutSeqhas moved; at start the existing value is not new, so a restart keeps the startup phase. The scheduled-snapshot worker (INV-SNAP-SCHEDULED-KEEP-001) runs on the same monotonic time: a new attachment seeds its due time at the next stable per-volume grid slot after HEAD's newest scheduled snapshot, or is due immediately without scheduled history. Future creation times are clamped to now. A re-armed loop on the same handle keeps its schedule (failures, retry time); a restart restores the last success and overdue age from HEAD. Tests:TestScheduledSnapshotLoop_TakesEachSlotOnMonotonicTime,_RearmKeepsTheSchedule,_OverdueWithNoSuccess,TestSnapshotSchedule_SlotsAreOffsetPerVolume. -
Not reachable in this release:
INV-WS-FREEZE-ACCOUNTING-001(except its estimate and quiesce-slack report, which every successful cut returns) andINV-CUT-PRECOPY-001./chunk/detachrefusesfrozen(INV-CUT-FROZEN-DETACH-REFUSED-001) and blockvolume refuses--chunk-detach-precopy(INV-CUT-PRECOPY-FLAG-REFUSED-001), so neither the frozen admission nor the pre-copy admission runs in a released process. Their code is kept and their tests below the HTTP handler still assert them, so their status stays ACTIVE. For the same reason the pre-copy policy thatINV-CUT-PLAIN-DETACH-001keeps for an absent or falseplainfield is always off.INV-WS-FREEZE-REFUSAL-001stays reachable: its HTTP400 validation runs before the refusal. So doINV-WS-FREEZE-REFUSAL-INPUTS-001andINV-WS-FREEZE-REFUSAL-PRECEDENCE-001. -
INV-WS-FREEZE-REFUSAL-001: a genericbad_requestis not proof of a clean refusal. The validation also refuses a non-frozen request that carries a freeze origin (handleChunkDetach).INV-WS-FREEZE-REFUSAL-INPUTS-001compares the caller's Unix-nanosecond origin with blockvolume'stime.Now, with no skew bound. -
INV-HOST-CUT-BUDGET-001: an unavailable pool skips normal, fill and idle work with an alarm: see M7 (testTestUnusablePoolClassPolicy). Coordinated reservations do not account retained crash spill, fallback leases or process RSS (HostBudgetexcludes fallback). Guest I/O and WAL reclamation never take a slot (M7). Hold expiry (the no-progress windowNoProgress,INV-HOST-HOLD-NO-PROGRESS-001; the slot kept until its workers join,INV-HOST-CUT-BUDGET-SETTLE-001) and upload pacing (INV-HOST-CUT-BUDGET-PACING-001) run on the process's local clock. -
Enforced by reading (no test asserts it): the refusal of a non-frozen request that carries a freeze origin; and an explicit zero freeze origin, which the test sends only as a missing origin (both decode to zero).
-
INV-CUT-PRECOPY-001: Opt-in final-tail admission closes frontend admission, drains registered I/O before the store lock within a 100 ms caller context, then uses authoritative barrier candidates and measured costs. Ordinary refusal reopens tentative admission before rolling uploads; guest-frozen refusal instead sends no payload. A contended freeze fallback never replaces an existing pause or its queue clock. Final freeze queues without completion for up to five seconds; on resume every queued waiter is granted in arrival order under one lock hold; each then passes the normal gate; completion is unordered. The ended pause is cleared before those normal gate checks; queue deadlines are measured once from each command arrival and capped by five seconds or its earlier caller deadline, so independent I/O is concurrent and later arrivals cannot inherit an expired pause; host drain preserves the active queue, and transport teardown cancels commands before joining; no queued storage work is issued. Only settled detached publication permits handoff; aborted rounds retain dirty bytes. Warm attempts and measurement rounds are reported separately, with samples at start; both consume the same five-round budget. Admission fits the allowance, or declares an estimate within five seconds when it is at least 90% of the previous comparable known estimate, or on the final physical round. A nonempty tail stays samples_unknown until a successful rolling upload supplies a positive measured rate; the stop's own rounds count, and the conservative rate uses up to the latest three observations. The fixed input is the maximum of up to the latest five observations younger than fifteen minutes; disjoint parts come from the same selected observation. An empty tail needs no rate or fixed history: it declares the full ordinary allowance and reports an actual overrun. Ordinary admission never invents an upload rate. A guest-frozen attempt skips staging, forecasts and rechecks against five seconds minus guest elapsed, and refuses without uploading if it cannot fit. Only an explicit final override can bypass that estimate guard, with over_budget recorded; authority and publication settlement remain mandatory. Checkpoint tails are advisory same-window measurements. Nested Sync phases and live barrier-prefix spans explain fixed cost without double counting. -
INV-CUT-STAGED-REUSE-001:captureLockedalso requires HEAD's generation to be the one the stage was compared against (code reading; not asserted by these tests). -
INV-CUT-READ-LOGICAL-001: the staging clause (readChunkthroughWALStore.Read) is enforced by reading; no test captures WAL-only bytes through a staging round. -
INV-CUT-GUEST-BOUNDED-WAIT-001: the capture a write waits for is its own or that of the chunk's current copier or saver. Lazily absent blocks are left to the copier, which fills them from the base HEAD after it releases the entry. -
INV-CUT-PAYLOAD-BOUNDED-001: upload-worker buffers are not counted at run time; the budget reserves four chunk buffers per uploader and two per saver before any cached save is admitted (cutPayloadWorkers,installCOWWindow). Host-wide policy is a separate limiter module (INV-HOST-CUT-BUDGET-001). A host Budget admits a cut for this payload ceiling before staging or the barrier: see M5 Admit (testTestCutBudgetRefusesBeforeBarrier). Physical local I/O stays joined (INV-CUT-COW-DRAIN-001), and native at-H reads protect unsent candidates with COW (INV-CUT-COW-OWNER-001,INV-CUT-HOOK-BEFORE-APPEND). -
INV-CUT-PAYLOAD-SPILL-SOURCE-001:applyEntryV3(base install and replicated applies) runs the same COW hook, so it would charge the side file if a cut window were open. That is believed unreachable, since cut admission needs a healthy primary and no base install, but nothing prevents it (enforced by reading: none). -
INV-CUT-REMOTE-FULL-001: only the master that tries to grow a volume names a full store. A follower master, or one with volume growth disabled, answers without that text, so its full store still readsremote_unavailable. A volume server whose disk fills while it accepts a needle (the upload after the assign) is not classified here. -
INV-CUT-ERROR-PRECEDENCE-001: class ORDER, a wire contract: the order of the cases inchunkErrorCodedecides which code a caller sees when one error carries several causes. -
INV-CUT-INTENT-FIRST-001: Begin opens or replays the holder session before its first upload; a failed Begin uploads nothing. Commit verifies the objects before installing their root (INV-SNAPK-COMMIT-REACH-001). -
INV-CUT-INTENT-CLOSE-001: the session is retained while reusable uploads or an unresolved commit need it. Settled or abandoned work ends through commit or abort (INV-SNAPK-ABORT-001); no elapsed intent TTL or later-epoch GC fence decides this lifetime. -
INV-WS-FREEZE-ACCOUNTING-001details retained: A frozen detach validates a positive, non-future origin before admission, converts it once to a local monotonic origin, and subtracts elapsed time from the five-second freeze budget at forecast and barrier. Only explicit final override may exceed the forecast budget, and its report records that override and actual elapsed time. New F2 wire fields are durations, not a changed clock-origin request. Existing Unix-nanosecond origin validation/conversion remains; new advice is same-host only. Estimate growth and request delay may cause a bounded refusal, not a promise every advised cycle admits. No new margin.
B.5a Support-bundle collection (read-only client observations)
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-CLI-BUNDLE-REDACTION-001 |
Recognized credentials are discovered across bounded sources before any artifact is written, and their opaque repeats are masked. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_redact.go; cmd/sw-block/log_collect.go logBundle.write |
TestLogCollectPlantedSecretsNeverLeaveTheBundle, TestLogCollectRecognizedCredentialFormsNeverLeaveTheBundle, TestLogCollectRedactsKnownCredentialsInJSONKeys |
- (pure client sanitization) | ACTIVE |
INV-CLI-BUNDLE-DISCOVERY-001 |
Credential discovery precedes time filtering and aggregate-budget omission; exhausting the match bound refuses all output. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect.go discover, addSource, readBundleLog; cmd/sw-block/log_collect_redact.go discoverText |
TestLogCollectRefusesExhaustedCredentialDiscovery, TestLogCollectDiscoversCredentialsBeforeTheTimeWindow, TestLogCollectDiscoversCredentialsInSourcesBeyondTheArtifactBudget |
- (bounded discovery) | ACTIVE |
INV-CLI-BUNDLE-UNPROVEN-001 |
A declared source (-log-file, -unit, -pid) whose discovery did not complete (cut by the time budget, refused or over its bound, a failed or truncated command; a missing file, process or command, or an empty window, is only unavailable) leaves only the manifest, redaction: not_proven; exit 3. |
M9 read-only inspection; no state transition | cmd/sw-block/log_collect.go collectLogs, addCommand, unproven, logBundle.write; cmd/sw-block/log_collect_local.go collectLocal |
TestLogCollectCutDeclaredSourceWithholdsEveryArtifact, TestLogCollectOversizedDeclaredFileWithholdsEveryArtifact, TestLogCollectRefusedDeclaredFileWithholdsEveryArtifact, TestLogCollectMissingDeclaredFileIsOnlyUnavailable, TestLogCollectUnreadablePIDWithholdsEveryArtifact, TestLogCollectTruncatedUnitWithholdsEveryArtifact, TestLogCollectQuietUnitIsOnlyUnavailable (Linux) |
- (pure client sanitization) | ACTIVE |
INV-CLI-BUNDLE-UNPROVEN-002 |
In an unproven bundle every artifact error is replaced by a fixed one, and the cut sources are named in the manifest and printed sanitized like it; a JSON artifact whose keys collide once sanitized is withheld. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect.go logBundle.write, collectLogs |
TestLogCollectUnprovenManifestKeepsOnlyFixedErrors, TestLogCollectSkippedNamesArePrintedSanitized, TestLogCollectCollidingJSONKeysAreWithheld |
- (pure client sanitization) | ACTIVE |
INV-CLI-BUNDLE-DIAGNOSTICS-001 |
Bare prose does not seed global replacement; ordinary values are excluded so diagnostic words, dates and generations remain readable. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_redact.go remember, discoverText |
TestLogCollectKeepsOrdinaryWordsAndGenerationsWhileRedactingTokens |
- (pure client sanitization) | ACTIVE |
INV-CLI-BUNDLE-NUMBERS-001 |
Sanitizing structured JSON preserves exact integer evidence, including uint64 counters and positions above 2^53. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_redact.go bundleDecodeJSON |
TestLogCollectPreservesExactLargeJSONNumbers |
- (pure client sanitization) | ACTIVE |
INV-CLI-BUNDLE-LOCAL-RETENTION-001 |
Selected local logs are collected before remote observations; an unresponsive master produces an incomplete bundle without discarding those logs. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect.go collectLogs |
TestLogCollectKeepsLocalLogsWhenTheMasterDoesNotAnswer |
- (client ordering; no service-availability claim) | ACTIVE |
INV-CLI-BUNDLE-DEFAULT-UNITS-001 |
Default unit discovery includes template holder instances even when no plain holder unit exists; discovery or collection failures remain explicit unavailable sources. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_local.go defaultBundleUnits |
TestLogCollectDefaultIncludesEveryTemplateInstanceWithoutAPlainHolder (cmd/sw-block/log_collect_linux_test.go; Linux qualification required) |
- (local service discovery) | ACTIVE |
INV-CLI-BUNDLE-INVENTORY-001 |
Bundle checks and per-volume artifacts use one observed inventory; a second read cannot hide truncation. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_status.go collectStatus; inspectionShell.checkObservation |
TestLogCollectUsesOneInventoryForChecksAndVolumeArtifacts |
- (client observation reuse) | ACTIVE |
INV-CLI-BUNDLE-SOURCE-ACQUISITION-001 |
Linux local-log acquisition is nonblocking if a regular path is replaced by a FIFO after inspection. | M9 read-only inspection; no state transition | cmd/sw-block/log_collect_open_linux.go openBundleLog |
TestLogCollectChangedSourceCannotBlockAcquisition (cmd/sw-block/log_collect_linux_test.go; Linux qualification required) |
- (local acquisition boundary only; does not prove the caller's post-open validation) | ACTIVE |
B.6 Workspace: chunk lifecycle, GC and delete
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-MAINT-ONE-OWNER |
Only the current attached handle with matching replica/epoch/endpoint admits maintenance; one attached volume admits at most one pass; elapsed ticks coalesce and never enqueue catch-up work. | M8 Armed → Running | provider_chunk.go chunkMaintenanceLoop |
TestMaintenanceCoalescesWhileOnePassIsHeld, TestMaintenancePassHasOneNoProgressWindow, TestMaintenanceRejectsForeignLineageBeforeAdmission, TestMaintenanceSameHandleRearmsAfterJoinedStop |
MaintenanceOwner OneOwner, CurrentHandleAtAdmission |
ACTIVE |
INV-MAINT-KICK-001 |
A snapshot deleted through the holder's control route kicks one maintenance pass at once; kicks coalesce into one pending pass, and no kick is queued without a running loop. | M8 Armed → Due | provider_chunk.go KickMaintenance, chunkMaintenanceLoop; chunk_control.go DeleteSnapshot |
TestMaintenanceKickRunsAPassNow, TestMaintenanceKicksDuringAPassCoalesce, TestKickMaintenanceReachesOnlyARunningLoop, TestChunkControlSnapshotDeleteKicksTheCleaning, TestDefaultConfigCleansAfterEachSnapshotDelete |
MaintenanceOwner OneOwner |
ACTIVE |
INV-MAINT-KICK-RETRY-001 |
A kicked pass refused as busy keeps the kick and re-arms after 30 s; only a pass that is not refused clears it. The delay only paces retries: whether a pass may clean is decided by HEAD's activity, never by the timer. | M8 Running → Armed (busy) | provider_chunk.go chunkMaintenanceLoop |
TestMaintenanceKickedBusyPassRetriesSoon |
MaintenanceOwner NoLostKick |
ACTIVE |
INV-MAINT-JOIN |
Detach/fence/Close cancels maintenance and the scheduled-snapshot worker and joins admitted workers before releasing its catalog/storage lifetime. | M8 Running → Draining → Closed | provider_chunk.go chunkBackground, stopChunkLoop |
TestMaintenanceStopJoinsBeforeRelease, TestMaintenanceCloseCancelsAndJoinsWithoutGuestLock, TestMaintenanceAuthorityLossCancelsHeldPass, TestMaintenanceHealthyLineageChangeCancelsHeldPass, TestScheduledSnapshotLoop_StopJoinsTheAttempt |
MaintenanceOwner JoinedBeforeRelease |
ACTIVE |
INV-SNAP-SEAL-POINT-001 |
A named snapshot request for a free name runs exactly one cut and stores the HEAD that cut installed as the snapshot; a retry of a recorded request replays that snapshot without cutting; if the cut fails (including a COW window abort) the request fails with that error and records no snapshot. | M5 Admit → Settled, then M6 snapshot: name held → published | core/host/volume/chunk_control.go chunkControl.Snapshot; core/frontend/chunkstore/catalog.go CreateSnapshot |
TestNamedSnapshotWindowAbortNeverSubstitutesPoint (core/host/volume/chunk_review271_test.go) |
— | ARCHIVED |
INV-SNAP-SEAL-DURABLE-001 |
A named snapshot is reported done only after the commit naming it is confirmed (every object its root reaches written by the session first); an unknown outcome reports failure, settled by reading HEAD. | M5 CAS → Settled; M6 snapshot: name held → published | core/host/volume/chunk_control.go chunkControl.Snapshot; core/storage/chunk_layer.go captureLocked; core/frontend/chunkstore/layout_remote.go LayoutRemote.CASHead; core/frontend/chunkstore/layout/commit.go RunCommit |
TestLayoutRemote_CutCommitsThroughTheKernel (core/frontend/chunkstore/layout_remote_test.go); TestNamedSnapshotWindowAbortNeverSubstitutesPoint (core/host/volume/chunk_review271_test.go) |
— | ACTIVE |
INV-SNAP-SCHEDULE-RESTART-001 |
A new snapshot worker seeds its last success from HEAD's newest scheduled creation time (future clamped to now), then the next stable per-volume grid slot; absent history is due now. Restarts preserve overdue age; manual snapshots do not seed it. | M8 scheduled worker Armed → Due | core/frontend/durable/chunk_snapshot_schedule.go snapshotScheduleFromHead; provider_chunk.go newChunkLayer |
TestScheduledSnapshotRestartsStillTakeTheDueSnapshot, TestScheduledSnapshotRestartPreservesOverdueFromHEAD, TestScheduledSnapshotWithoutHistoryIsImmediatelyDue, TestScheduledSnapshotProvidersSpreadAfterImmediateFirstAttempt, TestSnapshotScheduleHeadSeedKeepsPerVolumeGrid, TestSnapshotScheduleHeadSeedClampsFutureCreationTime |
— (read-only timer initialization from existing HEAD metadata) | ACTIVE |
INV-SNAP-SCHEDULED-KEEP-001 |
Retention keeps the newest K scheduled snapshots, K being the newest one's swb.schedule.keep (default 7); scheduled snapshots never count against KeepNewest or get age keeps, so other snapshots are planned as if they were absent. | M6 snapshot: Published → Deleting (retention, class scheduled) |
core/frontend/chunkstore/retain/retain.go Plan, scheduleKeepOf |
TestPlanRetention_ScheduledClassKeepsItsOwnNewest, TestPlanRetention_PinnedScheduledStaysInItsClass (core/frontend/chunkstore/retain/retain_test.go) |
— | ACTIVE |
INV-VERIFY-READONLY-001 |
Verify writes nothing at any depth: it reaches the store only through Fetch, Stat and List, and a full pass with orphans leaves every filer entry and blob unchanged. | M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyLayoutThroughTheAdapter (core/frontend/chunkstore/layout_verify_test.go) |
— | ACTIVE |
INV-VERIFY-BINDINGS-001 |
Bindings checks each chunk's filer binding, declared size and needle HEAD size against its owner's VOLUME geometry (tail excepted), without transferring the blob body. | M6 reader (no transition) | core/frontend/chunkstore/layout_verify.go verifyStat; core/frontend/chunkstore/layout/verify.go chunks |
TestVerifyBindingsNeverReadsChunkBodies, TestVerifyBindingsChecksDeclaredSizesAndRefusals, TestVerifyBindingsLookupFailureIsNotAMissingObject, TestVerifyBindingsRejectsSelfConsistentTruncationAgainstGeometry, TestVerifyBindingsUsesTailGeometryAndRejectsOutsideVolume |
— (read-only inspection) | ACTIVE |
INV-VERIFY-NEEDLE-001 |
Bindings reports a missing needle only after every freshly resolved location answers 404; operational failures remain incomplete. A needle HEAD never falls back to a client GET. | M6 reader (no transition) | core/frontend/chunkstore/swfs_head.go HeadBlob; core/frontend/chunkstore/layout_verify.go verifyStat |
TestVerifyBindingsReportsMissingNeedleBehindPresentEntry, TestSWFSHeadBlobUsesOnlyHEADAndClassifiesAbsence, TestSWFSHeadBlobRefreshesCachedMissingLocation |
— (read-only inspection) | ACTIVE |
INV-VERIFY-DISTINCT-001 |
A verify pass looks up each immutable metadata object and chunk binding once across roots; HEAD remains independently confirmed, and chunk bodies are never retained in the metadata cache. | M6 reader (no transition) | core/frontend/chunkstore/layout_verify.go VerifyLayout; core/frontend/chunkstore/layout/verify.go chunks |
TestVerifyBindingsChecksEachDistinctObjectOnce |
— (pass-local reuse) | ACTIVE |
INV-VERIFY-STABLE-HEAD-001 |
Filer verify publishes MISSING or ORPHAN only after two HEAD observations agree on a nonzero generation and volume identity. An unavailable or changed own/dependent HEAD makes the pass incomplete and suppresses those findings. Unsupported verify options refuse before dialing. | M6 (reader; no transition) | core/frontend/chunkstore/layout_verify.go VerifyLayout; cmd/sw-block/chunk_verify.go chunkVerify |
TestVerifyLayoutRequiresStableHeadForMissingAndOrphans; TestVerifyConfirmsDependentHeadBeforeReportingOrphans; TestOpsChunkVerifyRefusesUnsupportedFlagsBeforeDial |
— | ACTIVE |
INV-VERIFY-NOTFOUND-001 |
Verify reports MISSING only when the store answers that the object does not exist; any other read failure ends the pass as incomplete with that error, and is never a finding. |
M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyReadErrorIsReturned, TestVerifyFindsMissingAndCorrupt (core/frontend/chunkstore/layout/verify_test.go); TestOpsChunk_VerifyReadErrorIsIncomplete (cmd/sw-block/chunk_verify_test.go) |
— | ACTIVE |
INV-VERIFY-REACH-001 |
A complete pass checks every object the current root and every snapshot root name (roots, segments, chunks): an absent one is MISSING; one whose bytes do not hash to its name, at depth full, is CORRUPT. |
M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyCleanVolume, TestVerifyFindsMissingAndCorrupt, TestVerifyWalksSnapshotRoots (core/frontend/chunkstore/layout/verify_test.go) |
— | ACTIVE |
INV-VERIFY-INCOMPLETE-001 |
A volume whose VOLUME or HEAD is absent or does not decode is never reported clean: the pass is incomplete and says which object. | M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyHeadMissingOrMalformedIsIncomplete (core/frontend/chunkstore/layout/verify_test.go) |
— | ACTIVE |
INV-VERIFY-ORPHAN-001 |
With orphans on, unreachable own full-id names are ORPHAN; a deleted volume's leftover list pages are also reported. Live/deleting list work is not judged orphaned. Unreadable live targets suppress orphan findings. Verify deletes nothing. | M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyReportsDeletedVolumeListPagesWithoutMutation, TestVerifyDeletedListPagesRequireStableHead, TestVerifyReportsListResidueAfterCatalogDelete; TestVerifyOrphans, TestVerifyDependentReachIsNotOrphanAndUnreadableDependentSuppresses (core/frontend/chunkstore/layout/verify_test.go) ; TestVerifyProductionLayoutCurrentAndRestored (core/frontend/chunkstore/verify_production_layout_test.go) |
— | ACTIVE |
INV-VERIFY-IDENTITY-001 |
Verify reads canonical VolumeDir(name,id) directories. VOLUME must match its directory, HEAD must match VOLUME, and a master-resolved id must match in full. A mismatched chunk-owner VOLUME is IDENTITY, never clean. | M6 (reader; no transition) | core/frontend/chunkstore/layout/verify.go Verify; core/frontend/chunkstore/layout_verify.go VerifyLayout |
TestVerifyVolumeRecordAndHeadID, TestVerifyChunkOwnerIdentity (core/frontend/chunkstore/layout/verify_test.go), TestVerifyDeduplicationNeverSkipsFullOwnerIdentity (core/frontend/chunkstore/verify_bindings_stat_test.go) ; TestVerifyProductionLayoutCurrentAndRestored (core/frontend/chunkstore/verify_production_layout_test.go); TestOpsChunk_VerifyProductionLayoutNameAndDirectory, TestOpsChunk_VerifyBindsMasterFullIDDespiteDirectoryPrefixCollision (cmd/sw-block/chunk_verify_production_test.go) |
— | ACTIVE |
INV-RESTORE-HYDRATE-001 |
The background hydrate walker fetches a chunk only through that chunk's shared fill flight: at most one fetch per chunk absence, and a fetched block is never installed over a block written locally. | M4 Holder (background hydrate) | core/storage/chunk_hydrate_all.go HydrateAll, HydrateAllAt, startWalkerFill, nextHydrateTarget, admitFill; core/storage/chunk_hydration.go hydrationFlightLocked; core/storage/chunk_layer.go fillOnce |
TestHydrateAll_FillsEveryChunkOnceAndReadsTheHeadImage, TestHydrateAll_YieldsToGuestReadsAndNeverFetchesTwice, TestHydrateAll_NeverOverwritesALocalWrite, TestHydrateAll_AdmitsEachFillThroughTheLimiterWithTheCallersClass, TestHydrateAll_RealBackgroundFillLimiterAdmitsEveryFill, TestHydrateAll_PermitIsHeldUntilTheOwnedFetchSettles, TestHydrateAll_RevocationStopsTheWalker, TestHydrateAll_CancelReturnsWhileTheFetchIsHeld, TestHydrateAll_PacedByByteRate (core/storage/chunk_hydrate_all_test.go) |
— | DORMANT |
INV-RESTORE-OWN-BATCH-001 |
A batch cut re-uploads at most N local chunks whose HEAD keys name another volume under new own keys, even when their bytes equal HEAD's, in one ordinary cut (one intent, one HEAD CAS); it never fetches an absent chunk. | M6.Restore.Owning>Owning | core/storage/chunk_own.go OwnBatch; core/storage/chunk_cut_payload.go streamCutPayloads |
TestOwnBatch_BoundedBatchesReplaceEveryForeignKey, TestOwnBatch_SkipsChunksNotLocal, TestOwnBatch_CarriesGuestWrites (core/storage/chunk_own_test.go) |
RestoreIndependence NoGap |
DORMANT |
INV-RESTORE-READ-REF-001 |
A restore target reads each chunk its HEAD names from the pool of the reference's owner, by the reference alone (no other copy, no name-built path); a chunk missing there is an error on a fresh host, never zeros. | M6 restore target read (no transition) | core/frontend/chunkstore/layout/read.go Reader.ReadRef; core/frontend/chunkstore/layout_remote.go LayoutRemote.Get |
TestLayoutRemote_RestoreTargetReadsItsSource (core/frontend/chunkstore/layout_restore_read_test.go) |
— | ACTIVE |
INV-RESTORE-REF-NO-GAIN-001 |
A commit never adds a reference to another volume's chunk: at each index the new manifest holds another volume's chunk (by name and id) only if the previous one held that same chunk, so a restore target keeps or drops its source's references and a dependency is one step deep. | M6 Commit (transition 4) | core/frontend/chunkstore/layout/commit.go RunCommit, CommitPlan.foreignAt |
TestRunCommit_RefusesAnAddedForeignReference (core/frontend/chunkstore/layout/commit_test.go) |
— | ACTIVE |
INV-SHARE-ACTIVATION-001 |
With a ShareGuard installed, a snapshot or fork activates (snapshot entry, child HEAD) only after Finish accepts the share; a refused Begin or Finish aborts before activation and drops the new intent. With no guard, nothing is called or checked. |
M6 snapshot: Pending → Published; fork: child HEAD create | core/frontend/chunkstore/share_guard.go beginShare, finishShare; core/frontend/chunkstore/catalog.go CreateSnapshot, Fork; core/host/volume/chunk_control.go chunkControl.Snapshot, sealSnapshot (explicit and scheduled snapshots) |
none (legacy share guard removed) | — | ARCHIVED |
INV-PUBLISH-SETTLED-001 |
With OnPublishSettled set, each confirmed publication (a new HEAD generation) is delivered once, in publication order, one at a time, outside the capture and state locks. After Close begins, no report is dequeued. |
M5 CAS → Settled; M6 HEAD: published | core/storage/chunk_publish_settled.go noteSettled, unlockCap, runPublishSettled; core/storage/chunk_periodic_cut.go CutUnlessCutSince |
TestChunkPublishSettled_ReportsEachPublication, TestChunkPublishSettled_ReportsALatePublication, TestChunkPublishSettled_ClosedAndUnset, TestChunkPublishSettled_OverlappingPublishersStayOrdered, TestChunkPublishSettled_CloseDropsUnstartedReports, TestChunkPublishSettled_HookThatPublishes, TestChunkPublishSettled_PeriodicCutReports (core/storage/chunk_publish_settled_test.go); TestWALStoreChunk_PublishSettledHook (core/frontend/durable/provider_chunk_sched_test.go) |
— | DORMANT |
Notes:
INV-GC-REACHABLE-001: an unrooted key's binding is tombstoned and its needle deleted only after the two-mark, binding-age and unchanged-binding checks: see M6 bound → tombstoned, needle deleted. The binding itself is never removed (INV-CHUNK-WRITE-ONCE-001). A snapshot whose name record still exists, deleting or not, is rooted with no grace limit; that over-protects, which is safe.INV-GC-REACHABLE-OWNER-001: this is what forks and restores rely on: a target's HEAD keeps the source's chunks live after the source snapshot and the source volume are gone.INV-GC-DELETE-PROGRESS-001: the refused needle keeps its tombstone and fid and is retried in a later pass; it is never counted as reclaimed and is reported in FailedDeletes. ExecuteGC saves the complete mark before it returns the partial failure. Any other DELETE error, a metadata error or cancellation still fails the pass. See M6 tombstoned, DELETE rejected → tombstoned, retry later.INV-GC-CLOCK-SKEW-001: these rows assume every timestamp writer (cut hosts for intents, the filer for binding crtime, GC hosts for marks and delete stamps) stays within the configured pairwise skew bound of the collector; no finite grace is safe without that bound. Within one process, in-memory mark times keep Go's monotonic reading; persisted marks and catalog stamps are wall time. Copy intents are not covered: their settlement is an order fact (INV-GC-COPY-SETTLE-001).INV-GC-COPY-SETTLE-001: class ORDER, not TIME. The deadline only admits the claim and is compared with no skew margin, and none is needed: a late publish of the copy loses to the exclusive aborted tombstone at the target.INV-RESTORE-HYDRATE-001: the walker yields while any flight has a guest waiter, retrying after a backoff of 20 ms that doubles up to 2 s; each fill holds one host-limiter permit (no cut payload, the caller's class), released only after that flight's I/O settles, also on cancel, revocation or close: see M4 Holder (background hydrate). "Never over a local write" is the install check infillOnce, shared with guest read misses (INV-CUT-READMISS-001). The production caller is the restore driver (M6 restore Restoring → Hydrating,INV-RESTORE-DRIVER-001).INV-GC-DELETE-EXACT-FID-001: what happens after a rejected or failed delete isINV-GC-DELETE-PROGRESS-001. The tombstone-before-delete order is asserted only through a rejected delete; on a successful delete it is enforced by reading. The cookie check itself is done by the SeaweedFS volume server, not by this repository.INV-GC-GRACE-RESTART-001: "past the grace" means past the grace plus the clock-skew bound ofINV-GC-CLOCK-SKEW-001. The restart on a rooted mark is enforced by reading; no test re-roots a candidate between marks. A deleted fork volume's keys get only the ordinary two-mark grace from their first unrooted mark, with no deleting-time root and no dedicated test.INV-SNAP-SEAL-DURABLE-001: whether a confirmed filer write has reached disk (filer fsync) is a deployment setting of the SeaweedFS filer, not checked by the code.INV-FORK-FROM-SEALED-001: the case of a name whose attempt is still in flight (name record present, attempt entry absent) is enforced by reading; no test forks during a held snapshot create.INV-SNAP-DELETE-ANY-ORDER-001: a fork takes its deadline start before it reads the parent, and every attempt (a retry included) reads it again, so a parent deleted before the read refuses. The same deadline is checked before creating target VOLUME, its copy intent and its HEAD; an expired source read creates no target, and expiry after VOLUME leaves it retryable without a new copy intent. GC keeps a deleted attempt rooted for a grace of at least deadline + clock skew + CAS apply bound (NewCollector). An unknown publish keeps the fork intent, which roots the keys until the target is resolved.- Restore quantities: batch size N =
DefaultRestoreBatchChunks(64 chunks per batch cut) and the walker pace =DefaultRestoreBytesPerSecond(64 MiB/s, plus the host limiter's BackgroundFill class), both incore/host/volume/chunk_restore.go. They move to the quantity table when it exists. INV-SHARE-ACTIVATION-001: the owner's seal callsBeginbefore the cut that produces the sealed HEAD, so a refusedBegincuts nothing.INV-PUBLISH-SETTLED-001: a publication is a cut, a detach, or an earlier unresolved CAS found applied; a no-op cut reports nothing, and with no hook nothing is queued. One registered drainer delivers; a report already dequeued when Close begins may still reach the hook, and Close waits for it.ChunkRemote.ReclaimKeyis the Collector's per-key step (reclaimBinding) exported, not a new admission:INV-GC-REACHABLE-001(reachability and the two-mark grace) stays the Collector's, and aReclaimKeycaller must itself know nothing references the key. The step keepsINV-CHUNK-WRITE-ONCE-001: the binding is tombstoned, its exact fid deleted, and the binding kept for ever, never rebound; owner-qualified keys are refused.
B.7 Rows kept from the internal ledger: Kubernetes line and replica fencing
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-AUTH-ONE-PRIMARY-001 |
A volume's authority line names one replica at its highest epoch, a reassignment supersedes the previous primary, and observed dual primaries make the volume invalid. A genesis Bind is refused once any slot of the volume holds a line. |
M2 Unbound → Bound, Bound → Reassigned; K8s readiness | core/authority/authority.go applyWithWorkspaceMove (IntentBind, boundReplicaForVolume); core/authority/policy.go VolumeAuthorityLine; core/authority/controller.go decideVolume; core/ops/managed_volume_model.go classifyManagedVolume |
TestG8_0_Publisher_ReassignAdvancesPerVolumeEpochAcrossReplicaSlots (core/authority/g8_0_authority_failover_test.go); TestPublisher_RunRejectsSecondSlotGenesisBind (core/authority/bind_volume_regression_test.go); TestPublisher_BindSecondSlotOfBoundVolumeRejected, TestPublisher_BindOtherVolumeUnaffected, TestPublisher_ReassignToOtherSlotStillAllowedThenBindRejected, TestPublisher_BindAfterRestartRejectedForAnySlot (core/authority/bind_volume_genesis_test.go); TestManagedVolumeProjection_InvalidDualPrimaryBeatsReady (core/ops/managed_volume_model_test.go) |
— | ACTIVE |
INV-FENCE-STALE-PRIMARY-001 |
Once a primary has observed a newer line for another replica, its backend refuses Read, Write and Sync, and replicas refuse its frames below their epoch floor. |
M3 Primary → Supporting | Excluded | core/host/volume/projection_bridge.go projectionWithSupersede; core/frontend/durable/storage_adapter.go lineageCheck; core/transport/replica.go admitMutation |
TestG8A_SupersedeFact_FencesOldPrimaryDurableBackend (core/host/volume/g8a_stale_fence_test.go); TestG2_PromotedHostRefusesShipFromDeposedPrimary (core/host/volume/g2_self_fence_test.go) |
ReplicationFailover NoStaleAck |
ACTIVE |
INV-PROMOTE-FRONTIER-001 |
With a known required acknowledgement frontier under sync_quorum or sync_all, the RF=3 promotion gate allows only probed-ready candidates whose durable LSN is at least the required LSN. |
M3 Supporting → promotion candidate (RF=3 gate) | core/host/master/product_loop.go promotionAllowedReplicas, applyPromotionEvidenceGate; core/host/master/probe_round.go (SyncAckKnown); core/engine/promotion_ready.go BuildPromotionReadyFact |
TestMountedFailover_ProductLoopRF3PromotesCandidateCoveringSyncAckProbe (core/host/master/product_loop_test.go); TestPromotionAllowedReplicas_RequiredFrontierCoverage, TestWorkloadPlanProvider_RequiredFrontierKnownness (core/host/master/promotion_frontier_coverage_test.go) |
— | ACTIVE |
INV-PROMOTE-CREATION-WAIT-001 |
Creation is its own phase, ended durably and for good by the first of: the line's primary's ready answer, or a survivor answering DurableLSN > 0 at the line. Until then, or while the primary answers it awaits replica stores, no replacement decision is made; checked first. | CreateEvid2 model (VolumeCreate x Promotion, survivor evidence) | core/host/master/product_loop.go inCreationPhase, firstReadyNow, survivorHoldingAWrite, holdCreating, applyPromotionEvidenceGate, applyUnsupportedPromotionEvidenceGate; core/host/master/planned_move.go; core/host/master/store_attestation.go awaited; core/host/volume/probe_round.go probeAnswer; core/host/master/planned_move_paths_test.go plannedMoveEvidence |
TestCreatingVolumeRunsNoFencingRoundOnTheSupportedGate, TestCreatingVolumeIsNotReplacedWhenItsPrimaryIsSilent, TestCreationOutlivesTheLastStoreAttestation, TestCreatingVolumeRefusesTheOperatorsMove, TestCreationPhaseSurvivesAMasterRestart (core/host/master/creation_phase_test.go); TestPrimaryAwaitingReplicaStoresIsNotReplacedForNotReady, TestMasterRestartInTheGapDoesNotReassign, TestCreatingPrimaryNotReadyForAnotherReasonIsNotReplaced, TestCreatingVolumeWithAStaleAwaitingAnswerIsNotReplaced, TestCreatingPrimaryWithAnUnacceptableSlotIsNotReplaced (core/host/master/creating_primary_gate_test.go); TestAVolumeWhosePrimaryDiedAfterAQuorumWriteFailsOver, TestCreationEndsAtTheFirstReadyAnswerOrASurvivorsWrite, TestAFailedEndOfTheStoreWaitKeepsTheVolumeHeld, TestThePrimarysAwaitingAnswerAloneHoldsAnEstablishedVolume (core/host/master/creation_survivor_test.go); TestAVolumeThatServedBeforeItsFirstGateTickFailsOver (cmd/blockvolume/creation_gap_integration_test.go, tagged); TestProbeRound_CarriesThePrimarysAwaitingStoresEpoch (core/host/master/probe_round_test.go); TestProbeAnswerReadsTheWaitBeforeReadiness, TestProbeAnswerAfterTheWaitNamesNothing (core/host/volume/replica_stores_wait_test.go) |
— | ACTIVE |
INV-PROMOTE-FRONTIER-PROBE-001 |
For a replicated volume (two or more slots), the gate allows no candidate unless this tick's promotion probe succeeded with a known ack profile. | M3 Supporting → promotion candidate (the gate, RF=2 and up) | core/host/master/product_loop.go applyPromotionEvidenceGate, promotionAllowedReplicas |
TestMountedFailover_ProductLoopRF3BlocksFailoverWithoutFreshPromotionProbe (core/host/master/product_loop_test.go); TestMountedFailover_ProductLoopRF2DecidesOnThePromotionGate (core/host/master/promotion_frontier_coverage_test.go) |
— | ACTIVE |
INV-PROMOTE-UNKNOWN-CURRENT-001 |
A current primary whose status cannot be read (probe refused, timed out, pod gone) while its heartbeat is fresh is unknown, never failed: no promotion path reassigns on it; a direct reassign needs the primary's own not-ready report. | M3 Primary → promotion candidate (both promotion paths) | core/host/master/product_loop.go applyPromotionEvidenceGate (supported path), applyUnsupportedPromotionEvidenceGate (unsupported path) |
TestUnsupportedPathNeverReassignsOnAnUnansweredPrimary (core/host/master/primary_boot_grace_gate_test.go); TestMountedFailover_ProductLoopRF3DoesNotReassignWhenCurrentSlotMissing (core/host/master/product_loop_test.go). Limits: a primary with a fresh heartbeat that does not answer the probe is never replaced automatically; a primary whose heartbeat is stale (not reachable, no fresh slot) is replaced automatically, under --cluster-spec with the lifecycle loop on, only through the fencing round (applyPromotionEvidenceGate fencedDecision) when enough replicas answer; when the round cannot decide the volume waits (fence_round_incomplete) for the admin's failover, which runs the fencing round and publishes only on its decision (basis Fenced) when the primary is unreachable (no fresh, reachable heartbeat; any replica count); a reachable RF3 sync_quorum primary's move stays refused (it needs a seal) and best_effort stays refused (core/host/master/planned_move.go fencedMoveEvidence; TestManualFailoverRF3SyncQuorumDecidesOnTheFencingRound, TestManualFailoverRF2UnreachablePrimaryDecidesOnTheFencingRound, TestManualFailoverRF2BestEffortIsNeverFenced, TestManualFailoverRF3ReachablePrimaryIsRefused, TestManualFailoverAndThePromotionLoopPublishOneLine); also in core/host/master/product_loop.go, core/host/master/manual_failover_fence_test.go |
— | ACTIVE |
INV-PROMOTE-FRONTIER-UNKNOWN-001 |
With an unknown frontier under sync_quorum or sync_all, the gate allows the highest-durable ready candidate only if at least N_peers-K+1 of the N_peers peers are probed ready this tick and have a fresh heartbeat (K as in waitForSyncAcks); else none. |
M3 Supporting → promotion candidate (RF=3 gate) | core/host/master/product_loop.go promotionAllowedReplicas, unknownFrontierSurvivorsNeeded, freshPromotionPeers; core/replication/async_ack.go waitForSyncAcks |
TestMountedFailover_ProductLoopRF3UnknownRequiredLSNFallsBackToHighestDurableLSN (core/host/master/product_loop_test.go); TestProductLoop_MissingRequiredFrontierRefusesRF3Promotion (core/host/master/promotion_missing_frontier_regression_test.go); TestUnknownFrontierSurvivorsNeeded, TestFreshPromotionPeers_UsesObservationFreshness, TestProductLoop_UnknownFrontierSurvivorReadyLastTickMissingNowRefused (core/host/master/promotion_frontier_coverage_test.go) |
— | ACTIVE |
INV-PROMOTE-FRONTIER-BEST-EFFORT-001 |
The automatic path never replaces a lost primary of a best_effort volume (a write may be on the primary alone, as for the operator's move): both gates hold it before any fencing round and show best_effort_no_automatic_failover. |
M3 Supporting → promotion candidate (both gates) | core/host/master/product_loop.go automaticFailoverHold (supported gate before fencedDecision; unsupported gate before its candidates); promotionAllowedReplicas |
TestTheAutomaticPathHoldsABestEffortVolume (core/host/master/best_effort_hold_test.go); TestMountedFailover_ProductLoopRF3BestEffortIsHeldDespiteAHighestDurableSurvivor, TestMountedFailover_ProductLoopRF3RejectsBestEffortProbeForHA (core/host/master/product_loop_test.go); TestPromotionAllowedReplicas_RequiredFrontierCoverage (core/host/master/promotion_frontier_coverage_test.go) |
— | ACTIVE |
INV-PROMOTE-ACK-PROFILE-MATCH-001 |
The automatic path holds a lost primary's volume, before any fencing round and showing ack_profile_mismatch, when a probe answer names no ack profile or another than blockmaster's --launcher-replication-ack; blockmaster refuses to start with an unknown one. |
M3 Supporting → promotion candidate (both gates) | core/host/master/probe_round.go profileMismatch; core/host/master/product_loop.go automaticFailoverHold (plain round), fencedDecision (fencing round); core/host/volume/probe_round.go probeAnswer; cmd/blockvolume/main.go hostConfig; cmd/blockmaster/main.go parseFlags |
TestTheAutomaticPathHoldsOnAnAckProfileMismatch, TestProbeRound_ReportsAnAckProfileMismatch, TestTheFencingRoundsAckProfileIsCheckedToo (core/host/master/ack_profile_mismatch_test.go); TestProbeAnswerNamesTheVolumesAckProfile (core/host/volume/probe_ack_profile_test.go); TestHostConfigAnswersTheVolumesOwnAckProfile (cmd/blockvolume/probe_ack_profile_test.go); TestBlockmasterRefusesAnUnknownLauncherReplicationAck (cmd/blockmaster/launcher_replication_ack_flag_test.go) |
— | ACTIVE |
INV-PRIMARY-ACK-PROFILE-001 |
A primary of a replicated line serves only when its own --replication-ack is the profile its assignment names (blockmaster's); otherwise its frontend is not Healthy and status names both profiles. So a lost primary, which does not answer, acknowledged under the master's profile. |
M1 Primary → Serving (replicated line) | core/host/master/services.go assignmentFact (ack_profile); core/host/volume/workspace_startup.go noteAckProfile; core/host/volume/projection_bridge.go projectionWithSupersede; core/host/volume/status_server.go |
TestPrimaryOfAReplicatedLineServesOnlyUnderTheMastersAckProfile (core/host/volume/ack_profile_refusal_test.go); TestAssignmentNamesTheMastersAckProfile (core/host/master/ack_profile_mismatch_test.go) |
— | ACTIVE |
INV-CSI-CONSUMES-AUTHORITY-001 |
CSI never imports authority code or builds assignment facts; it takes the publish target from blockmaster and refreshes it before a stage, and blockmaster mints the IDs of the events CSI reports. | M2 (read side) | core/csi/master_backend.go LookupPublishTarget; core/csi/node.go refreshPublishContext; core/host/master/observation_service.go ReportClusterEvent |
TestG15a_CSI_DoesNotImportAuthorityOrConstructAssignmentFacts (core/csi/boundary_guard_test.go); TestG15e_CSIReattachUsesFreshPublishTargetAfterUnstage (core/csi/node_test.go); TestObservationService_ReportClusterEventAppearsInVolumeTimeline (core/host/master/observation_service_test.go) |
— | ACTIVE |
INV-K8S-NONLOOPBACK-001 |
Generated multi-node Helm values enable external iSCSI, external status and loopback rejection; with rejection enabled CSI never publishes a loopback target and fails closed when only loopback targets exist. | M2 (read side) | cmd/sw-block/main.go runOpsGenerateHelmValues; core/csi/master_backend.go rejectFrontendAddr |
TestOpsGenerateHelmValuesMultiNodeExternalISCSI (cmd/sw-block/main_test.go); TestNodeLoss_ControlStatusLookup_RejectsLoopbackPublishTargetsWhenEnabled, TestNodeLoss_ControlStatusLookup_FailClosedWhenOnlyLoopbackTargets (core/csi/master_backend_test.go) |
— | ACTIVE |
INV-OBS-PRODUCT-EVENTS-001 |
blockmaster records placement-verified, promotion-candidate-evaluation and authority-published events, and the CSI node reports csi_reattach_observed after a successful stage. |
M3 promotion decision (observation) | core/host/master/product_loop.go recordPlacementVerifiedEvents, recordPromotionEvaluationEvents, recordAuthorityPublishedEvent |
TestMasterTimeline_RecordsPlacementVerified, TestMasterTimeline_RecordsPromotionCandidateEvaluation, TestMasterTimeline_RecordsAuthorityPublishedAfterMint (core/host/master/event_ring_test.go); TestNodeStage_ReportsCSIReattachObservedAfterSuccessfulStage (core/csi/node_test.go) |
— | ACTIVE |
INV-OBS-SLOT-ORDER-001 |
A heartbeat slot (server, volume, replica) is ordered only against that slot's own previous heartbeat: a later-stamped heartbeat of another slot of the same server never supersedes it. | M2 heartbeat observations: per-slot refusal / mixed merge / all-superseded no mutation (per-slot ordering rule) | core/authority/observation_store.go ingest (per-slot comparison), slotObservedAt; SupersededSlotCount (diagnostic only) |
TestObservationStore_InterleavedSendersOrderPerSlot, TestObservationStore_MixedSlotReportKeepsOnlyNewerFacts, TestObservationStore_SupersededSlotLogsAfterUnlock (core/authority/observation_store_slot_order_test.go) |
1.0 limit: a backward wall-clock step longer than the freshness window expires that host's slots; 1.0.1: per-process sequence. | ACTIVE |
INV-OBS-SLOT-FROM-EXPECTED-SERVER-001 |
A replica's slot in the assembled topology takes addresses and health only from a fresh fact reported by the server its expected slot names; another server's fact for the same replica is never used, so with none from that server the slot is a placeholder. | AUTHORITY/ORDER: observation to assignment line | core/authority/snapshot_builder.go assembleVolumeTopology |
TestAssembleVolumeTopology_SlotFactOnlyFromTheExpectedServer (core/authority/snapshot_slot_server_test.go) |
— (pure assembly; the unit test is the proof form) | ACTIVE |
INV-HELM-RF-NODECOUNT-001 |
Generated Helm values fail closed when the requested replication factor exceeds the selected Ready schedulable node count. | M3 (configuration) | cmd/sw-block/main.go runOpsGenerateHelmValues, selectHelmValuesNodes |
TestOpsGenerateHelmValuesRejectsRFAboveSelectedNodes (cmd/sw-block/main_test.go) |
— | ACTIVE |
INV-HOSTPATH-TRANSPARENT-001 |
The read model reports transparent host-path recovery only with a multipathed, Active/Optimized, stale-fenced path, writer and reader checks, and the same pod UID. | K8s readiness model | core/ops/managed_volume_model.go classifyManagedVolume, deriveManagedVolumeStates |
TestManagedVolumeProjection_TransparentISCSIALUARecovered, TestManagedVolumeProjection_MissingMultipathBlocksTransparentClaim (core/ops/managed_volume_model_test.go) |
— | ACTIVE |
INV-K8S-REATTACH-001 |
A CSI re-stage after failover uses the fresh publish target, and the read model reports recovery by reattach only with CSI reattach observed and a verified reader. | K8s readiness model | core/csi/node.go refreshPublishContext; core/ops/managed_volume_model.go classifyManagedVolume |
TestG15e_CSIReattachUsesFreshPublishTargetAfterUnstage (core/csi/node_test.go); TestManagedVolumeProjection_NodeLossReattachRecovered (core/ops/managed_volume_model_test.go) |
— | ACTIVE |
INV-MANAGED-VOLUME-READMODEL-001 |
Volume explanations in the observation report and explain output are rendered from the ManagedVolume projection. |
K8s readiness model | core/ops/managed_volume_model.go ProjectManagedVolume |
TestObservationExplain_IncludesManagedVolumeProjectionAndDryRunActions, TestObservationReportSummary_IncludesManagedVolumeStatus (core/ops/observation_report_test.go); TestProjectManagedVolumeFromEvidence_DualPrimaryInvalid (core/ops/managed_volume_evidence_test.go) |
— | ACTIVE |
INV-K8S-ADAPTOR-FACTS-001 |
PVC, pod, node and CSI conditions enter the read model as typed facts and map to distinct blocked reasons before any recovery status is derived. | K8s readiness model | core/ops/managed_volume_model.go classifyManagedVolume |
TestManagedVolumeProjection_PVCPendingBlocked, TestManagedVolumeProjection_WriterFailedMountBlocked, TestManagedVolumeProjection_CSINodeImagePullBlocked, TestManagedVolumeProjection_LoopbackCrossNodeBlocked (core/ops/managed_volume_model_test.go) |
— | ACTIVE |
INV-HOSTPATH-FACTS-001 |
The read model keeps path facts separate from the recovery claim: missing multipath blocks the transparent claim, and an NVMe ANA seam alone does not infer transparent recovery. | K8s readiness model | core/ops/managed_volume_model.go deriveManagedVolumeStates, hasTransparentHostPathEvidence |
TestManagedVolumeProjection_MissingMultipathBlocksTransparentClaim, TestManagedVolumeProjection_NVMeANASeamDoesNotInferTransparentRecovery (core/ops/managed_volume_model_test.go) |
— | ACTIVE |
INV-FENCE-SELF-ON-PROMOTE-001 |
A primary at epoch e applies no inbound replication traffic (ship, recovery lane start, rebuild), and none below e; it still answers probes, and its epoch floor never goes down when it later supports another primary (fencing gap G2). | M3 Supporting → Primary | core/transport/replica.go FenceAsPrimary, acceptMutationLineage; core/host/volume/host.go fenceSelfWithPeers |
TestG2_PromotedHostRefusesShipFromDeposedPrimary (core/host/volume/g2_self_fence_test.go); TestG2_PrimaryListenerRefusesMutationsButAnswersProbes, TestG2_FloorStaysWhenThePrimaryLaterSupportsAnother (core/transport/g2_self_fence_test.go) |
ReplicationFailover AckedSurvive, NoStaleAck |
ACTIVE |
INV-FENCE-FLOOR-DURABLE-001 |
A replica never accepts mutating traffic below the highest epoch it has acknowledged or taken a role at, across restarts, and accepts none before its assignment is known; a role call whose floor cannot be made durable is not adopted and keeps the frontend unhealthy (fencing gap G1). | M3 Unassigned → Primary | Supporting | core/transport/replica.go raiseFloor, admitMutation, AdmitAsReplica; core/host/volume/host.go latchRoleAdmission |
TestG1_RestartedReplicaRefusesShipBelowItsAcknowledgedEpoch, TestG1_ConcurrentRaisesNeverLowerTheRecord, TestG1_RoleCallsPersistBeforeReturning (core/transport/g1_durable_floor_test.go); TestG1_FailedRoleAdmissionStopsAPreviouslyHealthyFrontend (core/host/volume/g1_admission_latch_test.go) |
— | ACTIVE |
Notes:
INV-AUTH-ONE-PRIMARY-001: Narrowed. The lab evidence fieldpost_failure_primary_count=1is not read by any Go test.IntentBindis checked per volume: the Publisher refuses a genesisBind(ErrBindAlreadyBound) once any slot of the volume holds a present line, also after a restart, when only the current slot is reloaded;decideVolumealso binds only when the volume has no line (#183).INV-FENCE-STALE-PRIMARY-001: Narrowed. A primary cut off from blockmaster that has not seen the newer line keeps admitting I/O, and underbest_effortits localfsyncstill acknowledges (no primary lease on the Kubernetes path; see the Kubernetes known gaps). The lab counterold_primary_stale_io_success_count=0is lab evidence only.INV-PROMOTE-FRONTIER-001: Fixed for #181.cmd/blockmasterdoes not setRequiredLSNByVolume, so in a deployment the frontier is unknown and the survivor rule applies (an RF=3sync_quorumvolume with one peer unseen is not promoted automatically). Limits: blockmaster has no source for the required frontier (#192); the rule covers only the acknowledgements represented by the frontiers sampled in one tick, because those probes are snapshots, not a fence, and a deposed primary can still acknowledge after a sample (no primary lease, #195). See Kubernetes design §6 and §12. RF=2 relies onINV-REPL-PROMOTION-READY-001.INV-PROMOTE-FRONTIER-PROBE-001,INV-PROMOTE-FRONTIER-UNKNOWN-001,INV-PROMOTE-FRONTIER-BEST-EFFORT-001: new rows split fromINV-PROMOTE-FRONTIER-001, kept beside it. N_peers is the number of replicas other than the current primary; for RF=3 (two peers) both must be seen undersync_quorum, one undersync_all. An unknown frontier is never read as zero. Heartbeat freshness is the observation store's rule (FreshSlotCandidate). The gate runs for every volume with two or more slots (RF=2 included); a primary change is published only with its evidence.INV-K8S-NONLOOPBACK-001: Rejection is opt-in: the chart default fornetwork.rejectLoopbackPublishTargetsis false; the generator sets it for multi-node values.INV-OBS-PRODUCT-EVENTS-001: Each event type has a unit test; all four together in one node-loss run is lab evidence only.INV-HOSTPATH-TRANSPARENT-001: Narrowed to the classifier. It does not compare the host path target with the promoted target, and only the missing-multipath case has a negative test. The mounted-failover run is lab evidence.INV-K8S-REATTACH-001: The full node-loss run through pod recreate is lab evidence; the classifier does not check that the re-stage target equals the promoted frontend.INV-MANAGED-VOLUME-READMODEL-001: Partial. No guard test shows that other surfaces never build their own status, andcore/ops/observation_bundle.goapplyPrimaryFailureSummarysets a recovered status from summary keys without the classifier.INV-K8S-ADAPTOR-FACTS-001: Narrowed. The fact metadata the internal row names (source, time, generation, confidence) is neither filled in nor read by the classifier.INV-HOSTPATH-FACTS-001: Narrowed. There is no session-reachability fact, the classifier does not read the ALUA state, and the artifact path derives the multipath and Active/Optimized facts from onetransparent_failover_claimedhint.
Not in the ledger. Known gaps where the code does not yet hold the property are tracked as known issues, not as rows: the core known issues, the agent workspace known gaps and the Kubernetes known gaps. A fix that closes one adds its row here.
B.8 NVMe/TCP receive bounds
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-NVME-H2C-RANGE-001 |
An H2CData range exceeding the expected transfer size is refused before slicing, including a uint32 offset-plus-length overflow; an exact-bound payload is preserved. | Frontend H2C receive validation; no storage state transition | core/frontend/nvme/session.go recvH2CData |
TestRecvH2CDataRangeBounds (core/frontend/nvme/h2c_bounds_test.go) |
— | ACTIVE |
B.9 Security: gRPC links
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-SEC-ONE-SEAM-001 |
Every production gRPC client and server is built by core/rpc/link; a non-test file outside it that constructs a gRPC client or server or insecure credentials, under any import name, fails the guard test. | AUTHORITY: every gRPC link (client dial, server build) | core/rpc/link Dial, DialWith, NewServer |
TestLink_NoProductionSiteBypassesTheSeam, TestLink_GuardDetectsRawConstructionsAndAliases, TestLink_DialReachesNewServerUnaryAndStream, TestLink_ServerRunsInterceptorsInOrder (core/rpc/link/link_test.go) |
— (no state machine; the guard test is the proof form) | ACTIVE |
Experimental data-file synchronization
| ID | Invariant | Machine / transition | Enforced in | Tests | TLA+ | Status |
|---|---|---|---|---|---|---|
INV-WAL-DATA-SYNC-001 |
SWBLOCK_SYNC=auto is the default. Once at volume open, Linux WAL/extent sync selects fdatasync only when every resolved non-partition node, including dm/md nodes and all slaves, advertises write through; write back or an unknown or unreadable device policy selects fsync. |
M1 Create / Sync / Checkpoint | data_sync.go, device_sync_linux.go; walstore.go data sync seams |
TestExplicitAutoDataSyncPolicy, TestDeviceDataSyncStackNodePolicy, TestDeviceDataSyncMalformedTopology, TestDeviceDataSyncPolicy (core/storage/device_sync_linux_test.go; positive cache fixtures witness empty-stack/cycle guards), TestFdatasyncAcknowledgedWritesSurviveSIGKILL, TestDataSyncSyscallProbe (core/storage/data_sync_linux_test.go) |
Same abstract durable sync action; syscall/extent initialization and process-crash versus power-loss limits are outside the model | ACTIVE |
INV-WAL-DATA-SYNC-OVERRIDE-001 |
An explicit SWBLOCK_SYNC=fsync or SWBLOCK_SYNC=fdatasync overrides detection without inspecting the device. Platforms other than Linux keep fsync. |
M1 Create / Sync / Checkpoint | data_sync.go configuredDataSyncMode, selectedDataSyncMode |
TestExplicitDataSyncPolicyDoesNotInspectDevice (core/storage/device_sync_linux_test.go) |
— | ACTIVE |
INV-WAL-DATA-SYNC-STATUS-001 |
The data sync mode chosen at open and its reason are logged and exposed in durable status. | M1 Create / Sync / Checkpoint | data_sync.go bindDataFileSync, DataSyncPolicy; core/frontend/durable/storage_adapter.go status |
TestDurableProvider_DataSyncStatus (core/frontend/durable/data_sync_status_test.go) |
— | ACTIVE |
INV-WAL-ALLOCATION-001 |
SWBLOCK_ALLOCATION selects allocation at create: sparse, the default, or prezero; fallocate is refused. SWBLOCK_PREZERO=1 is an alias of prezero. |
M1 Create / Sync / Checkpoint | walstore_v3.go Create |
TestDefaultCreatedVolumeStaysSparse, TestFallocateAllocationIsRefused (core/storage/data_sync_linux_test.go) |
— | ACTIVE |
INV-WAL-PREZERO-001 |
Prezero writes every byte at create and fsyncs; a file opened as initialized is refused when it has holes or unwritten extent mappings. | M1 Create / Sync / Checkpoint | walstore_v3.go Create |
TestPrezeroCreatesInitializedVolume, TestInitializedFileRejectsSparseAndUnwritten (core/storage/data_sync_linux_test.go) |
— | ACTIVE |
INV-WAL-FLUSH-SYNC-COVERS-WAL-001 |
WAL and extent data live in one store file, and the WAL sync and the flusher's extent sync are the same whole-file fsync or fdatasync of that one descriptor, never a range sync, so every flusher sync also makes the WAL durable. | M1 Serving → Serving (checkpoint) | core/storage/walstore.go openInitializedV3; core/storage/data_sync.go bindDataFileSync; core/storage/flusher.go flushOnceInternal |
TestFlusherCheckpointOverASupersededSyncedRecord (core/storage/flusher_superseded_record_test.go; its control models an extent-only flusher sync and loses X); TestSyncCoversWALGuard (core/storage/sync_covers_wal_guard_test.go: the store opener binds one data sync, and the flusher sync and the WAL sync both use it) |
— | ACTIVE |
-
INV-WAL-DATA-SYNC-001and the rows split from it: enforced by reading, with no test of their own: the mode is not reselected during the life of an open volume; descriptor, map, create and directory durability always use fsync, whatever the data sync mode; an existing file is never prezeroed. Notes: -
INV-WAL-FLUSH-SYNC-COVERS-WAL-001: the one-file, one-descriptor, no-range-sync clause is enforced by reading;TestFlusherCheckpointOverASupersededSyncedRecordshows why it is load-bearing (a checkpoint over a superseded synced record is safe only if the flusher's sync made the newer record durable; its control, an extent-only sync, loses the older record).TestSyncCoversWALGuardchecks in the source that the WAL sync and the flusher's extent sync are the one data sync the store opener binds for its file.
B.10 Snapshot kernel: content-named layout and HEAD transitions
| ID | Statement | Machine / transition | Enforced in | Test | TLA+ property | Status |
|---|---|---|---|---|---|---|
INV-SNAPK-NAME-CANONICAL-001 |
A chunk is named by its index and the SHA-256 of its bytes under pool/<index/10000>/; a segment and a root are named by the SHA-256 of their canonical encoding, and decoding refuses any bytes the encoder would not write, so an object has one encoding and one name. |
Content-named layout (no state transition) | core/frontend/chunkstore/layout layout.go ParseChunkName, DecodeSegment, DecodeRoot |
TestParseChunkName_RoundTripAndRefusals, TestDecodeSegment_RefusesNonCanonical, TestRoot_Refusals, TestBuild_ShardsAndIncrementalReuse |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-HEAD-WRITE-001 |
HEAD changes only by one conditional update on its generation through runTransition; no path in the package creates a HEAD, and an absent HEAD is refused. |
M9 every transition | core/frontend/chunkstore/layout head.go runTransition; HeadStore (read and conditional update only) |
TestGuard_WritersTransitionsAndRemovers, TestRunBegin |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-HEAD-GUARD-001 |
A source scan refuses any other use of UpdateHead, a transition without its closure and interrupt tests, and any store remover other than the mark-gated Cleaner.removePlanned and the ordered DeleteVolume. |
M9 every transition | core/frontend/chunkstore/layout (source scan of the package) |
TestGuard_WritersTransitionsAndRemovers, TestGuard_Controls |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-HEAD-CODEC-001 |
HEAD is canonical JSON with at most 10 snapshots (MaxSnapshots) and sorted unique dependents; unknown fields, non-canonical bytes and names that are not valid UTF-8 are refused at encode and decode, and the next HEAD is checked before it is written. |
M9 every transition | core/frontend/chunkstore/layout head.go Head.check, Head.Encode, DecodeHead |
TestHead_GoldenEncodingRoundTrip, TestHead_Refusals, TestHead_RefusesInvalidUTF8 |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-HEAD-V11-VERSION-001 |
Any HEAD carrying a v1.1-only field (a manifest size, ext) is version 1, and a v1.1 commit writes version 1 whether or not it knows the manifest size; a version-0 HEAD with one is refused. | M-snapshot commit | core/frontend/chunkstore/layout/commit.go withManifestBytes; core/frontend/chunkstore/layout/head.go check, checkExt; core/frontend/chunkstore/layout_remote.go (CommitRequest.V11) |
TestCommitRecordsTheManifestSize (core/frontend/chunkstore/layout/head_version_test.go); TestACommitByChangeKeepsAnUnknownSizeUnknown (core/frontend/chunkstore/layout_manifest_size_test.go) |
none | ACTIVE |
INV-SNAPK-HEAD-V11-STAMP-001 |
Every write that leaves a version-1 HEAD stamps each snapshot that has no publishing generation with that write's generation; a version-1 HEAD write with an unstamped snapshot is refused, reads stay tolerant. | M-snapshot commit | core/frontend/chunkstore/layout/head.go runTransition; core/frontend/chunkstore/layout/snapshot_generation.go stampedForWrite, checkWrite |
TestV11CutPublishesASnapshotThatCanBeDeletedByItsTarget, TestV11FirstCutStampsTheLegacySnapshots, TestVersion1UnstampedSnapshotIsRefusedOnWriteOnly (core/frontend/chunkstore/layout/snapshot_stamp_write_test.go) |
none | ACTIVE |
INV-SNAPK-HEAD-FORMAT-LEVEL-001 |
No HEAD write raises HEAD from version 0 to version 1 below format level 1 (a writer's level absent = 0), whichever writer tries; a HEAD already at version 1 stays writable at any level. | M-snapshot commit | core/frontend/chunkstore/layout/format_level.go checkFormatLevel, WithFormatLevel; core/frontend/chunkstore/layout/head.go runTransition; core/frontend/chunkstore/layout_remote.go atFormatLevel |
TestNoHeadWriteRaisesTheVersionBelowFormatLevelOne (core/frontend/chunkstore/layout/format_level_test.go); TestALevelZeroCommitCannotRaiseHeadToVersionOne (core/frontend/chunkstore/layout_manifest_size_test.go); TestLevelZeroCutRefusalDoesNotBecomeAnUnresolvedPublication (core/frontend/chunkstore/layout_format_refusal_test.go); TestChunkFormatRefusalIsTypedWithoutHidingAnEarlierUnknownWrite (core/host/volume/chunk_format_refusal_test.go) |
none | ACTIVE |
INV-SNAPK-BEGIN-001 |
Begin opens snap(s) only for the holder at HEAD's epoch and only from idle; a re-run of the open session writes nothing; killed at its write and re-run, it ends in snap(s) at one generation step. | M9 idle → snap | core/frontend/chunkstore/layout head.go Head.Begin, RunBegin |
TestBegin_Closure, TestRunBegin_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-ABORT-001 |
Abort closes the holder's own snap(s) and changes nothing else; after its own crash a holder rolls the open session back before beginning another; over idle Abort writes nothing and its success never says whether the work was committed. | M9 snap → idle (Abort) | core/frontend/chunkstore/layout head.go Head.Abort, RunAbort; core/frontend/durable/provider_layout.go settleLayoutStop |
TestLayoutStopAbortMustConfirmItsOutcome, TestLayoutRemote_AbortOpenSessionDoesNotWaitForAHeldCommit, TestLayoutRemote_AbortOpenSessionFencesAForeignHead, TestLayoutRemoteSessionFieldSites, TestAbort_Closure, TestAbort_IdleMeansNoActivityRemains, TestAbort_RollBackAfterOwnCrash, TestRunAbort_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-COMMIT-REACH-001 |
A commit never names an unwritten object: before its HEAD update it finds present, written by its session or adopted from an earlier one of this volume, the own chunks new against HEAD's current root, every segment and the root; unchanged and foreign chunks are not looked up. | M9 snap → idle (Commit) | core/frontend/chunkstore/layout commit.go RunCommit, CheckCommitObjects, Head.Commit; the lookups run with the cut's budget before the bounded HEAD update (layout_remote.go LayoutRemote.CheckCommit, called by core/storage/chunk_layer.go), and the CAS skips them only for the (session, root) checked |
TestCommit_Closure, TestRunCommit_LooksUpOnlyWhatIsNew, TestRunCommit_RefusesUnwrittenObjects, TestRunCommit_StaleBaseAndLookupFailure, TestRunCommit_AfterAnEmptyPublishedRoot, TestRunCommit_InterruptAtEveryStep; its verification is bounded parallel and stays all-or-nothing: TestCommitVerifiesManyNewChunksWithinTheBudget, TestADetachingCommitOfManyNewChunksCompletesWithinTheBudget, TestCommitRefusesWhenOneOfManyNewChunksIsNotPrepared, TestCommitLookupsNeverExceedTheCap, TestACancelledCommitStopsJoinsAndWritesNothing, TestTheEarliestFailureByPositionDecidesTheError (commit_verify_scale_test.go, commit_verify_controls_test.go); outside the 2 s update: TestCutCommitsWhenItsObjectCheckOutlastsTheHeadUpdate, TestCASSkipsTheLookupsCheckedForItsSessionAndRoot, TestCASWithNoPassedCheckDoesTheLookups, TestCASAfterACheckOfAnotherRootDoesTheLookups, TestBeginCleanBetweenTheCheckAndTheUpdateIsBusy, TestAPreCheckThatFindsAChunkMissingEndsWithNoLookupInTheCAS (core/frontend/chunkstore/layout_commit_check_budget_test.go); TestObjectsCheckedIsWrittenOnlyByCASHead, TestCASAfterAnAbortAndANewSessionAtTheSameRootDoesTheLookups, TestCommitPendingSnapshotLooksUpTheRootAndSegments, TestMetadataRetryLooksUpOnlyWithoutAPassedCheck (core/frontend/chunkstore/layout_commit_check_guards_test.go); through the provider's wrapped remote: TestProviderCutCommitsWhenItsObjectCheckOutlastsTheHeadUpdate, TestProviderWrappedRemoteKeepsTheLayoutRemotesOptionalInterfaces (core/frontend/durable/commit_check_budget_test.go); TestLayoutRemoteUploadFinishedAfterSessionEndCannotCommit (core/frontend/chunkstore/layout_upload_concurrency_test.go); also in core/frontend/chunkstore/layout/commit_test.go |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-SNAPSHOT-META-001 |
Snapshot retention metadata (creation time, class, expiry and at most four bounded labels) is written by the commit that creates the snapshot name and never changed by a replay. | M9 snap -> idle (named Commit) | core/frontend/chunkstore/layout/head.go SnapshotMeta, codec; commit.go Head.Commit, RunCommit; core/host/volume/chunk_control.go chunkControl.Snapshot, chunkControl.ListSnapshots |
TestSnapshotMeta_WrittenOnceByTheCommit, TestHead_BoundsRefused, TestGuard_SafetyIgnoresSnapshotMeta; TestChunkControlPassesRetentionFactsToTheNamedCommit, TestChunkControlUsesTheBoundLayoutIdentity |
Retention facts affect policy only; the safety guard forbids their use in reachability/removal. Actual provider and scheduled capture integration remain cutover work; no live-path claim. | ACTIVE |
INV-SNAPK-SNAPSHOT-POSITION-001 |
A snapshot name is recorded only by a commit at or past the position of the last write acknowledged when the request set it; a cut already past its barrier commits unnamed and leaves it pending for the request's own cut, and a withdrawn name is never recorded. | M9 snap -> idle (named Commit) | core/frontend/chunkstore/layout_remote.go SetSnapshot, CASHead, CommitPendingSnapshot; core/frontend/durable/provider_layout_snapshot.go SnapshotVolume (scheduled snapshots and volume backup take this path) |
TestASnapshotNameIsNotTakenByACutPastItsBarrier, TestAWithdrawnSnapshotNameIsNeverRecorded, TestAPendingNameIsNotPutOnAnImageOlderThanTheRequest (core/frontend/chunkstore/layout_snapshot_position_test.go) |
— (the snapshot-name model is not in this repository) | ACTIVE |
INV-SNAPK-DETACHED-001 |
A detached HEAD remains closed to its same-epoch holder; only a higher-epoch Claim returns it to live. | M9 snap → detached → higher-epoch idle | core/frontend/chunkstore/layout commit.go, head.go, claim.go, start.go |
TestLayoutStopAbortMustConfirmItsOutcome, TestWorkspaceLayoutDetachedProof, TestCommitDetached_ProofAndLostReply, TestDetachedHEAD_RefusesEveryHolderTransition, TestDetachedHEAD_NewGrantStillWaitsForTheOldLease |
Caller write-barrier and synced-position join, master clean-proof reader and composed model review remain cutover gates. | ACTIVE |
INV-SNAPK-TXN-INTERRUPT-001 |
A snapshot transaction killed at any of its writes (Begin, each object, Commit), before the write or after it applied with its reply lost, never leaves HEAD reaching a missing object, and the restarted holder (roll back, new session, base recomputed from HEAD) ends at the committed image. | M9 idle → snap → idle | core/frontend/chunkstore/layout head.go, commit.go (the transitions above) |
TestSnapshotSession_InterruptAtEveryStep, TestReachableMissing_Controls, TestAbort_AfterCommitLeavesTheCommit |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPSHOT-STOP-HANDOFF-001 |
After an uncertain snapshot RunCommit, a payload-free session keeps the token only for the same image and owner. Earlier preparation failures and ordinary ended sessions still invalidate it. Detach joins its canceled worker; cancellation proves no outcome. | M9 snapshot commit interruption; M5 detach quiesce | LayoutRemote.CommitPendingSnapshot, syncSessionLocked, viewLocked; DurableProvider.stopChunkLoop |
TestDetachCancelsScheduledSnapshotHeadAndStillSeals, TestLostSnapshotOnlySessionPreservesOnlyAnUnchangedUnstagedView, TestSnapshotHandoffLifetimeIsBounded; existing staged-session and no-op generation controls |
SnapOps.Publish/Settle projection bookkeeping; no persisted state change | ACTIVE |
INV-SNAPK-CLAIM-LEASE-001 |
A claim takes HEAD only at a newer epoch and only after every older holder's lease has ended (checked after the read, before the update); it voids any open session or cleaning, so the old holder's commit, abort and begin are refused. | M9 any → idle (Claim) | core/frontend/chunkstore/layout claim.go RunClaim, Head.Claim |
TestClaim_Closure, TestRunClaim_WaitsForTheOldLease, TestRunClaim_VoidsTheOldSession, TestRunClaim_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-CLEAN-EXCL-001 |
A cleaning and a snapshot exclude each other through HEAD's one activity field, so no name is removed while a snapshot is open; a claim voids an open cleaning. | M9 idle → clean → idle | core/frontend/chunkstore/layout clean.go Head.BeginClean, Head.EndClean |
TestBeginClean_Closure, TestEndClean_Closure, TestEndClean_IdleMeansNoActivityRemains, TestClean_ExcludesSnapshot, TestRunBeginClean_InterruptAtEveryStep, TestRunEndClean_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-CLEAN-HOLDER-PASS-001 |
The holder's periodic cleaning runs as the identity Start established: Begin refuses any other holder, claim or epoch; a pass with no identity, or whose retention failed, removes nothing; every opened cleaning is closed, also on error. | M9 idle → clean → idle (holder pass) | core/frontend/chunkstore/layout_remote.go LayoutRemote.Clean; core/frontend/chunkstore/clean_b.go BCatalog.RemoveUnreachableAll; cmd/blockvolume/chunk_maintenance.go newChunkMaintenance |
TestBCatalog_CleanIsHolderOnly, TestBCatalog_CleanClosesOnError, TestBCatalog_CleanRemovesOnlyUnreachable, TestBCatalog_CleanWaitsForAnOpenSnapshot, TestBCatalog_CleanAfterOverwriteAndSnapshotDelete (core/frontend/chunkstore/clean_b_test.go); TestMaintenanceCleansOnlyAsTheHolder, TestMaintenanceRetentionFailureNeverStartsCleaning (cmd/blockvolume/chunk_maintenance_test.go) |
— | ACTIVE |
INV-SNAPK-READ-MISSING-001 |
A read resolves root, segment, chunk; an index the root does not name is zeros; a root, segment or chunk the root reaches but the store lacks is ErrMissing, never zeros; bytes that do not hash to their name are ErrCorrupt; a foreign chunk is read from its owner's pool. | Content-named layout (read path, no state transition) | core/frontend/chunkstore/layout read.go Reader.Open, Image.Segment, Image.Chunk |
TestRead_AbsentIndexIsZeros, TestRead_ForeignChunkFromSourcePool, TestRead_MissingObjectIsAnErrorNeverZeros, TestRead_FetchFailureAndCorruption, TestRead_SegmentOfAnotherShardRefused |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-CLEAN-DEPENDENTS-001 |
A snapshot with restore dependents never leaves HEAD through operator deletion or retention expiry/pruning; its root stays in HeadRoots, so cleaning needs no separate Dependent.Root walk. | M9 snapshot remove (K: HEAD) | core/frontend/chunkstore/layout/snapshots.go; core/frontend/chunkstore/retain_b.go |
TestSnapshotWithDependentsSurvivesEveryRemovalTransition (core/frontend/chunkstore/layout/snapshot_dependents_guard_test.go); TestDependentSnapshotSurvivesOperatorExpiryAndRetentionPrune (core/frontend/chunkstore/clean_dependents_test.go) |
CommitReach2 assumption A5; rows 71-75 and model-code trace | ACTIVE |
INV-CLEAN-SNAPSHOT-PROBE-001 |
A 30-second holder probe reads only snapshot names; open local activity or a busy runtime skips the read. Missing names ask for ordinary cleaning; unknown reads imply nothing. The probe neither rolls back activity nor changes the engine view. | M9 maintenance scheduling (K: HEAD) | core/frontend/chunkstore/layout_remote.go ProbeSnapshots; core/frontend/durable/provider_chunk.go |
TestLayoutSnapshotProbeSkipsOpenActivityWithoutReadingHEAD (core/frontend/chunkstore/layout_snapshot_probe_test.go); TestMaintenanceNoticesSnapshotDeleteWithoutNotification (core/frontend/durable/maintenance_probe_test.go) |
CommitReach2 CBegin (scheduling only; BeginClean remains the idle guard) | ACTIVE |
INV-SCHEDULE-DUE-NOW-001 |
The local opt-in due-now request queues only a running configured schedule, using its existing worker and admission. A cancelled or ended snapshot worker refuses even while the aggregate background group remains alive. | M9 scheduled capture (K: HEAD) | core/frontend/durable/chunk_snapshot_schedule.go; core/host/volume/chunk_control.go |
TestScheduledSnapshotDueNowUsesExistingLoop, TestScheduledSnapshotDueNowRefusesEndedWorkerWithBackgroundAlive (core/frontend/durable/snapshot_due_now_test.go); TestChunkScheduleNowRunsOnlyThroughEnabledLocalControl (core/host/volume/chunk_schedule_now_test.go) |
EngineAdapter.StartStop; CommitReach WCommit (ordinary capture) | ACTIVE |
INV-CLEAN-METADATA-001 |
Cleaning preserves Current and snapshot roots and their segments. Dependents keep their snapshot in HEAD. Unnamed roots go before segments and chunks; reuse defeats conditional removal. | M9 clean | core/frontend/chunkstore/layout/remove.go; core/frontend/chunkstore/clean_b.go |
TestCleanerMetadataRetainsCurrentSnapshotAndDependent, TestCleanerMetadataReuseDefeatsLateMarkAndDelete, TestCleanerRecreatesRemovedRootBeforeRenamingIt (core/frontend/chunkstore/layout/clean_metadata_test.go); TestCleaningInterruptsAfterMetadataBeforeChunks (core/frontend/chunkstore/clean_cursor_test.go) ; TestCleaningSegmentResumeReplansRootsBeforeRemovingSegments (core/frontend/chunkstore/clean_cursor_test.go) |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-CLEAN-CURSOR-001 |
Every new session scans roots first, preserves segment/chunk progress, and wraps after the final shard. Each page validates HEAD after parallel tags; reachability caches a conservative root set only within that session. | M9 clean (liveness) | core/frontend/chunkstore/clean_b.go; core/frontend/chunkstore/layout/remove.go |
TestCleaningCursorResumesAfterTimeoutAndWraps (core/frontend/chunkstore/clean_cursor_test.go); TestCleanerReachableOncePerShardAndRechecksHead, TestCleanerPlansTagsInBoundedParallelBeforeHead (core/frontend/chunkstore/layout/clean_scale_test.go) |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-REMOVE-MARK-001 |
Routine full-sweep removal requires the holder's own cleaning and no live HEAD root: tags precede HEAD validation, then mark conditional on the tag and delete conditional on the mark. | M9 clean → clean (RemoveUnreachable) | core/frontend/chunkstore/layout remove.go Cleaner.removePlanned |
TestRemoveUnreachable_RemovesOnlyWhatNoRootNames, TestCleaningPass_InterruptAtEveryStep, TestHolderFunctions_RefuseAStaleHolder |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-REMOVE-STOP-001 |
A reuse of an object after the plan, or after the mark, makes the remover's mark or delete fail its condition, however late it lands; an unreadable root stops the pass before any write; an open snapshot refuses it. | M9 clean → clean (RemoveUnreachable) | core/frontend/chunkstore/layout remove.go Cleaner.removePlanned |
TestRemoveUnreachable_ASuccessorAfterTheHeadViewDefeatsTheMark, TestRemoveUnreachable_ASuccessorBeforeTheHeadViewStopsThePass, TestRemoveUnreachable_AReuseAfterThePlanDefeatsTheMark, TestRemoveUnreachable_AReuseDefeatsALateMarkOrDelete, TestRemoveUnreachable_NothingRemovedOnAPartialView, TestRemoveUnreachable_RefusedOutsideItsCleaning |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-REMOVE-CONVERGE-001 |
A name a cleaning marked and did not delete (the remover died in between) is planned again by the next cleaning: the re-mark replaces the old mark, so the dead remover's late delete fails, and every unreachable name goes once a cleaning completes. | M9 clean → clean | core/frontend/chunkstore/layout remove.go Cleaner.removePlanned |
TestRemoveUnreachable_ReclaimsAnAbandonedMark, TestCleaningPass_InterruptAtEveryStep, TestLayoutStoreCleaningReclaimsAnAbandonedMark |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-REMOVE-GUARD-001 |
A source scan requires DeleteMarked as Cleaner.removePlanned's only removal, each immediately after an if on its Mark's error that leaves: an unconditional delete, an ignored mark, a reused mark or another method fails. | M9 clean → clean (RemoveUnreachable) | core/frontend/chunkstore/layout (source scan of remove.go) |
TestGuard_WritersTransitionsAndRemovers, TestGuard_Controls |
CommitReach rows 65-70; CommitReach2 rows 71-75 (CPlan, CView, CIssueMark/LandMark, CIssueDel/LandDel; model-code trace) | ACTIVE |
INV-SNAPK-REUSE-001 |
Writing an object for a session creates it, or reuses an existing one by a conditional update that sets the session and clears any mark; a commit names only objects its session wrote or reused, unmarked. | M9 snap → idle (Upload, Commit) | core/frontend/chunkstore/layout objects.go EnsureObject; commit.go RunCommit |
TestEnsureObject, TestRunCommit_NeedsObjectsOfItsOwnSession, TestSnapshotSession_InterruptAtEveryStep, TestLayoutStoreCreateExistsReclaimsOnlyItsUnusedUpload, TestLayoutStoreCreateUnknownOutcomeKeepsItsUpload, TestMaintenanceUnknownCreateKeepsLinkedUploadAndSettles |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-START-LAYOUT-ID-001 |
The launcher's full layout id must match VOLUME and HEAD, even when id8 collides; mismatch is ErrIdentity and startup exits 78 without claiming or serving. The flag comes from the master's volume record. | M9 Start refusal | core/frontend/chunkstore/layout_create.go ReadVolumeRecord; core/frontend/chunkstore/layout_store.go ReadHead; core/frontend/durable/provider_startup.go; cmd/blockvolume/process_exit.go; core/lifecycle/workload_plan.go |
TestLayoutIDMismatchIsTypedAndExits78; TestLauncherCarriesTheMasterLayoutIdentity; TestG15d_WorkloadPlan_BlankPoolRF2CreatesReplicaWorkloads |
K1; full identity, not the directory suffix | ACTIVE |
INV-SNAPK-IDENTITY-001 |
A volume is identified by the random id in its VOLUME record, never by its name alone; HEAD carries the volume id and refuses to encode without it. | Content-named layout; M9 every transition | core/frontend/chunkstore/layout volume.go Volume, VolumeID; head.go Head.check |
TestVolumeID_RandomAndParsed, TestVolume_GoldenEncodingRoundTrip, TestHead_GoldenEncodingRoundTrip, TestHead_Refusals |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-HEAD-ID-001 |
HEAD is decoded only for the volume whose VOLUME carries its volume id; a HEAD of another id, left by an interrupted delete or an old restore under a reused name, is ErrIdentity; a holder without a claim id is malformed. | M9 every transition | core/frontend/chunkstore/layout head.go DecodeHead, Head.check |
TestDecodeHead_RefusesAnotherVolumesHead, TestHead_HolderNeedsAClaimID |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-REF-ID-001 |
Every chunk reference in a segment carries its owner's volume id; a read checks it against the owner's VOLUME before fetching (another id is ErrIdentity), and the remover tells its own chunks by its VOLUME id. | Content-named layout | core/frontend/chunkstore/layout layout.go Segment.Encode; read.go Image.Chunk; remove.go |
TestSegment_EncodeRefusals, TestRead_ForeignChunkNeedsTheOwnersVolumeID, TestRemoveUnreachable_NeedsItsOwnVolumeID |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-DEP-ID-001 |
Every dependent records the target's volume id and the root of the snapshot it depends on; a dependent without the id, or of another root, is refused. | M9 snapshots and dependents | core/frontend/chunkstore/layout head.go Head.check |
TestHead_Refusals, TestHead_GoldenEncodingRoundTrip |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-CLAIM-ID-001 |
A holder is its epoch, its server and the claim id its claim wrote into HEAD; every transition refuses the same server at the same epoch with another claim id. | M9 every transition | core/frontend/chunkstore/layout head.go heldBy; claim.go Head.Claim |
TestClaim_WritesItsClaimID, TestTransitions_RefuseAStaleHolder, TestHolderFunctions_RefuseAStaleHolder |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-DELETE-ORDER-001 |
A volume delete runs in its order, each prefix safe and the whole re-runnable: HEAD deleting, this volume released from every source, its objects deleted, HEAD deleted. | M9 idle → deleting → deleted | core/frontend/chunkstore/layout delete.go DeleteVolume; core/frontend/chunkstore/catalog_b.go BCatalog.DeleteVolume, foreignOwners |
TestBCatalogVolumeDeleteRemovesIntentListPages (including interrupted and late-page rerun); TestDeleteVolume, TestDeleteVolume_InterruptAtEveryStep, TestRunMarkDeleting_InterruptAtEveryStep, TestRunMarkDeleted_InterruptAtEveryStep; TestBCatalog_DeleteRerunOnADeletedVolumeSucceeds, TestBCatalog_DeleteInterruptedAtEachStepCompletesOnRerun, TestBCatalog_DeleteRerunSkipsOnlyMissingRootsOfADeletingVolume (core/frontend/chunkstore/catalog_delete_rerun_test.go); also in core/frontend/chunkstore/layout/delete_test.go |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-DELETE-OWNED-001 |
Every object entry carries the id of its volume; a volume delete removes an object only if it carries that id, so a late delete of a finished run never removes the object of a volume created again under the name. | M9 deleting → deleted | core/frontend/chunkstore/layout delete.go DeleteVolume; objects.go ObjectStore.DeleteOfVolume |
TestBCatalogVolumeDeleteRemovesIntentListPages (same-name keeper); TestDeleteVolume_ALateDeleteSparesTheNameReused, TestDeleteVolume |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-DELETE-GATE-001 |
HEAD becomes deleting only with a committed deletion reservation, no live lease (unclaimed grants included), no open activity and no snapshot with dependents; from deleting on, no holder transition, claim or removal applies. | M2 any → DeleteReserved; M9 idle → deleting | core/frontend/chunkstore/layout delete.go Head.MarkDeleting; head.go holderErr; core/authority/workspace_delete_reservation.go; core/host/master/volume_delete_authority.go ReserveVolumeDeletion, CheckVolumeNoLiveLease; cmd/sw-block/chunk_volume_delete.go masterAuthority |
TestMarkDeleting_Closure, TestMarkDeleted_Closure, TestDeleting_RefusesEveryHolderStep, TestDeleteVolume; TestCommittedDeleteStopsGrantsAndWaitsForTheWholeLease, TestDeleteReservationClosesPausedGrantWriters, TestDeleteReservationMustBeDurableBeforeItCanProveNoLease, TestDeleteReservationContextAndPersistenceFailuresStayUnknown, TestDeleteOfALiveVolumeIsRefusedBeforePersisting, TestDeleteReservationReplayAndRestart, TestDeletionReservationGuardSites (core/authority); TestVolumeDeleteAuthorityReservationSurvivesRestart, TestVolumeDeleteAuthorityRPCs (core/host/master; durable RPC/restart probes run on Linux); TestOpsChunkVolumeDeleteRequiresTheMastersLeaseProof, TestOpsChunkVolumeDeleteClosesAPausedFirstGrant, TestChunkVolumeDeleteAuthorityRPCSites (cmd/sw-block) |
The reservation makes no-live-lease stable; a claim racing the conditional HEAD update still fails its generation check. The snapshot kernel model is external; composed model review pending. | ACTIVE |
INV-WS-DELETE-WITHOUT-ACK-001 |
A delete without the holder's acknowledgement is admitted only while the master's record still awaits a replica store (stage 1), marked durably first; the mark freezes the wait, so the primary never serves. Past stage 1 the live-lease refusal stays. | M2 any authority line, stores still awaited → DeleteReserved without the holder's acknowledgement | core/host/master/volume_delete_authority.go Reserve; core/host/master/store_attestation.go markDeleteWithoutAck, awaited |
TestANeverCreatedVolumeIsDeletedWithoutItsHolder, TestAnEstablishedVolumeIsNotDeletedUnderALiveLease (core/host/master/workspace_delete_never_created_test.go); TestAStage2VolumeKeepsTheLiveLeaseRefusal, TestTheDeleteMarkFreezesTheStoreWait, TestAStage2VolumeIsNotMarkedForADeleteWithoutAck (core/host/master/workspace_delete_proof_test.go); TestDeleteMarkWriterCensus, TestDeleteMarkWriterCensusControls (core/host/master/store_attestation_census_test.go) |
CreateEvid2 model rows mut_delete_on_flag_only, mut_no_horizon |
ACTIVE |
INV-CLI-DELETE-PROGRESS-001 |
Volume deletion bounds each sweep, continues across transient filer failures while objects are removed, reports on stderr while a sweep makes no progress (how long, the object it waits on, the count), and returns a retryable unavailable answer with progress after a no-progress window. | M9 deleting → deleted | cmd/sw-block/chunk_volume_delete.go deleteVolumeWithProgress |
TestVolumeDeleteContinuesAcrossTransientObjectFailures, TestVolumeDeleteReportsAStalledStoreWhileItWaits (cmd/sw-block/chunk_volume_delete_progress_test.go) |
Existing ordered delete; no new persisted state. | ACTIVE |
INV-SNAPK-DELETE-GUARD-001 |
A source scan requires DeleteVolume to run no-holder check, deleting, release, object deletes and deleted in that order, and allows it as the only remover besides RemoveUnreachable. | M9 idle → deleting → deleted | core/frontend/chunkstore/layout (source scan of delete.go) |
TestGuard_WritersTransitionsAndRemovers, TestGuard_Controls |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-VOLUME-DIR-001 |
A ready volume keeps its master-minted layout identity. Its - directory is created exclusively and never reused. Foreign chunk owners are checked against their full VOLUME identity. | Content-named layout and lifecycle create/lookup/launch | core/frontend/chunkstore/layout VolumeDir; core/lifecycle/store.go CreateVolume; core/host/master/services.go CreateVolume, GetVolume; core/rpc/lifecycleclient; core/launcher/k8s_renderer.go; cmd/blockvolume/main.go parseFlags; core/host/volume/chunk_control.go catalogVolume, ListSnapshots, DeleteSnapshot, Usage; cmd/blockvolume/chunk_remote.go chunkAttachCheck; core/frontend/chunkstore/layout/read.go Image.Chunk; core/rpc/lifecycleclient/identity.go ResolveVolume |
TestRead_ForeignChunkFromSourcePool, TestRead_ForeignChunkNeedsTheOwnersVolumeID; TestLifecycleLayoutIdentity, TestLayoutIdentityWriterAndReaders; TestGetLifecycleVolumeResolvesOnlyTheDurableIdentity; TestResolveVolumeNeverInventsAnIdentity; TestLauncherCarriesTheMasterLayoutIdentity; TestBlockvolumeLayoutIdentitySelectsTheLocalRoot; TestChunkControlUsesTheBoundLayoutIdentity, TestChunkControlCatalogLookupErrorIsNotAbsence, TestChunkAttachCheckAppliesVolumeRules; TestHeadReaders_Enumeration, TestDeleteAndDirectorySites_Enumeration |
Lifecycle ids are durable record fields, not assignment epochs. Old records without the field are refused by the new-layout lookup; host metadata is bound to the full name/id and does not fall back to a previous incarnation. Data-path, scheduled snapshot and cleaning callers plus Linux crash qualification remain cutover work. | ACTIVE |
INV-SNAPK-TOMBSTONE-001 |
For a restore target without HEAD (never created, or a restore died between its two creates) the operator writes a deleted HEAD exclusively in its directory before releasing, so the restore cannot create it later. | M9 source HEAD, dependents | core/frontend/chunkstore/layout delete.go OperatorReleaseDependent, TargetStore.CreateDeletedHead |
TestOperatorReleaseDependent, TestOperatorReleaseDependent_TombstoneLosesToTheRestore, TestGuard_Controls |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-KEEP-HEAD-001 |
Nothing removes a HEAD, a VOLUME or a volume directory: a volume delete removes only pool, segment and root objects; a source scan lists every delete and every directory-naming site in core/ and cmd/. | M9 deleting → deleted | core/frontend/chunkstore/layout delete.go DeleteVolume; (source scan) |
TestDeleteVolume_RemovesOnlyObjects, TestDeleteAndDirectorySites_Enumeration |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-CREATE-001 |
A new volume or restore target gets VOLUME then an unclaimed HEAD (epoch 0, no holder, no claim id, idle), each created exclusively; only createVolume and the operator's tombstone create a HEAD; the first Start claims it from a fresh root. | M9 absent → idle | core/frontend/chunkstore/layout create.go CreateVolume, CreateTarget |
TestCreateVolume, TestCreateVolume_InterruptAtEveryStep, TestUnclaimedHead_Shape, TestStart_ClaimsAnUnclaimedHeadFromAFreshRoot, TestGuard_Controls |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-RESTORE-ORDER-001 |
Master checks the source HEAD and named snapshot and refuses RF>1 before persisting. The target binds source layout id, snapshot, request id and VOLUME geometry as not-ready; then AddDependent, copy root/segments, create VOLUME and unclaimed HEAD, and mark ready. A retry keeps the binding. | M9 source HEAD, dependents | core/lifecycle/store.go CreateVolume; core/host/master/services.go CreateVolume; core/frontend/chunkstore/layout/create.go CreateTarget; cmd/sw-block/chunk_b.go chunkRestore |
TestRestoreRequestBindsTargetName, TestRestoreCreateVolumePersistsRequestBeforeTargetAndHealsRetry, TestOpsChunkRestoreUsesOnlyMasterCreate, TestCreateTarget, TestRunAddDependent_RefusesAForeignSource |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-SNAP-DELETE-001 |
A named snapshot leaves HEAD by one conditional update, refused while it has dependents; the automatic delete (retention) also refuses a snapshot pinned at its time. | M9 idle → idle | core/frontend/chunkstore/layout snapshots.go Head.DeleteSnapshot, Head.RetireSnapshot |
TestDeleteSnapshot_Closure, TestRetireSnapshot_Closure, TestRunRetireSnapshot_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAP-OP-RECEIPT-001 |
A snapshot operation receipt survives reopening its volume store; changed intent is refused, terminal outcomes are immutable, and a stale owner or revision cannot advance the receipt. | M9 operation receipt | LayoutStore.CreateSnapshotOperation, AdvanceSnapshotOperation (create coupling, process-owned executor and compact index wired; native qualification pending) |
TestSnapshotOperationReceiptSurvivesReopenAndRejectsChangedIntent, TestSnapshotOperationStallReadmissionFencesOldOwner, TestSnapshotOperationSplitPublishReadmissionSettlesOneBinding |
SnapOps rows 211–219 and index-first rows 231–240; native qualification pending | STUB |
INV-SNAP-OP-TERMINAL-WRITERS-001 |
Create success settles a HEAD binding; create refusal is a pre-provider HEAD conflict. An initial-absence delete records not_found and can never execute. Provider failures never create terminal refusal. | M9 operation terminal outcome | LayoutStore.SettleSnapshotOperationFromHead, chunkControl.snapshotOperationAttempt, refuseInitiallyAbsentDelete |
TestSnapshotOperationTerminalWriterEnumeration, TestSnapshotOperationAppliedAnswerFailureNeverBecomesRefused, TestSnapshotOperationFencedFailurePreservesPublishedBinding, TestSnapshotOperationUnknownAuthorityLossKeepsReceiptForReadmission, TestSnapshotDeleteInitiallyAbsentIsImmutableRefusal |
SnapDelete.Admit; SnapOps row 218 and index-first rows 231–240 | STUB |
INV-SNAP-OP-WORKER-001 |
Retired with the synchronous snapshot answer: a snapshot is admitted only as an operation and read on its handle, so no synchronous retry replays an in-flight one. | M9 operation executor | — | — | — | ARCHIVED |
INV-SNAP-OP-CAPACITY-001 |
At 4096 nonterminal receipts, new snapshot-operation admission refuses retryably without a record; retained accepted and stalled operations still replay after reopening. | M9 operation admission | LayoutStore.CreateSnapshotOperation, compact index CAS |
TestSnapshotOperationRetirementFullPendingRefusesWithoutLosingReceipt |
SnapOps index-first rows 231–240; native qualification pending | STUB |
INV-SNAP-OP-CONCURRENT-CAPACITY-001 |
Concurrent admissions through independent volume stores share the durable 4096-record limit; with 4095 pending receipts, only one new request is admitted. | M9 operation admission | LayoutStore.CreateSnapshotOperation, writeOperationIndex |
TestSnapshotOperationRetirementConcurrentAdmissionsShareLastSlot |
SnapOps index-first rows 231–240 | STUB |
INV-SNAP-OP-TORN-INTENT-001 |
An admission interrupted before its receipt file persists retains the original intent across reopening; a changed retry refuses and the same intent can repair its receipt without executing work. | M9 operation admission | LayoutStore.CreateSnapshotOperation, repairOperationFromBinding |
TestSnapshotOperationTornAdmissionKeepsOriginalIntent, TestSnapshotOperationTornAdmissionWithAbsentHEADRefuses, TestSnapshotOperationUnknownIndexAnswerDoesNotAllocateTwice |
SnapOps.TornAdmit/Send; rows 231–240 | STUB |
INV-SNAP-OP-RETIRE-001 |
Only terminal-flagged receipts retire, in admission order; stalled receipts remain. Reusing a retired client ID allocates a new sequence and instance; an old handle never answers from the new receipt. | M9 operation retirement | CreateSnapshotOperation, ReadSnapshotOperationHandle |
TestSnapshotOperationRetirementUsesAdmissionOrderAndDoesNotAliasOldHandle |
SnapOps.Retire/Poll; rows 231–240 | STUB |
INV-SNAP-OP-TERMINAL-FLAG-001 |
A receipt's terminal outcome persists before its index terminal flag; a lagging flag is recoverable, and a rejected receipt write cannot make the slot retirable. | M9 terminal eligibility | AdvanceSnapshotOperation, flagTerminalOperation |
TestSnapshotOperationTerminalFlagNeverLeadsReceipt |
SnapOps.TermFlag; flag_leads mutation, rows 231–240 | STUB |
INV-SNAP-OP-ORPHAN-001 |
A receipt without an indexed sequence never answers or supplies an incarnation; retrying a torn replacement collects the orphan without another admission. | M9 receipt recovery | readOperationIndex, cleanOperationOrphans, sequence-qualified receipt names |
TestSnapshotOperationOrphanIsNeverAnsweredOrAdopted |
SnapOps.GC/Poll; adopt_orphan/trust_orphan mutations, rows 231–240 | STUB |
INV-SNAP-OP-ISSUED-HANDLE-001 |
A queued worker or provider-error recovery answers only its captured instance and sequence; retirement never admits replacement work or returns a reused ID's outcome. | M9 receipt recovery | chunkControl.snapshotOperationAttempt, ReadSnapshotOperationHandle |
TestSnapshotOperationDelayedFailureCannotAnswerReusedID, TestSnapshotOperationRetiredQueuedJobCannotReadmit |
SnapOps.Poll/Start; index-first rows 231–240 | STUB |
INV-SNAP-DELETE-INTENT-001 |
A retained delete receipt supplies its original target generation across reopening and resend; admission does not resolve a replacement. A missing receipt may repair only the target committed by its index slot. | M9 delete admission | LayoutStore.AdmitSnapshotDeleteOperation (catalog/kernel wiring pending) |
TestSnapshotDeleteAdmissionResumeNeverResolvesReplacement, TestSnapshotDeleteTornAdmissionRejectsReplacementTarget |
SnapDelete.Send; rows 241–245 | STUB |
INV-SNAP-DELETE-TARGET-001 |
A delete receipt's full-width target generation matches its canonical intent fingerprint and the index commitment; changing either the field alone or the field and fingerprint refuses. | M9 delete intent encoding | SnapshotOperation.validate, readOperationReceipt |
TestSnapshotDeleteTargetIsFullWidthAndBoundByIntent |
SnapDelete.Admit; rows 241–245 | STUB |
INV-SNAP-DELETE-ABSENT-001 |
Initial absence becomes immutable not_found, never a runnable zero target. Interrupted refusal resumes from its recorded absence without resolving a later same-name snapshot; unstamped legacy entries refuse before admission. | M9 delete admission | refuseInitiallyAbsentDelete, SnapshotOperation.validate |
TestSnapshotDeleteInitiallyAbsentIsImmutableRefusal, TestSnapshotDeleteInterruptedInitialRefusalCannotRebind, TestSnapshotDeleteLegacyResolverRefusalDoesNotAdmit |
SnapDelete.Admit; rows 241–245 | STUB |
INV-SNAP-OP-REBUILD-001 |
A missing indexed receipt with a matching HEAD binding reconstructs its original success without another cut; retirement of that settled receipt does not block snapshot removal. | M9 receipt settlement / removal | SettleSnapshotOperationFromHead, GuardSnapshotOperations, binding sequence/fingerprint |
TestSnapshotOperationBoundReceiptCanBeRebuiltAndRetiredBeforeRemoval |
SnapOps.Send/Settle/Delete; rows 231–240 | STUB |
INV-SNAP-OP-ORIGINAL-001 |
Within the retained operation window, retrying a snapshot create returns its original outcome after control, catalog or retention removal, and after name reuse; it performs no new cut or HEAD write. | M9 operation replay (planned) | chunkControl.Snapshot, shared HEAD/receipt guard, process-owned executor and compact index |
TestSnapshotOperationRetryAfterRemovalKeepsOriginalOutcome, TestSnapshotOperationOldIDDoesNotAliasReusedName (core/host/volume/snapshot_operation_red_test.go) |
SnapOps.Send/Publish/Delete; rows 211–219 (first red tranche only) | STUB |
INV-SNAP-OP-FINGERPRINT-001 |
A retained operation ID reused with changed snapshot intent refuses before any cut or HEAD write. | M9 operation admission (planned) | CreateSnapshotOperation canonical fingerprint; create executor wired; delete executor pending |
TestSnapshotOperationSameIDChangedIntentRefusesBeforeWrite (core/host/volume/snapshot_operation_red_test.go) |
SnapOps.Send; rows 211–219 | STUB |
INV-SNAP-OP-READMIT-001 |
A create whose HEAD publication applied before its answer was lost reconciles that original outcome on re-admission; later removal cannot cause another execution under its retained operation ID. | M9 operation re-admission (planned) | SnapshotOperationBinding, LayoutStore.GuardSnapshotOperations; create executor and compact index wired; native qualification pending |
TestSnapshotOperationLostPublishAnswerReadmitDeleteCannotRepublish, TestSnapshotOperationRemovalBeforeReadmitKeepsPublishedOutcome (core/host/volume/snapshot_operation_red_test.go) |
SnapOps.Send/Publish/Settle/Delete; rows 211–219 (persisted-stall removal controls included; concurrent-owner controls pending) | STUB |
INV-SNAPSHOT-NEW-NAME-001 |
New snapshot names are 1..64 ASCII letters, digits, dot, underscore or hyphen, excluding dot and dot-dot. Invalid admission returns invalid_name before store access. Existing HEAD names retain decode, lookup, restore-source and delete semantics. |
M9 operation admission | ValidateNewSnapshotName; CLI snapshot/backup; holder snapshot admission; CreateSnapshotOperation; SnapshotVolume |
TestNewSnapshotNameGrammar, TestNewSnapshotNameCLIRefusesBeforeIO, TestNewSnapshotNameRefusedBeforeControlOrStore, TestNewSnapshotNameOperationRefusedBeforeStore, TestNewSnapshotNameProviderRefusedBeforeStore, TestLegacySnapshotNamesRemainReadableAndDeletable |
SnapOps.Start admission guard; no persisted format change | ACTIVE |
INV-SNAP-OP-CLI-001 |
Snapshot observation preserves the printed operation ID across retries, polling, interruption and no-wait submission; observing an operation never admits another identity. | M9 operation observation (planned) | chunkObserveSnapshot, holder asynchronous create executor |
TestSnapshotOperationCLIUsesPrintedIDForAsyncObservation, TestSnapshotOperationCLIInterruptThenResumeUsesPrintedID (cmd/sw-block/snapshot_operation_red_test.go, cmd/sw-block/snapshot_operation_interrupt_unix_test.go) |
SnapOps.Send/Start; rows 211–219 (server crash controls owed) | STUB |
INV-SNAP-DELETE-HOLDER-RESUME-001 |
A holder delete operation that meets an earlier delete's unconsumed intent (busy) or a moved HEAD kicks the cleaning and resumes its own admitted operation within a bound: no second admission; past the bound it is left resumable (stalled, with its receipt), never answered as terminal. | M9 holder delete execution | core/host/volume/chunk_control.go deleteSnapshotOperation |
TestSnapshotDeleteHolderResumesAfterThePreviousIntentIsConsumed |
SnapDelete rows 241-245 | ACTIVE |
INV-SNAP-DELETE-NAME-001 |
The name-only delete primitive (an old client's) refuses a v1.1 HEAD without a HEAD write. Retries in one CLI invocation keep its request id and resolved incarnation, so a lost reply never deletes a replacement; a new invocation resolves the name again (--gen >= 1 pins it). | M9 legacy delete admission | layout.RunDeleteSnapshot; catalog, CLI and host delete routes |
TestSnapshotDeleteOldClientNameOnlyRefusesAV1Head, TestSnapshotDeleteAfterALostLegacyReplyIsANewIntent, TestSnapshotDeleteExplicitGenZeroIsRefusedBeforeAdmission, TestSnapshotDeleteHolderAfterALostLegacyReplyIsANewIntent, TestSnapshotDeletePublicOperationKeepsTargetAcrossRecreation, TestSnapshotDeletePublicNoWaitResumesSameAdmission, TestSnapshotDeletePublicAbsentHeadRefuses |
SnapDelete row 242; rows 241-245 | STUB |
INV-SNAP-DELETE-LOGICAL-001 |
A delete receipt succeeds only after its retained target is proven absent. Actual unlink and its durable reclamation intent publish in one HEAD CAS; physical continuation depends on HEAD/pages, not the receipt. | M9 delete running to succeeded | snapshotDeleteLogicalStep, RunDeleteSnapshotWithIntent |
TestSnapshotDeleteLogicalCommitKeepsIndependentIntent, TestSnapshotDeleteLogicalCommitResumesAcrossLostAnswers, TestSnapshotDeleteLogicalCommitSparesReplacement |
SnapDelete rows 241-245; PageChain rows 246-253 | STUB |
INV-SNAP-DELETE-EXECUTOR-001 |
A catalog delete attempt reads its issued handle before work, takes ownership by receipt CAS, and persists uncertain work as stalled. It never infers terminal success from a callback return; terminal replay reads the same incarnation. | M9 delete attempt transport | BCatalog.RunSnapshotDeleteOperation; CLI execution seam |
TestSnapshotDeleteCatalogResumesDurableIntentOnAnotherExecutor, TestSnapshotDeleteCatalogRefusesWrongIntentBeforeWork, TestSnapshotDeleteCatalogCannotInferSuccessFromWorkReturn, TestSnapshotDeleteOfflineCLILeavesProgressInFiler |
SnapDelete retained target; SnapOps owner/state refinement; V8 completion adapter and public command activation owed | STUB |
INV-SNAP-OP-ADMISSION-CLOSE-001 |
Admission checks HEAD after receipt publication and refuses a deleting/deleted or absent volume. Closed incarnations cannot answer retained operation queries; their terminal receipt bytes are not rewritten by closing. | M9 admission and observation | checkSnapshotOperationAdmission, readOperationIndex, create/delete admission |
TestSnapshotOperationAdmissionRechecksHeadAfterPublication, TestSnapshotOperationClosedVolumeRefusesReceipts, TestSnapshotOperationTerminalReadmissionRechecksHeadAfterFlag |
SnapVolDel rows 257-260 (per-incarnation) | STUB |
INV-SNAP-OP-END-001 |
Operation metadata is scoped to full VolumeID and creation generation. Late writes in a closed incarnation grant no authority. Dead-incarnation GC is idempotent and cannot affect a replacement; it does not promise no later writes. | M9 live incarnation to dead and GC | operationDirectory, readOperationIndex, deleteSnapshotOperations |
TestSnapshotOperationDeleteFencesPausedPublications, TestSnapshotOperationVolumeDeleteCleanupReruns, TestSnapshotOperationVolumeDeleteSparesForeignReceipt, TestSnapshotOperationDeadGCSparesUnobservedIncarnation |
SnapVolDel rows 257-260 (per-incarnation) | STUB |
INV-LIST-STAGE-RT-001 |
Each list staging attempt gives its Stat, HEAD check and object write one 30 s deadline established before reading HEAD. An earlier caller deadline wins; a renewed attempt requires a fresh HEAD check. | VolDelSweep r3 Stage / Land, RT = 30 s | layout/list_chain.go StageListPage; layout/delete_intent.go StageSnapshotDeletePage, adoptDeleteIntentPage |
TestListStagingWriteDeadlineStartsAtItsOwnHeadCheck, TestListStagingHonorsEarlierParentDeadline, TestListStagingAdoptionRetryGetsFreshCheckAndDeadline, TestListStagingBoundsStatBeforeAnyWrite |
Client waiting only: an already queued server apply may still land late; delete rerun collects it. VolDelSweep r3 11/11 on az1 per model owner. Native controls pass; Linux qualification pending. | STUB |
INV-SNAP-OP-CRASH-001 |
A durable snapshot intent survives holder SIGKILL before publication and completes once after restart; after publication, restart settles its original receipt without another cut. | M9 operation recovery (planned) | Process-owned create executor; native crash qualification pending | TestSnapshotOperationIntentAndPublicationCrashBoundaries, TestSnapshotOperationKillReceiptRejectsOrdinaryExit (cmd/blockvolume/snapshot_operation_crash_integration_test.go) |
SnapOps.Start/Publish/Settle; rows 211–219 (native red receipt owed) | STUB |
INV-SNAPK-RETAIN-META-001 |
Reachability, removal and the volume delete never read a snapshot's retention facts (source guard); the policy entry beside VOLUME changes by one conditional update and is read only by retain. | M9 snap → idle | core/frontend/chunkstore/layout head.go SnapshotMeta; core/frontend/chunkstore retain_b.go |
TestSnapshotMeta_WrittenOnceByTheCommit, TestGuard_SafetyIgnoresSnapshotMeta, TestBCatalog_RetainKeepsTheOldBehaviour, TestBCatalog_RetentionPolicyIsConditional |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-HEAD-BOUND-001 |
HEAD stays inline: at most 10 snapshots, names at most 64 bytes, 4 labels, 4 dependents per snapshot and 16 per HEAD, refused where they enter with the cure; Encode refuses a HEAD above 64 KiB. A snapshot past 10 is refused before its cut: nothing is written. | M9 every transition | core/frontend/chunkstore/layout head.go check, Encode; snapshots.go AddDependent; commit.go Commit; core/frontend/durable/provider_layout_snapshot.go SnapshotVolume; core/host/volume/chunk_control.go chunkErrorCode; core/host/volume/chunk_scheduled_snapshot.go ScheduledSnapshot |
TestHead_SizeAtTheSnapshotCap, TestHead_BoundsRefused, TestChunkSnapshotPastTheLimitIsRefusedWithHEADUnchanged, TestChunkSnapshotOperationPastTheLimitIsRefusedTyped, TestScheduledSnapshotAtTheLimitStillPublishes, TestChunkSnapshotRefusalsAreTyped, TestLayoutProviderSnapshotVolume |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-RELEASE-001 |
A target is released from a source's dependents by its volume id, from every snapshot, in one conditional update; a volume created again under its name releases nothing; an absent target writes nothing. | M9 source HEAD, dependents | core/frontend/chunkstore/layout delete.go Head.ReleaseDependent, RunReleaseDependent |
TestReleaseDependent_Closure, TestRunReleaseDependent_InterruptAtEveryStep |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-RELEASE-CALLERS-001 |
Only the target's own delete (its HEAD already deleting) and the operator's command release a dependent; a source scan restricts the callers and requires the operator's read of the target. | M9 source HEAD, dependents | core/frontend/chunkstore/layout (source scan of delete.go) |
TestGuard_Controls |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-RELEASE-OPERATOR-001 |
The operator's command releases a target that is deleted (HEAD deleting or deleted, or its directory's VOLUME of another id), one whose live roots name no chunk of the source, or one without HEAD, after its tombstone. | M9 source HEAD, dependents | core/frontend/chunkstore/layout delete.go OperatorReleaseDependent |
TestOperatorReleaseDependent |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-RELEASE-REFUSE-001 |
The operator's command refuses a live target still naming the source and one whose HEAD appeared before its tombstone, and then writes nothing to the source. | M9 source HEAD, dependents | core/frontend/chunkstore/layout delete.go OperatorReleaseDependent |
TestOperatorReleaseDependent |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-START-ROOT-001 |
At its own epoch a holder continues only on the local root whose claim id HEAD holds; a fresh root with another id is refused as a missing local root naming the cure, an older one as stale and fenced; neither writes HEAD. | M9 start (before any transition) | core/frontend/chunkstore/layout start.go Start; core/frontend/durable/provider_layout.go startLayoutRoot, initializeLayoutRoot; core/frontend/durable/provider_chunk.go attachChunk |
TestLayoutProviderRefusesEmptyOwnEpochAndRemountedOldRoot, TestLayoutStartCrashAtEachDurableArrow, TestStart_OwnEpochFreshRootRefusedBeforeClaim, TestStart_OwnEpochSameRootContinues, TestStart_LostClaimReplyContinues, TestStart_SameHostForcedSuccessorRefusesTheRemountedOldRoot |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-START-ACTIVITY-001 |
Before acknowledging guest writes, Start conditionally ends any open activity of a restarted holder's claim; a failed closure refuses attach. | M9 Start -> activity settled -> Serving | core/frontend/chunkstore/layout/start.go Start, RunAbort, RunEndClean; core/frontend/durable/provider_layout.go startLayoutRoot |
TestLayoutRestartClosesActivityBeforeGuestWrites, TestKernelTable |
K3; one process per local root: production HostVolumeLock holds /run/sw-block/locks/<volume>.lock before opening the store until Close. Provider close/reopen is tested; process-kill qualification and model review remain release gates. |
ACTIVE |
INV-SNAPK-START-LINEAGE-001 |
At an epoch above HEAD's a holder claims only with a fresh root (it restores from HEAD) or the root whose claim id HEAD holds; any other root holds older data and is refused as stale, HEAD unchanged. | M9 any → idle (Claim) | core/frontend/chunkstore/layout start.go Start |
TestStart_HigherEpochRefusesAnOlderLineage, TestStart_FreshRootAtHigherEpochClaims, TestStart_StaleRootNamesTheCure, TestStart_DeletingVolumeRefused, TestStart_ValidatesAgainstTheHeadItUpdates |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-START-POSITION-001 |
A root carrying HEAD's claim id but synced below HEAD's published position is an old copy of that lineage and is refused as stale, at its own epoch and above, HEAD unchanged. | M9 start (before any transition) | core/frontend/chunkstore/layout start.go Start |
TestStart_OldCopyOfTheRightRootRefused, TestStart_FreshAcrossACrashContinuesTheRestore |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-START-CLAIM-001 |
A claim is made only by Start, at an epoch above HEAD's, with the local root's claim id; a source scan refuses any other caller of RunClaim. | M9 any → idle (Claim) | core/frontend/chunkstore/layout start.go Start; (source scan) |
TestStart_FreshRootAtHigherEpochClaims, TestStart_Refusals, TestStart_InterruptAtTheClaim, TestGuard_Controls |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-STALE-HOLDER-001 |
Every transition refuses an older epoch of the same server, the same epoch held by another server, and the same epoch and server with another claim id, in idle, snap and clean; a new transition must be added to the table. | M9 every transition | core/frontend/chunkstore/layout Head.heldBy and each transition |
TestTransitions_RefuseAStaleHolder |
— (the snapshot kernel model is not in this repository) | ACTIVE |
INV-SNAPK-READER-CONCURRENT-001 |
A Reader is safe for concurrent reads: its cache of volume ids is guarded by a leaf lock held only around the cache, never across a fetch, so concurrent first reads of a volume's id agree and cannot fault the process. |
Content-named layout (no state transition) | core/frontend/chunkstore/layout read.go Reader.VolumeID |
TestReaderVolumeIDIsSafeForConcurrentReads (under -race) |
— | ACTIVE |
Notes:
- B.10 rows are enforced in a library with no production caller; they say nothing about a running volume until a caller is added and its own rows name these.
Snapshot incarnation format integration
| ID | Statement | Transition | Enforced in | Guard | Model | Status |
|---|---|---|---|---|---|---|
INV-SNAPSHOT-INCARNATION-001 |
A snapshot identity is its name and immutable publishing HEAD generation within the volume ID. A resumed delete removes only its admitted incarnation, never a recreated name. Every version-1 publication stamps legacy entries at base+1; a write with a zero generation is refused; reads are tolerant. | M9 snapshot publication and target-qualified removal | core/frontend/chunkstore/layout/head.go runTransition, check, checkWrite; core/frontend/chunkstore/layout/commit.go Commit; core/frontend/chunkstore/layout/snapshot_generation.go |
TestSnapshotPublishingGenerationGolden, TestLegacySnapshotStampKeepsOneIdentityAcrossRetry, TestSnapshotDeleteTargetSparesAnUnchangedImageRecreation, TestSnapshotDeleteCASConflictKeepsCapturedIncarnation, TestSnapshotDeletePublicAfterV11CommitStampsEveryIncarnation, TestVersionOneHeadRefusesUnstampedSnapshotOnWriteOnly, TestMixedLegacyVersionOneHeadIsStampedOnWrite |
SnapDelete rows 241-245 | ACTIVE |
Immutable list continuation integration
| ID | Statement | Transition | Enforced in | Guard | Model | Status |
|---|---|---|---|---|---|---|
INV-LIST-RESERVED-001 |
Version-1 HEAD preserves at most three additional checked list cursors without consuming them or refusing serving; list-page retirement remains conservative while they are present and reports newer_pending_work. | M9 all existing HEAD updates | core/frontend/chunkstore/layout/head.go check, clone; core/frontend/chunkstore/layout/remove.go Cleaner.Page |
TestMaintenanceStatusRealPassAndTimeout/newer-pending-work, TestReservedListsGoldenBytes, TestReservedListsValidationAndClone, TestReservedListsCloneDoesNotAlias, TestReservedListsDoNotBecomeCompatibilitySweepCandidates, TestMachineReadableHeadCensusCoversRealTransitionFieldSets, TestListWritesMatchExportedCensus |
ProducerSeam r1 E1-E3: Bounded, NoLeak, NoDangling (encoding only; producer deferred) | DORMANT |
INV-LIST-PUBLISH-001 |
A list publication names only durable authenticated pages of its open session; an unknown reply retains protection; a full slot returns queue_full without replacing pending work. | M9 snap -> snap | list_chain.go StageListPage, RunPublishList |
TestPublishList_Closure, TestRunPublishList_InterruptAtEveryStep, TestListSessionEndedDuringPageWriteCannotPublish, TestGenericListQueueFullCannotOverwritePendingWork, TestDeleteIntentQueueFullKeepsBothWorkAndReferences |
PageChain 246-250; QueueCap 375-380 (az1 8/8); NoDangling | DORMANT |
INV-LIST-CURSOR-001 |
The persisted list cursor advances only after its authenticated page's idempotent effects finish; a missing page never completes work. | M9 clean -> clean | list_chain.go RunAdvanceList |
TestAdvanceList_Closure, TestRunAdvanceList_InterruptAtEveryStep, TestListMissingConsumerPageNeverCompletes |
PageChain 246,251-253; NoLostWork | DORMANT |
INV-LIST-RETIRE-001 |
List-page removal requires a clean session and the existing conditional mark/delete order; every page reached by HEAD is spared, including shared tails. | M9 clean removal | core/frontend/chunkstore/layout/remove.go Cleaner.removePlanned; core/frontend/chunkstore/clean_b.go RemoveUnreachableAll |
TestListSweepSpareSessionAndReachableTail, TestListSharedTailSurvivesAbandonedChainAndResumes, TestLayoutStoreListPublishConsumeAndRetire, TestBCatalogFullSweepKeepsTheEntireCurrentList, TestBCatalogListRetirementResumesAfterRestart |
PageChain 246,248-251; NoDangling | ACTIVE |
INV-SNAPSHOT-DELETE-INTENT-001 |
Removing a captured snapshot incarnation and publishing its durable intent are one HEAD CAS; an unrelated metadata retry keeps the same target and durable pages. | M9 metadata delete | delete_intent.go RunDeleteSnapshotWithIntent |
TestDeleteSnapshotWithIntent_Closure, TestRunDeleteSnapshotWithIntent_InterruptAtEveryStep, TestDeleteIntentRetryKeepsDurablePagesAcrossMetadataCAS |
SnapDelete 241-245; PageChain 246-249 | DORMANT |
INV-SNAPSHOT-DELETE-CONSUME-001 |
Only current persisted delete intent authorizes offline reclamation; live roots remain protected, failed effects retain the cursor, and receipt retirement cannot erase work. | M9 idle intent continuation | core/frontend/chunkstore/layout/delete_intent.go RunConsumeSnapshotDeleteIntent; core/frontend/chunkstore/layout/remove.go Cleaner.removePlanned; core/frontend/chunkstore/layout_remote.go LayoutRemote.Clean |
TestConsumeSnapshotDeleteIntent_Closure, TestDeleteIntentOfflineAndReplacementPreserved, TestDeleteIntentMarkConflictKeepsUnfinishedPage, TestLayoutSnapshotDeleteIntentResumesWithoutReceipt, TestCatalogDeleteIntentResumesOnePageWithoutNamespaceScan, TestCatalogIntentCursorInterruptAndLostReply, TestHolderMaintenanceResumesThePersistedDeleteIntent, TestHolderMaintenanceIntentIsCancelledBeforeTheCutJoins |
PageChain r2 246,251-253 (az1 13/13); StaleClean 159-161 | ACTIVE |
INV-SNAPSHOT-DELETE-ADOPT-001 |
Publication adopts every intent page with a fresh CAS-base tag and checks it is present, this attempt's and unmarked; stale cleaners/adopters cannot remove or retag a published page, and staging never restores old tags. | M9 delete intent publication | delete_intent.go adoptDeleteIntentPage, RunDeleteSnapshotWithIntent, StageSnapshotDeletePage |
TestDeleteIntentRefreshedBaseFencesDelayedCleanerMark, TestDeleteIntentRefreshedBaseFencesDelayedCleanerDelete, TestDeleteIntentAdoptionCannotRestoreStaleTags, TestDeleteIntentStagingNeverRevertsPublishedTags, TestDeleteIntentPublicationChecksAdoptedPageMetadata, TestGenericIntentStagingCannotUndoRefreshedPublication |
StaleClean 159-161; exact-head refinement read required | DORMANT |
INV-SNAPSHOT-DELETE-ADOPT-002 |
After adopting an intent page under its own tag, publication reads the page again and authenticates it; a page that no longer reads or holds other bytes refuses the publication. The filer frees chunks from a deletion queue, so a reference whose chunk is still queued reads intact and publishes. | M9 delete intent publication | delete_intent.go RunDeleteSnapshotWithIntent, readListPage |
TestASnapshotDeleteIsNotPublishedOverAPageWhoseDataWasFreed (core/frontend/chunkstore/layout/delete_intent_reread_test.go); store witness TestWithoutTheChunkGuardAStaleMetadataChangeOverwritesARecreatedObject (core/frontend/chunkstore/layout_change_meta_recreated_test.go) |
MetaABA r2, checked outside the repository: the re-read alone does not hold PublishedReadable once the filer frees chunks later from a queue (mut_reread_delayed); with the chunk guard it holds (safe_chunks_equal). r1's safe_reread_only held only for immediate frees (historical scope) |
ACTIVE |
INV-LAYOUT-META-CHUNKS-001 |
With the chunk guard on, an adoption or mark writes its looked-up entry back only while the entry's chunk fids are unchanged, so it cannot land on an object deleted and created again since its lookup; a cleaner's delete expects its own mark, so it follows. | M9 delete intent publication; M9 clean(c) removal | core/frontend/chunkstore/layout_store.go changeMeta, chunkCondition; swfs.go UpdateEntryIfChunks |
TestAStaleMetadataChangeDoesNotOverwriteARecreatedObject, TestAStaleCleanerMarkDoesNotDeleteARecreatedObject, TestWithTheChunkGuardAnUnchangedObjectIsStillAdoptedMarkedAndDeleted (core/frontend/chunkstore/layout_change_meta_recreated_test.go); TestChunkGuardReportsOnlyAConditionTheFilerCanCarry (core/frontend/chunkstore/chunk_guard_report_test.go); TestOpsChunkStaleCLIAdoptionDoesNotOverwriteARecreatedObject (cmd/sw-block/chunk_guard_probe_test.go) |
MetaABA r2, checked outside the repository: PublishedReadable (safe_chunks_equal, safe_legacy_chunks_equal) |
ACTIVE |
The snapshot-delete consumer and list-page retirement above are reachable through holder maintenance and covered by Go assertions. Their ACTIVE status describes that reachability and test coverage, not fresh Linux, composed-operation or release qualification. Cut and upload-intent producers remain deferred; their dormant publication rows are not activated by this consumer slice.
The routine full-sweep scope of INV-SNAPK-REMOVE-MARK-001 is explicit here:
its holder/session guard and all existing controls remain unchanged. The new
dormant snapshot-intent branch instead requires the exact current HEAD intent,
idle activity and live/detached state, with the same live-root and conditional
mutation order. It cannot remove namespaces or unname another snapshot. It
requires separate review/activation; no production driver reaches it yet.
These three list rows are dormant until producer/consumer driver wiring and final queue-layout/format review. They do not declare by-change cleaning active.
Part C. Change rules
How a fix or a feature is calibrated against this model:
- Name the touched IDs. The pull request lists every Part B ID whose statement, enforcing function or test it touches, and the Part A machine and transition. A change on a protocol path that touches no ID says why.
- States and transitions move together. A new or changed state, transition or guard updates, in the same pull request: the Part A table, its diagram (in the design document, or here when the design document has none), the Part B rows, and the TLA+ specification if one models that machine (with its configurations re-run and the results in
docs/spec/README.md). - An ACTIVE row never loses its test. Renaming or moving a test updates the row. Deleting a test, or weakening it so it no longer asserts the statement, needs a replacement test in the same pull request.
- Every bug becomes a test and a row. A bug found by a unit test, a review, a soak or chaos run, or a TLA+ counterexample becomes a regression test that fails before the fix and passes after it, and a new or updated Part B row naming that test.
- Rows are stable. IDs are never reused or renumbered. A retired row stays with status
ARCHIVEDand a reason. A narrowed statement says what was dropped in a note. - STUB rows block claims. A release note or a design document must not claim a property backed only by a
STUBrow. Turning aSTUBintoACTIVEis the test plus the status change. - A fixed limit surrounds bounded work only. A time limit with a fixed value may surround only work whose amount does not grow with the volume's size (its chunk count, its log, its snapshot count). Work that grows is placed outside the limit and judged by progress: an attempt that ends without finishing keeps what it finished, and the next attempt does only the rest. A pull request that adds a limit, or adds work inside one, adds or updates its row in C.L and names the row's test.
C.W Wait sites (SYSTEM-MATH Part C)
One row per wait in the data and control paths. Guest-visible rows on one path must sum to at most 5 s.
| Site | Waits for | Bound | Owner that ends it | On expiry | Lock held while waiting | Guest-visible |
|---|---|---|---|---|---|---|
cmd/blockvolume/main.go runVolume, Host.ReplicaStoreRecord (one call before the durable open of a plain walstore holder) |
the master's GetReplicaStore answer |
replicaStoreQueryTimeout (10 s) |
the call's own context | exit 75 store_record_unreadable, nothing written; the supervisor restarts the unit |
none | no (no frontend has started) |
core/storage/chunk_publish_settled.go runPublishSettled (from unlockCap, on the cut or detach caller's goroutine) |
the OnPublishSettled hook to return |
the hook's duration: the hook must return without blocking and without remote calls, enqueueing its work to its own worker | the hook implementer | none: a stalled hook stalls its caller, and later reports queue without a bound (a nil hook queues nothing) | none (capMu and stMu released) |
yes on detach (the detach caller delivers before returning) |
cmd/blockvolume/frontend_gate.go awaitFrontendStart (from runVolume, before any frontend starts) |
the backend's first admitted I/O (StorageBackend.FirstServing), or the process's stop waiter returning |
none of its own: it ends on the stop waiter, which INV-WS-STARTUP-RETRY-001 bounds (a refused or timed-out claim latches exit 75/78) | runVolume (INV-FE-PRIMARY-READY-OPERATIONAL-001) |
no frontend starts; shutdown as after the frontends | none | no (no target listens yet) |
cmd/blockvolume/frontend_gate.go firstAdmitted (one goroutine from runVolume, workspace chunk primaries only) |
the backend's first admitted I/O (FirstServing), then AdmitsIO passing, re-checked every 50 ms (the backend has no projection-change signal) |
until first served or the process outcome (e.done), whichever comes first |
the process exit owner (superviseProcess) through e.done |
none: it ends without starting the frontends | none | no (no target listens yet) |
cmd/blockvolume/process_exit.go waitWorkspaceStop (one goroutine from runVolume, started with the workspace lease guard before the frontends) |
a signal, the lease guard's drain request or end, or the latched process outcome (startup, or a runtime HEAD fence) | the process lifetime | the process exit owner (superviseProcess, INV-WS-STARTUP-RETRY-001) |
the chosen exit status (0 revoked/signal, 75 retry, 78 superseded or head_fenced) |
none | no |
cmd/blockvolume/main.go runVolume, the receive of stopWait after the frontends started (when awaitFrontendStart released on first serving) |
the one result of the waitWorkspaceStop goroutine (its only producer, a channel of capacity one it sends to exactly once) |
the process lifetime, as waitWorkspaceStop |
the process exit owner (superviseProcess) |
shutdown with the handed-back lease drain request | none | no (the targets serve until the stop) |
core/frontend/durable/provider_startup.go watchChunkFence (one goroutine per attached chunk layer, started when the layer attaches) |
the 50 ms ticker (then reads the layer's latched fence flag) or provider close (closeCtx) |
the attached layer's lifetime: it returns at provider close, when the layer is no longer the volume's, or after publishing a fence; Close joins it (p.inflight) |
DurableProvider.Close (cancels closeCtx, then waits p.inflight) |
none: the ticker is its poll, not a deadline; a HEAD fence is published at most 50 ms after the layer latches it (I/O is refused from the latch) | none while waiting (p.mu only briefly to check the handle and publish) |
no |
cmd/blockvolume/process_exit.go watchChunkRuntimeFence (one goroutine from runVolume, workspace chunk primaries) |
the provider's runtime-fence wakeup (capacity one, ChunkRuntimeFenceUpdates), the process outcome (e.done) or the watch context |
the process lifetime: it returns after choosing 78 head_fenced, when another outcome is chosen, or when runVolume cancels its watch context |
the process exit owner (superviseProcess) |
none | none | no |
core/host/volume/chunk_control.go handleChunkCut initial observation |
terminal result or completed-step signal | at most requested W_cut after capture admission | completed worker / progress signal / timer / request cancellation | 202 in_progress with cut ID, sequence; cancellation ends only HTTP observation | no control/storage lock held | no |
core/storage/chunk_manual_cut.go captureMutex.Lock internal callers |
current capture owner releases; same waiting contract as the prior mutex; manual admission uses nonblocking tryManual instead | capture owner Unlock broadcasts; existing operation contexts bound their work, no independent mutex deadline | the existing capture owner | no timer or new refusal in this internal path | condition wait releases metadata mutex; caller's pre-existing outer lock order unchanged | no additional guest-visible wait |
core/frontend/durable/provider_chunk.go chunkAuthorityWait (one goroutine per recovery of a workspace chunk primary awaiting authority) |
a healthy projection (own assignment and a lease grant), then the HEAD claim | none while blockmaster gives no reply or refuses the node's credentials or identity (it serves nothing and holds no lease); otherwise max(the first reply after the local open and recovery, the master's barrier time) + 30 s; without a master wait, 30 s for assignment; attach attempts have per-fetch bounds and progress, never a total deadline | the host's contact observations (core/host/volume/master_wait.go), provider Close, a later recovery |
exit 75 assignment_timeout; 78 moved or deleted at once on a typed refusal |
none: the bound is read on the 20 ms poll without p.mu or h.attachMu |
no (no target listens) |
core/frontend/chunkstore/layout/commit.go allOwnedBySession, admission (sem <-, on the commit caller's goroutine) |
a free slot among commitVerifyParallel (32) object lookups in flight |
one lookup's duration: each admitted lookup honours the commit's context (ObjectStore.Stat returns on cancellation) and frees its slot when it returns |
the admitted lookup's goroutine (<-sem on return) |
none of its own: the caller's context ends the lookups; once any lookup fails, no further one is admitted | the caller's LayoutRemote.mu (core/frontend/chunkstore/layout_remote.go CASHead, CommitPendingSnapshot hold it across RunCommit); no HEAD-store lock |
indirect: cut inactivity window (5 min by default); snapshot retains its caller deadline |
core/frontend/chunkstore/layout/commit.go allOwnedBySession, join (wg.Wait) |
every admitted lookup to return | the slowest admitted lookup, bounded by the commit's context | allOwnedBySession (it admitted them; it returns only after the join, so none outlives the call) |
none of its own, as the admission row | the caller's LayoutRemote.mu, as the admission row |
indirect: cut inactivity window (5 min by default); snapshot retains its caller deadline |
core/frontend/durable/provider_projection_flight.go projectionWithin (capture admission: initial, pre-CAS, COW claims) |
the provider's one projection read (it takes the replica adapter's lock) that started after the admission began | the cut's context | the provider: one reader goroutine at a time, joined at Close (joinProjectionReader) |
the cut ends with its context's cause (refused, errChunkCaptureRefused); the read goes on and ends when the adapter's lock frees |
the caller's capture lock while waiting; none in the reader | no |
core/frontend/durable/provider.go Close, joinProjectionReader |
the capture admissions' projection read to return | projectionReaderCloseWait (5 s) |
Close |
logged; Close proceeds and the read ends when the adapter's lock frees | none | no |
| Site | Waits for | Bound | Ending owner | On expiry | Locks held | Guest I/O paused |
|---|---|---|---|---|---|---|
cmd/sw-block/cut_progress_poll.go chunkObserveCut, HTTP request/body |
one same-ID re-poll answer | remaining Wc since the last own sequence rise, shortened by the chosen absolute deadline | CLI cancels its per-request context and closes the response body | unknown (exit 3); no new cut identity issued | none | no |
cmd/sw-block/cut_progress_poll.go chunkObserveCut, poll pause |
next re-poll opportunity | min(100 ms, remaining observation/deadline time) | CLI loop; synchronous sleep returns within that bound | next loop checks expiry before sending | none | no |
Format v3 row 4 runs in production recovery (WALStore.recoverV3). Its typed scan result preserves trusted records, absolute end, highest LSN, contiguous frontier, trusted DurableLSN and stop cause separately. The W/BASE/fence owner (WALStore.recoverV3) must check R < W*, fence and publish bounds before readiness or append admission; neither codec nor scan success is readiness. The installed scan begins at max(BaseCursor, retainedTail). No ACTIVE v2 machine/guard is replaced by this step.
C.L Fixed limits
One row per fixed time limit on a volume's path that surrounds, or once surrounded, work that grows with the volume. A limit around work that does not grow (one object, one lease call, a shutdown) needs no row.
| Site | Limit | Inside the limit | Grows with the volume | Outside it, judged by progress | Test at 262,144 chunks |
|---|---|---|---|---|---|
cmd/sw-block/cut_progress_poll.go chunkObserveCut |
Wc = requested cut window + 5 s slack; --timeout default 60 s; optional --deadline absolute | one POST then read-only GET observation of the same cut; no total cap | yes: cut work grows with C | no own sequence rise, silence or restart -> outcome_unknown exit 3; cut_stalled -> exit 1; admission cut_busy -> retryable exit 4. Four handles per volume, each retained until Wc after terminal; worker owned and joined by control; native qualification owed | transport controls in cut_progress_poll_test.go, including 46 simulated minutes; no native or size measurement claim |
core/storage/chunk_head_belt.go casChunkHead, applied by LayoutRemote.commitStepLocked |
2 s per attempt | one HEAD step: the HEAD read, the commit's decision from its plan, the conditional write | no | the commit's preparation (the previous manifest, the next root and segments, the plan) and its object lookups, under the cut's limit; a commit after a passed check reuses the preparation | TestHolderCommitAtOneTiBKeepsItsPreparationOutOfTheHeadStep, TestCommitUpdateStepDoesNotRereadTheManifests |
| the same step, for a commit that was NOT checked first | 2 s per attempt | the step and the object lookups of every new chunk, and of a new root's segments and root even when no chunk is new | yes | nothing: no production caller commits without the check; a new caller must check first | none: a known gap, stated here so it is not claimed. Kept true by TestEveryHeadCommitIsCheckedFirst: every HEAD commit of the chunk layer (a cut's commit, a detach's cancellation, an unresolved cut's re-proposal) runs the object check before its CAS, and a new site fails until it does. TestDetachCancellationAfterALostUpdateLooksUpNothingInTheHeadStep measures the cancellation. The snapshot of an unchanged image commits under its caller's limit, not in this step |
core/storage/chunk_head_belt.go the chunk layer's HEAD reads: confirmChunkHead after a HEAD write, a no-op cut's authority read (noopCutHead), and readChunkHead when a write's outcome is settled |
2 s per remote call | the confirmation and a no-op cut over an unchanged HEAD read HEAD only (GetHeadRoot), no root and no segment; a settlement reads the whole manifest, one root fetch and one fetch per segment, each bounded on its own |
the confirmation and the no-op read: no; a settlement's fetch count: yes | a settlement's read as a whole, under the cut's limit; a no-op cut over a changed HEAD reads the whole manifest the same way | TestTheConfirmationAfterAHeadWriteReadsNoManifest, TestANoOpCutReadsNoManifestWhileHeadIsUnchanged (count 0 fetches whatever the size), TestAWholeHeadReadIsBoundedPerFetchWhenTheRemoteBoundsItsStep |
DurableProvider.chunkCutContext (ChunkCutTimeout) |
5 min inactivity by default, renewed by completed payloads or verified/adopted own-plan objects; 30 s per upload/verification request | staging the changed chunks, the check, the commit; no total cap | yes | silence returns cut_stalled; uploads finished before it are kept for retry in this process | TestManualCutProgressingBeyondFiveMinutesFinishesWithOneAdmission, TestManualCutStallRetryKeepsProgressAndReportsAttemptCounters, TestCutVerification262144ObjectsAfterUploadRenewsTheWindow |
the cleaning pass (boundedPass) |
the configured pass limit | listing and removing by page | yes | the pass resumes at its cursor; a session after a restart starts at the root page | the cleaning cursor's tests |
core/host/volume/chunk_control.go chunkContext (snapshot, detach and status; manual cut uses its own progress window) |
5 min, or the request's shorter limit | the snapshot or detach operation, including the cut it takes | yes | the cut's uploads, as the cut's row: an attempt that runs out of time keeps what it uploaded | STUB: no test at the control operation's level yet |
core/host/volume/recovery_watchdog.go (--recover-timeout), over cmd/blockvolume/durable_startup.go openAndRecoverDurable and the chunk layer's attach |
30 s without a new completed-work frontier, shared by recovery and attach | bounded local reads and final fence/publication; no total context around the per-entry recovery | the WAL scan, map copy and retained replay grow | a cumulative fixed-order phase/count high-water mark; repeated preparation cannot renew the clock; attach retries retain completed local recovery | TestDurableStartup_LocalRecoveryWorkIsOutsideFixedDeadline, TestRecoveryMapCountsOneTiBEntriesWithoutATotalDeadline, TestRecoveryProgress_CountingEntriesOutliveTheTotalWindow, TestRecoveryReporterSlowReplayReportsBeforeTheEntryBatch, TestRecoveryProgress_RepeatedAttachPreparationDoesNotRenew, TestAttachProgressCountsEachAttemptFromZero (attach integration); joint recovery+attach Linux qualification passed; ACTIVE (landed together); no 1 TiB time claim |
DurableProvider.chunkAuthorityWait, without a master wait |
30 s by default, checked between attempts | waiting for assignment; failed attempts check the same allowance before retrying | no | an admitted attach uses the same per-fetch bounds and recovery progress as lease mode | TestDefaultAttachAt262144EntriesOutlivesAssignmentWait (262144 real manifest entries, 27 segments; full run exceeds the shipped 30 s) |
core/frontend/durable/provider_chunk.go chunkAttachTimeout |
30 s around each remote call of an attach (the attach check, the layout Start, the root fetch and each segment fetch of the manifest read), never around the attempt | each object fetch bounded; the fetch count grows (27 segments at 1 TiB); judged by the window | yes (the fetch count) | each completed segment and the attach's local entries report RecoveryAttach, per attempt from zero, under the shared window above | TestAttachReportsItsVolumeSizedLocalWork (the counting test, 262144 entries), TestAttachManifestReadBoundsEachFetch, TestAttachGetHeadBoundsTheHeadRead, TestAttachRemoteCallsCarryTheirOwnBound, TestAttachManifestReadCarriesThePerFetchRule, TestAttachProgressCountsEachAttemptFromZero; joint recovery+attach Linux qualification passed; ACTIVE (landed together) |
Known limits of this table: what an attempt keeps is kept in the memory of one process. After a restart the cut uploads again what it cannot prove was uploaded; names are by content, so this costs time and no correctness.
The start path at 1 TiB, measured by the 1 TiB gate rows: attach about 4 s (about 1.4 ms per GiB; heap about 50 MB per TiB) and a restart after a kill about 2.1 s (about 1.5 ms per GiB), a wide margin under the 30 s window, so the limit stays a window. Both grow with the volume (they load the resident per-chunk state) and are bounded by the 1 TiB create cap; making them constant is a later release's work.
v3 offline reader (row12a)
INV-WAL-V3-READONLY-001(ACTIVE; the public selectorOpenReadOnlyopens this reader): the reader opens store and map read-only, validates both live slot dependencies and the trusted WAL prefix, merges WAL winners above the checkpoint with extents, and never runs recovery, a fence, a worker, or publication. Installing images, corrupt acknowledged WAL/map dependencies and unfinished fresh restores refuse. WAL records are checked again at read. An absent remote chunk returnsErrReadOnlyNotResident, even with a local hint; offline reading does not perform remote fills. Its production caller iscmd/m01verify.- Controls:
TestWALStoreV3_ReadOnlyMergesWALAndExtentWithoutWrites,TestWALStoreV3_ReadOnlyRefusesIncompleteOrCorruptDependencies,TestWALStoreV3_ReadOnlyNeverReturnsUnfilledExtentZeros,TestWALStoreV3_ReadOnlyRevalidatesWALAndBindsReadonlyMetadata, and the actual endpoint snapshot callerTestDurableProviderV3_StatusTracksRecoverSyncAndCapture. Reader mutex covers the descriptor read and Close; no new lock edge or durability state transition.
v3 chunk/BASE integration (row12a)
INV-WAL-V3-CHUNK-BASE-001(ACTIVE for mapped v3; no production caller of begin/complete with a layer attached: a layer attaches only with--durable-impl=walstore-chunk, which refuses replica roles): begin/complete first takeinstallMuexclusive, then the attached layer's whole-cutcapMudrain, then existing capture/lifecycle/leader/store/descriptor/file-sync admission. The drain is registered with Close; no lower store lock is held while it waits. A pending unknown HEAD CAS refuses begin until settled. A newly published layer invalidates an outer hooks snapshot before descriptor mutation. Unsupported attached layers still refuse. No capture path takes installMu and no checkpoint callback takes capMu.- The release runs after lower locks, before installMu release. It derives the in-memory guard from the actual descriptor on success or failure, invalidates staging generations and keeps dirty coverage conservative. Installing capture has an early typed refusal. Presence becomes local before the existing completion barrier can publish installed; a failure retains installing. Completed BASE attach treats local bytes (including ZERO) as authoritative, persists presence, and captures through the owned UNKNOWN/max-LSN map without a legacy bitmap. A fresh provider marker does not authorize seeding an older HEAD over completed local BASE; the read-only installed-BASE query is revalidated by attachment admission.
- Controls:
TestChunkLayerV3_BASEIncompleteCaptureGuard,TestChunkLayerV3_BASEBeginDrainsWholeCut,TestChunkLayerV3_BASEBeginRefusesUnsettledCAS,TestChunkLayerV3_BASEDrainJoinsClose,TestChunkLayerV3_BASEPresenceBarrierFailureKeepsInstalling, and the three actual provider controls inprovider_format_v3_base_test.go. The unsupported-layer refusal remains inTestBaseInstallV3BeginRefusesWithAnUnsupportedAttachedChunkLayer. BASE descriptor states remain unchanged. Chunk-managed providers opt into deferred retirement immediately after create/open, before Recover. Both installed local presence and the provider durable attach point are required before retirement. The provider removes its fresh marker and fsyncs its directory under the store installMu-exclusive commit, then records per-open owner readiness; the callback never re-enters the store. Layer attach alone never allows retirement. Later completed transitions require owner readiness plus saved full presence before allowing; the next ordinary publication still checks existing retirement coverage. The provider keeps the constructed layer private as chunkPending until this commit succeeds; explicit publication cannot resolve it and the scheduler starts only after commit. Failed commits retain the private layer for retry without reattaching. Held pre-marker controls require Capture/Cut/MakeRemoteDurable to return ErrNotChunkVolume with no new remote writes, intents or HEAD changes, then crash/reopen exact local bytes. Actual subprocess controls crash after presence but before marker removal (both pre-existing installed BASE and attached completion), retaining the installed discriminator and recovering exact local data. The opt-in is re-established on reopen, and unmanaged/unmapped stores retain ordinary retirement. A seed-only checkpoint is not local-image evidence. ControlsTestDurableProviderV3_DefersBASERetirementUntilLocalPresenceandTestDurableProviderV3_SeedOnlyCheckpointStillRestoresHEADdistinguish these cases; the presence-failure control also requires the gate remain deferred until successful retry. The external format model does not prove the chunk publication drain; the deterministic caller controls cover that seam.
Part D. Wait ownership
| Wait | Machine / invariant | Bound | Release and cancellation | Locks / remote work |
|---|---|---|---|---|
| Workspace revocation ACK closeout | M2 Revoking → Revoked; INV-WS-STARTUP-RETRY-001 |
workspaceLeaseCloseoutTimeout (19 s: the units' TimeoutStopSec=30s less the 5 s drain, the 5 s supervisor exit wait and 1 s margin), after the resource owner replies to the guard |
finishWorkspaceLease owns the wait. ACK success selects normal exit; error/expiry selects 75 with revoke_ack_unconfirmed. Within it the guard asks again, until the lease deadline, after an ACK call that got no answer (DeadlineExceeded, Unavailable); the master answers a repeat of a recorded ACK as recorded. The 5 s supervisor cleanup clock starts only after a nonzero outcome is selected. |
No provider/storage lock held. |
| Workspace primary retry cleanup | M2 restart; INV-WS-STARTUP-RETRY-001 |
Existing WorkspaceDrainTimeout (5 s) after retry/no-retry outcome selection |
Process supervisor owns the deadline and returns 75 or 78 even if resource-owner cleanup blocks; first outcome stays latched. Signal and ACKed revocation retain normal exit. | Provider latches by recovery generation under p.mu; wake is nonblocking; the supervisor holds no provider/storage lock. |
| Workspace primary supervisor retries | M2 restart; INV-WS-STARTUP-RETRY-001 |
Shipped systemd units: StartLimitIntervalSec=600, StartLimitBurst=10, RestartSec=5s. While the master answers, each cycle is the assignment wait (30 s from contact) + 5 s, reaching the limit in about 6 minutes; while it gives no reply the process waits without exiting, so an outage costs one start (the fence), not the limit. If the assignment wait exceeds about 55 s, raise the interval too or the window never fills |
systemd owns the restart window: after 10 starts in 600 s, another start within the window is refused and the unit fails; operator reset/start follows remediation. Exit 78, recorded-revocation exit 79 and ACKed exit 0 do not restart. | No application lock; TestBlockvolumeUnitsBoundStartupRetries (internal/testops/blockvolume_systemd_test.go) checks both shipped units. |
| Offline seal | M5 PlainStop -> Quiesce; INV-CUT-PLAIN-DETACH-001 |
Caller context; positive HTTP timeoutMs. Completed uploads resume only within one blockvolume process and matching owner/HEAD/chunk versions; after restart the seal must fit seal_timeout_ms. | Provider owns drain, detached cut and settlement. Cancellation preserves unknown/fenced outcome safety; a closed frontend stays closed. | No admission lock held during store or remote I/O. |
| Plain seal remote proof | M5 RemoteProof; INV-WS-SEAL-REPLAY-001 |
Earlier caller context or existing 2 s HEAD-operation bound for the filer read; attachment serialization retains its owner's cooperative caller bound | Provider registers with Close; closeBoundRemote cancels the read, and Close joins it. Failure keeps frontend admission closed. | Attachment mutex serializes against recover/detach; no backend/store/map lock spans the filer read. |
| Frontend pre-copy admission | M5 tentative admission -> resume; INV-CUT-PRECOPY-001 (not reachable in this release) |
Earlier of caller deadline and this command arrival + 5 s; one bound across retries, no inherited pause clock | Owner finishPrecopyLocked: resume or terminal Close clears the pause and grants all waiters in FIFO arrival order under one b.mu hold; each rechecks the ordinary gate. Expiry removes only its waiter and refuses with typed ErrBackendBusy + deadline cause (guest-visible: yes). Only a typed pause refusal requeues a granted waiter under the original command deadline; already-observed stale-primary and other gate errors are returned unchanged. Grant versus queue expiry is decided under the same lock; timely grants survive later queue-timer expiry but never caller expiry or a terminal gate. No dependency on another command's completion. |
No ioMu, store lock, or remote call while queued. Admitted I/O retains normal per-LBA serialization and lifecycle accounting. |
v3 write WAL-pressure admission: core/storage/wal_admission.go walAdmission.acquireContext, called by WALStore.WriteContext and WALStore.WriteBatchContext |
M1 Serving (write admission); INV-WAL-V3-ADMISSION-001, INV-WAL-V3-ADMISSION-DEADLINE-001, INV-WAL-V3-ADMISSION-FAULT-001 |
NVMe WAL hold commands share their arrival-based cap (default 25 s) and a per-command five-second inactivity window, renewed only by reclaimed/extent bytes. Explicit legacy transports keep the earlier of caller deadline and store entry + 4 s, less a reserve of min(1 s, a quarter of the time left). In the soft band (pressure at least 0.70 and below 0.90) the pressure wait is one sleep of at most 5 ms. | Owner: the flusher. The wait wakes it (NotifyUrgent) on entry and at every 2 ms recheck while pressure is at or above the 0.90 hard watermark, and ends once pressure falls below 0.90; FIFO admission then retains its ticket through that store append, releasing before adapter RMW/replica waits. On expiry the write is refused before its append, with no WAL byte, nextLSN or dirty entry changed: ErrWALPressureTimeout (retryable; frontend.ErrBackendBusy at the durable backend), or the original fault when a terminal fault has latched, or context.Canceled when the caller cancelled. The wait grants no reuse and acknowledges nothing. |
Held while waiting: the captureMu and lifecycleMu read locks, so a capture barrier, a BASE begin or complete, and Close join the command's bounded admission wait (default cap 25 s for NVMe holds; legacy admission at most about 3 s). Started I/O and short locks remain cooperative. Not held while it sleeps: the store, descriptor and WAL writer locks (each pressure sample takes and releases them). Local wait: no remote call. |
The WAL-pressure admission wait is the one wait here held under store locks (the captureMu and lifecycleMu read locks). It is a local wait: pressure samples, a timer and the flusher's local progress. No remote call is made while those locks are held, so the rule that no remote call runs under a lock still holds.
Frozen estimate reporting: a tail above the existing 60 s estimator ceiling reports the same 60 s rejection sentinel used by admission. It is known but saturated, not a complete fixed-plus-tail duration; quiesce slack is zero. Consumers must not use it as a completion forecast. Drain refusals retain the observation before their reason changes; this reporting does not reclassify refusal causes.
Part E. Quantities
| Quantity | Unit | Cap | Enforced at (producer) | Drained | Outcome at the cap |
|---|---|---|---|---|---|
| COW side-file spill per cut | bytes | min(COWSpillLimit (default 1 GiB, or the host limit's COW bytes), free space on --durable-root / 2 - 1 GiB), at least 0; the free space is read once per cut and that cap bounds both staging and the copy window; off Linux, the configured cap. Shown per cut in the layer stats (COWSpillCap, COWSpillCapReason: no_room_to_cut when the free space is within the reserve, free_space_unreadable when the read fails) |
the saver: core/storage/chunk_cut_cow.go readCutSpill, the save's cap check |
at the cut's end (the side file is removed on publish, abort or close) | that cut aborts (retryable), counted as cow_capacity, or as no_room_to_cut / free_space_unreadable when the free space made the cap 0; the guest write completes and nothing partial is published |
Part T. Terms bound to code
Some facts are read by many parts of the code: who the holder is, whether the lease is valid, whether the volume may serve. Each such fact is a term. For each term this part lists the fields that carry it, the one function that decides it on each side, and the role that owns it. A second derivation of a term is a defect. Code that needs a term calls its deciding function, or a function that only wraps that call. It never compares the term's fields again itself. Known second derivations are listed in each row together with the pull request that removes them, or "open".
A reviewer applies the rule to every pull request:
- If the diff reads or compares a field listed in a row anywhere other than that row's deciding function, it must call the deciding function instead. Otherwise it changes the row in the same pull request, and the description says why.
- A pull request that removes a listed second derivation also deletes it from the row. A pull request that adds a new one is refused, unless it adds the new derivation to the row as open, with a reason.
- Renaming, moving or splitting a deciding function updates its row in the same pull request.
A row that names a function existing only on an open pull request says so ("on #N"). The qualifier is dropped when that pull request merges. Code references name a file and a function, as in the rest of this document. A checker will later verify that every deciding function named here exists on main.
11 rows for 6 terms. They name 15 deciding functions: 10 on main and 5 only on open pull requests (2 on #411, 1 on #409, 1 on #439, 1 on #548). One row (TERM-STOP-STALE-ROOT-001) has no named function yet.
| Term | Meaning | Field(s) | Deciding function (one per side) | Known second derivations to remove | Owner role |
|---|---|---|---|---|---|
TERM-CALLER-001 Caller identity (blockmaster control API) |
Who is calling blockmaster is the role-file line whose fingerprint is the sha256 of the verified client leaf certificate, with CN equal to the line's id and the certificate not expired on the master clock. A request field never names the caller. A node's id is its server id: a node may act only for that server id. | the TLS peer's verified chain (credentials.TLSInfo); the role file's lines sha256:<hex> <role> <id> (auth.Table); auth.Principal Role, ID, Fingerprint, NotAfter |
Master: core/auth/identity.go Authenticator.PeerIdentity, on #548; called by the interceptors on every call and before every stream send, and by auth.RequireNode / auth.RequireRole through the call's decision. |
The registered-host check (refuseWorkspaceHolderHost, refuseServerIDFromOtherHost) is kept beside it by decision, not a second derivation of the caller: it checks the network address, not the certificate. |
authority (master side) |
TERM-LIVE-HOLDER-001 Live holder of a workspace volume |
The line's holder at epoch e may have acknowledged guest writes and may publish exactly when: the authority line exists at e for its owner (TERM-HOLDER-001), no clean revocation ACK is recorded for (replica, e), and HEAD as read names <server>/<replica> at e, active. HEAD below e means never started at e: no I/O is admitted before the claim. |
the authority line, the recorded ACK, HEAD (Epoch, Holder, Detached) |
authority.WorkspaceHolderState (pure): no line, drained, sealed, never started, live, unknown |
the forced-move admission still reads the lease; a sealed HEAD without an ACK keeps the ACK rule | blockmaster |
TERM-HOLDER-001 Holder identity (the primary of a single-copy workspace volume only; supporting replicas are not holders) |
The process that may act as primary of a single-copy workspace volume at an epoch is the pair (server id, replica id) at that epoch. A matching replica id or endpoint alone never names it, and a missing server id is refused. No local-root nonce joins it (holder identity rule); one live process per volume on a host is the host lock (TERM-ONE-PROCESS-001). |
AssignmentFact server_id, replica_id, epoch (core/rpc/proto/control.proto; server_id on #411); WorkspaceIdentity server_id, replica_id, epoch (core/rpc/proto/workspace.proto; server_id on #411); the published line's PublishedLine.IssuedHost (core/authority/workspace_lease_view.go) and the move journal's WorkspaceMoveRecord.NewHost (core/authority/workspace.go); the volume's Config.ServerID, Config.ReplicaID (core/host/volume/host.go, from --server-id, --replica-id); the HEAD Holder, written as <server id>/<replica id> (cmd/blockvolume/chunk_remote.go chunkHolder) |
Master: core/host/master/workspace_service.go services.holderMatches(volume, replica, server, epoch), on #411; it gates RenewWorkspaceLease and AckWorkspaceRevoked, after the host check of #416, and takes the line's owner server from core/host/master/workspace_binding.go Host.workspaceLineOwner, on #423, the one owner decision for current and historical lines (through PublishedLine.Owner, which the snapshot builder's expectOwnerForLine also calls). The line's owner server is carried in the published line; a move's line names the move's new host; placement names the owner only for the initial line; an unknown owner is sent empty and never adopted. A volume that has seen an epoch owned by one server never adopts that epoch for another (this covers replays). The safety rule is the refusal to adopt a line naming another server; fencing on a foreign line is defence in depth, and only a process that has adopted a lineage fences, on a strictly newer foreign line. Volume: core/host/volume/assignment_holder.go Host.assignmentNamesSelf, on #411; called by applyFact and IsSuperseded. |
Host.applyFact adopts a fact on the replica id alone. Host.IsSuperseded ignores a same-replica line from another server. Host.recordOtherLine lets an older line overwrite a newer one. Lease renewals and revocation ACKs carry no server id. All four are removed by #411. The master's status frontends and CSI publish target take the freshest same-replica heartbeat from any server (ObservationStore.SlotFact via statusFrontendsForAssignedVolume), and the operator's primary node is the placement slot (serverForReplica). Both are removed by #416, stacked on #411. The master computed the line's owner server twice; #423 makes it one function. |
authority (master side); volume host (volume side) |
TERM-LEASE-NOW-001 Lease valid now |
The holder may act on its workspace lease at this instant only while the guard has not fenced and host monotonic time is before the start of its last successful renewal plus the granted validity. The granted validity is the master expiry less half the clock-skew bound, capped by the configured TTL. The takeover margin (half the skew bound) exceeds the configured fence-exit budget (watch cadence 50 ms + drain timeout 5 s), assuming normal scheduling; blockmaster refuses a smaller or equal margin at startup, deriving the budget from durable.ChunkFenceWatchInterval and volume.WorkspaceDrainTimeout. Safety premise for v1.0, alongside one live process per holder (TERM-ONE-PROCESS-001): blockmaster's host slews its wall clock, not steps it, while volumes are served; a step larger than the configured skew bound while a lease is live is unsupported (see docs/operator-guide.md, Clock safety requirement). This closes coverage gap 8 by a documented premise, not a wall-step test. |
WorkspaceLease ExpiresAtNS, MaxClockSkewNS, and the lease view's durable horizon and granted deadline (core/authority/workspace_lease_view.go); WorkspaceLeaseFact valid_for_ns, expires_at_ns, revoking (core/rpc/proto/workspace.proto); WorkspaceLeaseGuard until, fenced (core/host/volume/workspace_lease.go) |
Holder: core/host/volume/workspace_lease.go WorkspaceLeaseGuard.permits. Master: core/authority/workspace_lease_view.go Publisher.WorkspaceLeaseValidity / workspaceLeaseValidityAt is shared by renewal admission, leaseFact and AckWorkspaceRevocation. WorkspaceLeaseValidity reads the publisher clock; its leaf calculation uses the larger configured/persisted skew and configured TTL. Publisher.RenewWorkspaceLease. firstWorkspaceGrant and regrantWorkspaceLease are reached only from it, and only it starts the extender extendWorkspaceLease. |
WorkspaceLeaseGuard.drain checks now < until again inline before the ACK, and WorkspaceLeaseGuard.Refresh repeats the expiry check of permits: open (both should call one predicate). The host reply sanity bound in Refresh still repeats the publisher's default 30 s TTL: open. Not a duplicate: Publisher.forcedMoveBarrierLocked decides the opposite term, "the lease is over for the master" (the horizon and the deadline each plus the full skew bound), which a forced move and a re-grant need. Follow-up for 1.0.1: split workspaceNow into wall and monotonic sources so the barrier for in-memory lines uses monotonic time, and add a real independent wall-step test. No new clock seam is added in v1.0. |
authority (grant); volume host (guard) |
TERM-SERVING-001 Serving / ready |
A workspace primary claims HEAD, listens, reports ready and admits I/O only while its lease guard permits now and its durable backend is operational. Without a granted lease it holds at the gate and exits 75 when the startup wait runs out (INV-WS-MASTER-WAIT-001). |
frontend.Projection.Healthy; the StorageBackend operational flag and its evidence, reported as VolumeStatus.Operational (core/frontend/durable); StatusProjection.FrontendPrimaryReady (and NotReadyReason, on #410); the ALUA and ANA state; HeartbeatSlot.frontends |
Authority side: core/host/volume/projection_bridge.go AdapterProjectionView.projectionWithSupersede, which ANDs in WorkspaceLeaseGuard.permits for workspace volumes. Storage side: the StorageBackend operational flag (core/frontend/durable/storage_adapter.go), written only by SetOperational and read by readyCheck. The one decision of both sides together is StorageBackend.AdmitsIO (the guarded AND), read by the status, the frontend start gate and every I/O: on #410 (today StorageBackend.gate on main). |
StatusServer.authorityProjection derives FrontendPrimaryReady from the authority view alone, and it repeats the supersede and supporting tests that Healthy already contains. #410 adds the backend half in statusProjection; the repeated tests remain open. The frontends listen whether or not the backend admits I/O: #410 holds them in awaitBackendAdmitsIO until it does. #410 replaces its earlier backendAdmitsIO (which read only VolumeStatus.Operational) with StorageBackend.AdmitsIO. A later lease fence ends the process on #409. projectionALUAProvider.ALUAState and projectionANAProvider.ANAState (cmd/blockvolume) follow the projection only: open. The start-time wait (chunkAuthorityWait; ProviderConfig.ChunkAssignmentTimeout, 30 s by default) ends once, and the process then stays up without serving: #409 makes it exit 75. iSCSI reports a not-ready or busy backend as a medium error, while NVMe retries the same error: #415 (frontend.ClassifyBackendError). The heartbeat Frontends are set when the listeners start and cleared only at shutdown: open. |
volume host |
TERM-STOP-SUPERSEDED-001 Superseded |
A newer published line for this volume names another holder (another replica, or the same replica on another server) at or above this process's epoch and endpoint version. From then on the process is not healthy. | Host.lastOther (an AssignmentFact); the process's own epoch and endpoint version |
Volume: core/host/volume/host.go Host.IsSuperseded. Its same-replica branch, and the ordered recordOtherLine it reads, are on #411. |
The status repeat listed under TERM-SERVING-001. Host.IsCurrentReplicaSuperseded (on #409) and Host.promotionReady call IsSuperseded with other lineages. They are wrappers, not second derivations. |
volume host |
TERM-STOP-LEASE-FENCED-001 Lease fenced / revoked |
The lease guard has latched: its deadline passed, a reply was invalid or late, the lease is revoking, or the process is stopping. A fenced guard never reopens. The host drains, and only when the lease was revoked does it acknowledge with the HEAD generation. | WorkspaceLeaseGuard fenced, cause, revoked (core/host/volume/workspace_lease.go) |
Volume: core/host/volume/workspace_lease.go WorkspaceLeaseGuard.fenceLocked, the one writer of fenced; it is read through permits. |
Host.FenceWorkspaceLease and runWorkspaceLease (core/host/volume/workspace_runtime.go) set fenced directly, with no cause, and keep a second latch, Host.workspaceLeaseFenced: open. On main a guard fence ends the process with status 0: #409 makes it exit 75. |
volume host |
TERM-STOP-HEAD-FENCED-001 HEAD fenced |
HEAD shows a higher epoch, or another holder at this epoch. The chunk layer latches fenced and publishes nothing more, and the backend refuses I/O as stale. | HEAD Epoch, Holder, Gen; chunkLayerImpl fenced (core/storage) |
Volume: core/storage/chunk_layer.go chunkLayerImpl.supersededBy. |
ClaimChunkHead (core/storage/chunk_restore.go) repeats the comparison inline: open. Four cut and detach paths in chunk_layer.go set fenced directly, next to the setter fencePublication: open (one setter). A HEAD fence after startup ends the process with 78 (head_fenced): on #410. A refused startup claim exits with 78: on #409. |
chunk layer |
TERM-STOP-STALE-ROOT-001 Stale local root |
An existing local root whose HEAD another holder has published, or whose local durable LSN is below HEAD's remote_lsn, is refused before the claim and never served. A rolled-back copy exits 78; a foreign holder below the assignment's epoch stays up without serving. |
HEAD Holder, RemoteLSN; ProviderConfig.ChunkHolder; the store's durable LSN (WALStore.Boundaries) |
Volume: the PrepareRestore check inside DurableProvider.newChunkLayer (core/frontend/durable/provider_chunk.go). It is not a named function: open. |
A copy of the root taken after its last cut has HEAD's LSN and passes: no local check sees it (never restore a root from a copy). | volume host |
TERM-STOP-SEALED-001 Sealed |
B HEAD is detached by this holder at this epoch and claim id. The sealing process never reopens it, and only that proof licenses a clean move. | B HEAD State, Gen, Epoch, Holder, ClaimID |
Volume: core/frontend/durable/provider_seal_replay.go readLayoutSeal. Master: the B HEAD reader checks the detached claim before admitting a clean move. |
Revocation ACK reads the same B HEAD through workspaceLayoutDetachedGeneration (cmd/blockvolume/workspace_lease.go); TestWorkspaceLayoutDetachedProof checks assigned epoch/holder/claim, fresh proof and read errors without a write. |
volume host; authority (master side) |
TERM-STOP-EXIT-001 Exit class of a stopped workspace primary |
A workspace primary that stops ends its process with one latched class. 75 means retry (start-time wait exhausted, lease fence, unconfirmed ACK). 78 means superseded (the line names another holder, or the master refused the lease as moved or deleted). 0 is used only after an ACKed revocation or a signal. | workspaceExit code, reason; the processExit decision (cmd/blockvolume/process_exit.go, on #409) |
Volume: cmd/blockvolume/process_exit.go workspaceRetryOutcome, on #409. processExit.choose latches the first outcome. |
chooseChunkStartupExit (on #409) turns 75 into 78 on a refused HEAD claim (DurableProvider.ChunkStartupSuperseded), outside workspaceRetryOutcome: open. On #409 alone, "superseded" means another replica; the same replica on another server counts only with #411's IsSuperseded: open until both merge. |
volume host |
TERM-ONE-PROCESS-001 One live process per volume per host |
At most one blockvolume process serves a volume on one host: each holds /run/sw-block/locks/<volume id>.lock from before its store opens, whatever its --durable-root. Across hosts the assignment and the workspace lease keep holders apart. |
The host lock file (durable.HostVolumeLockDir, deploy/systemd/sw-block.tmpfiles.conf); the store file <--durable-root>/<volume id>.bin (cmd/blockvolume/main.go durableCreateGeometry); their exclusive OS file locks; the HEAD Holder |
Volume: core/frontend/durable/provider.go DurableProvider.lockVolumeOnHost (on #439; ProviderConfig.HostVolumeLock, set by blockvolume; a missing directory refuses the provider), taken in ensureHandle before the store opens and released after it closes. core/storage/volume_lock.go LockWALStoreFile: an exclusive, non-blocking flock in volume_lock_unix.go and an exclusive, fail-immediately LockFileEx in volume_lock_windows.go. It is taken by v3 create and open and by the read-only open. |
Not a second derivation but the locks' limit: they cover one host. A second process is not refused when it runs on another host with the same server id, in a container without the host's /run/sw-block/locks (the Kubernetes renderer does not mount it: open), or on a copied root on another host. Two such processes with one holder string both pass ClaimChunkHead and both renew. A failed CAS against the other process's same-epoch, same-holder HEAD is treated as a conflict, not a fence (publicationOwnerChanged): open. #416 refuses a server id that heartbeats from another host's address (refuseServerIDFromOtherHost), which covers part of this. The master's grants carry no per-process identity: open. |
storage engine |
Notes:
TERM-SERVING-001andTERM-STOP-*: in this release a workspace primary that can no longer serve should stop, not linger. TodayTERM-STOP-HEAD-FENCED-001andTERM-STOP-STALE-ROOT-001leave the process up and its lease renewing. A forced move then waits for that lease. The open entries in those rows track this.TERM-HOLDER-001: supporting replicas (RF greater than 1) are not holders, and their replica-keyed checks (AdapterProjectionView.supportingReplicaReady) are outside this row.
Recovery progress observer lock order
Storage recovery barriers precede the promotion watchdog mutex. The synchronous
completed-work observer may take that mutex under capture, lifecycle, sync,
store and descriptor locks; watchdog-locked methods may call no storage, wait,
or unreviewed callback. TestRecoveryWatchdogLockedMethodsNeverCallStorageOrWait
pins the seven locked methods, their calls and blocking syntax;
TestRecoveryWatchdogClockBindingIsTimeNow pins the production clock binding. Time affects only an unhealthy
readiness observation: the observer authorizes no Serving, lease or HEAD write.
The recovery clock consumes a fixed-order (phase, done) frontier: validated open-map entries (including binding revalidation), initial map copy,
scan, span construction, sort comparisons, frontier calculation, trusted-record
projection, recovery decision, install replay/retention, map copy, retained
replay, reclaim indexing, attach. Counts are cumulative within each phase across
same-process retries; a repeated or earlier frontier is not progress. Late
progress cannot clear an already elapsed inactivity window. The existing
same-epoch promotion-ready fact alone clears the timeout latch. C.L's start
rows remain STUB until recovery and attach controls are qualified together.