feat(storage,recovery): v3 gated Sync and the receiver's install-log ack (row 10a)

DESIGN r17.4 section 7 (O1-a), dark:

- While installing, the v3 logical Sync returns exactly (0,
  ErrBaseInstalling): no batch, no new W; the gate is rechecked at the
  completion under the leader role.
- SyncInstallLog(installID) on the narrow InstallLogSyncer (not on
  LogicalStorage): under installMu shared it refuses outside an install
  (ErrNotInstalling) or for another ID (ErrInstallIDMismatch), freezes the
  cut H, fsyncs the WAL and publishes W = max(W, H) with BaseState still
  installing, always mode A. A v2 store's SyncInstallLog is its Sync.
- The receiver's sendAck uses it until the session's own BaseDone, then
  the ordinary Sync (the WAL lane can outlive BaseDone, r17.4).

Controls: the gate, the refusals, mode A on a lagged store with a crash,
the receiver's progress ack (tagged), and the receiver-only boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-17 13:00:03 -08:00
1 parent 09d1663f13
commit 66be344b54
7 files changed
+316 -8

No files matched your search

@@ -0,0 +1,53 @@
package recovery
import (
"os"
"path/filepath"
"reflect"
"strings"
"testing"
"github.com/seaweedfs/seaweed-block/core/storage"
)
// DESIGN 7 and section 11 item 6 (plan row 10a): the install-log ack is not
// callable from the frontend. LogicalStorage has no SyncInstallLog, and no
// package outside core/storage (which defines it) and core/recovery (the
// receiver) names InstallLogSyncer. Mutant: adding SyncInstallLog to
// LogicalStorage, or using the interface elsewhere, fails here.
func TestInstallLogSyncerIsReceiverOnly(t *testing.T) {
if _, ok := reflect.TypeOf((*storage.LogicalStorage)(nil)).Elem().MethodByName("SyncInstallLog"); ok {
t.Fatal("LogicalStorage exposes SyncInstallLog to every caller")
}
root := filepath.Join("..", "..")
err := filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() && (d.Name() == ".git" || d.Name() == "vendor") {
return filepath.SkipDir
}
if d.IsDir() || !strings.HasSuffix(path, ".go") {
return nil
}
rel, err := filepath.Rel(root, path)
if err != nil {
return err
}
rel = filepath.ToSlash(rel)
if dir := filepath.ToSlash(filepath.Dir(rel)); dir == "core/storage" || dir == "core/recovery" {
return nil // the defining package and the receiver
}
b, err := os.ReadFile(path)
if err != nil {
return err
}
if strings.Contains(string(b), "InstallLogSyncer") {
t.Errorf("%s names InstallLogSyncer outside core/storage and core/recovery", rel)
}
return nil
})
if err != nil {
t.Fatal(err)
}
}
+14 -2
View File
@@ -50,7 +50,8 @@ type Receiver struct {
cadenceT time.Duration
blocksSinceLastAck uint32
lastAckTime time.Time
baseInstalledUpper uint32 // highest base LBA installed; advisory only in BaseBatchAck
baseInstalledUpper uint32 // highest base LBA installed; advisory only in BaseBatchAck
installID [16]byte // this session's BASE install ID (DESIGN 7, 8.7)
gate DualLaneGate // nil only in tests that exercise the protocol alone
epoch uint64 // from SessionStart; checked by gate on every mutating frame
@@ -366,6 +367,7 @@ func (r *Receiver) beginInstall(baseLSN uint64) (storage.InstallHandle, error) {
if err != nil {
return nil, fmt.Errorf("begin BASE install: %w", err)
}
r.installID = id
return h, nil
}
@@ -413,7 +415,17 @@ func (r *Receiver) sendAck() error {
errors.New("sendAck before SessionStart"))
}
st := r.session.Status()
syncedLSN, err := r.store.Sync()
// While installing, the durable claim is the install log's
// (SyncInstallLog, DESIGN 7); the logical Sync is gated there. After this
// session's own completion the logical Sync is ordinary again (8.7 done
// path), and the WAL lane may still be sending.
var syncedLSN uint64
var err error
if syncer, ok := r.store.(storage.InstallLogSyncer); ok && !st.BaseDone {
syncedLSN, err = syncer.SyncInstallLog(r.installID)
} else {
syncedLSN, err = r.store.Sync()
}
if err != nil {
return newFailure(FailureSubstrate, PhaseRecvAckWrite, err)
}
@@ -50,6 +50,7 @@ func v3Blk(b byte) []byte { return bytes.Repeat([]byte{b}, v3RecvBlock) }
type v3Peer struct {
conn net.Conn
frames chan frameType
acks chan uint64 // AcknowledgedLSN of every BaseBatchAck, in order
done chan error
}
@@ -57,16 +58,21 @@ func startV3Receiver(t *testing.T, store storage.LogicalStorage) *v3Peer {
t.Helper()
primary, replica := net.Pipe()
t.Cleanup(func() { primary.Close(); replica.Close() })
p := &v3Peer{conn: primary, frames: make(chan frameType, 64), done: make(chan error, 1)}
p := &v3Peer{conn: primary, frames: make(chan frameType, 64), acks: make(chan uint64, 64), done: make(chan error, 1)}
r := NewReceiverWithCadence(store, replica, 1, time.Hour) // an ack after every BASE block
go func() { _, err := r.Run(); p.done <- err; replica.Close() }()
go func() {
for {
ft, _, err := readFrame(primary)
ft, payload, err := readFrame(primary)
if err != nil {
close(p.frames)
return
}
if ft == frameBaseBatchAck {
if a, err := decodeBaseBatchAck(payload); err == nil {
p.acks <- a.AcknowledgedLSN
}
}
p.frames <- ft
}
}()
@@ -207,15 +213,32 @@ func TestReceiverV3HeldOldBaseWriteDrainsBeforeANewSession(t *testing.T) {
case <-time.After(300 * time.Millisecond):
}
release()
a.want(t, frameBaseBatchAck)
// A's write finishes; its progress ack (SyncInstallLog, row 10) either
// runs before B's begin, or queues behind B's exclusive begin and fails
// with ErrInstallIDMismatch. Either way A cannot write again.
aAcked := false
select {
case ft, ok := <-a.frames:
if !ok || ft != frameBaseBatchAck {
if err := a.runErr(t); !errors.Is(err, storage.ErrInstallIDMismatch) {
t.Fatalf("A's ack after the drain: %v, want ErrInstallIDMismatch", err)
}
} else {
aAcked = true
}
case <-time.After(10 * time.Second):
t.Fatal("A neither acked nor ended")
}
<-bSent
b.want(t, frameBaseBatchAck)
if got := readV3Recv(t, s, 7); !bytes.Equal(got, v3Blk(0xBB)) {
t.Fatalf("LBA 7 = %x..., want B's bytes", got[0])
}
a.send(t, frameBaseBlock, encodeBaseBlock(7, v3Blk(0xAA)))
if err := a.runErr(t); !errors.Is(err, storage.ErrInstallSuperseded) {
t.Fatalf("A after the supersession: %v, want ErrInstallSuperseded", err)
if aAcked {
a.send(t, frameBaseBlock, encodeBaseBlock(7, v3Blk(0xAA)))
if err := a.runErr(t); !errors.Is(err, storage.ErrInstallSuperseded) {
t.Fatalf("A after the supersession: %v, want ErrInstallSuperseded", err)
}
}
if got := readV3Recv(t, s, 7); !bytes.Equal(got, v3Blk(0xBB)) {
t.Fatalf("LBA 7 = %x... after A's stale frame, want B's bytes", got[0])
@@ -344,3 +367,29 @@ func TestReceiverV3WALAfterBaseDoneSurvivesACrash(t *testing.T) {
}
}
}
// Row 10a: a progress ack during the install is the install log's durable
// claim (SyncInstallLog, DESIGN 7): it reports min(WALApplied, H) and the
// slot carries W = H with the volume still installing; the logical Sync
// stays gated. Mutant: sendAck through the gated logical Sync fails the
// session at its first ack.
func TestReceiverV3ProgressAckIsTheInstallLog(t *testing.T) {
s := v3RecvStore(t)
p := startV3Receiver(t, s)
p.start(t, 5)
p.send(t, frameBaseBlock, encodeBaseBlock(3, v3Blk(0x33)))
p.want(t, frameBaseBatchAck)
p.send(t, frameWALEntry, encodeWALEntry(WALKindBacklog, 4, 6, v3Blk(0x44)))
p.send(t, frameBaseBlock, encodeBaseBlock(2, v3Blk(0x22)))
p.want(t, frameBaseBatchAck)
<-p.acks // the first ack, before the WAL entry
if got := <-p.acks; got != 6 {
t.Fatalf("progress ack AcknowledgedLSN %d, want 6", got)
}
if st, _ := storage.BaseStateV3Test(s); st != storage.BaseInstalling {
t.Fatalf("state %d after a progress ack, want installing", st)
}
if f, err := s.Sync(); f != 0 || !errors.Is(err, storage.ErrBaseInstalling) {
t.Fatalf("logical Sync during the install = (%d, %v), want (0, ErrBaseInstalling)", f, err)
}
}
@@ -0,0 +1,92 @@
package storage
import (
"errors"
"fmt"
)
// Acknowledgement while installing (format bump v3, DESIGN r17.4 section 7;
// plan row 10). Dark: only tests build a v3 store.
var (
// ErrBaseInstalling: the logical Sync is gated while BaseState =
// installing. It is always returned with frontier 0 (DESIGN 7).
ErrBaseInstalling = errors.New("storage: v3 BASE install in progress; not ready")
// ErrNotInstalling: SyncInstallLog outside an install.
ErrNotInstalling = errors.New("storage: v3 install-log sync outside a BASE install")
// ErrInstallIDMismatch: SyncInstallLog for an ID that is not installing.
ErrInstallIDMismatch = errors.New("storage: v3 install-log sync for another install ID")
)
// InstallLogSyncer is the rebuild receiver's install-log durability ack
// (DESIGN 7, O1-a). It is deliberately not on LogicalStorage: only
// core/recovery type-asserts it.
type InstallLogSyncer interface {
SyncInstallLog(installID [16]byte) (uint64, error)
}
var _ InstallLogSyncer = (*WALStore)(nil)
// SyncInstallLog makes the install lane durable and acknowledges it while
// installing (DESIGN 7). It revalidates the ID under installMu shared,
// freezes the cut H (every LSN pwritten so far), fsyncs the WAL and then
// publishes W = max(W, H) with BaseState still installing: always mode A,
// whatever the volume's WMode. It attests log durability only, never a
// readable image, and never changes BaseState. A v2 store keeps its
// pre-v3 behaviour: the receiver's ack is its ordinary Sync.
func (s *WALStore) SyncInstallLog(installID [16]byte) (uint64, error) {
v := s.v3
if v == nil {
return s.Sync()
}
v.installMu.RLock()
defer v.installMu.RUnlock()
s.lifecycleMu.RLock()
defer s.lifecycleMu.RUnlock()
if err := installLogTargetV3(v.pub.current(), installID); err != nil {
return 0, err
}
v.syncMu.Lock() // the leader role: no committer batch or recovery meanwhile
defer v.syncMu.Unlock()
s.mu.Lock()
if s.closed {
s.mu.Unlock()
return 0, errors.New("storage: SyncInstallLog after Close")
}
if err := s.stickyIOFault(); err != nil {
s.mu.Unlock()
return 0, err
}
H := v.appended.Load()
s.mu.Unlock()
// Mode A: the WAL fsync precedes the slot publication.
if err := s.syncFile(nil, s.fd.Sync); err != nil {
return 0, fmt.Errorf("storage: install-log fsync: %w", err)
}
if _, err := v.pub.publish(&s.mu, nil, func(n *descriptorV3) error {
if err := installLogTargetV3(*n, installID); err != nil {
return err
}
n.W = max(n.W, H)
return nil
}); err != nil {
return 0, err
}
if H > v.wack.Load() {
v.wack.Store(H)
}
s.mu.Lock()
s.syncedLSN = max(s.syncedLSN, H)
s.mu.Unlock()
return H, nil
}
func installLogTargetV3(d descriptorV3, installID [16]byte) error {
if d.BaseState != BaseInstalling {
return ErrNotInstalling
}
if d.BaseInstallID != installID {
return ErrInstallIDMismatch
}
return nil
}
@@ -0,0 +1,92 @@
package storage
import (
"errors"
"testing"
)
// Plan row 10a controls (DESIGN r17.4 section 7; owner claude03): the gated
// logical Sync and the receiver-only install-log ack.
// While installing, Sync returns exactly (0, ErrBaseInstalling) and writes
// no slot; after complete it acknowledges again. Mutant: an ungated Sync
// acknowledges the install lane through the frontend path and fails here.
func TestInstallLogV3SyncIsGatedWhileInstalling(t *testing.T) {
s, _ := newStoreV3(t, WModeStrict)
t.Cleanup(func() { crashRecoveryHardeningStore(t, s) })
writeSynced(t, s, 1, 1)
h := beginV3(t, s, 1, idA)
if err := h.ApplyInstallEntry(2, blk(2), 2); err != nil {
t.Fatal(err)
}
writes := countSlotWritesV3(s)
if f, err := s.Sync(); f != 0 || !errors.Is(err, ErrBaseInstalling) {
t.Fatalf("Sync while installing = (%d, %v), want (0, ErrBaseInstalling)", f, err)
}
if writes.Load() != 0 || s.v3.pub.current().W != 1 {
t.Fatalf("gated Sync wrote %d slots, W %d", writes.Load(), s.v3.pub.current().W)
}
s.v3.testBeforeSlotWrite = nil
if err := h.MarkBaseComplete(); err != nil {
t.Fatal(err)
}
if f, err := s.Sync(); err != nil || f < 2 {
t.Fatalf("Sync after complete = (%d, %v), want >= 2", f, err)
}
}
// SyncInstallLog refuses outside an install and for another ID, writing
// nothing. Mutant: dropping the ID check acknowledges another install.
func TestInstallLogV3Refusals(t *testing.T) {
s, _ := newStoreV3(t, WModeStrict)
t.Cleanup(func() { crashRecoveryHardeningStore(t, s) })
writes := countSlotWritesV3(s)
if _, err := s.SyncInstallLog(idA); !errors.Is(err, ErrNotInstalling) {
t.Fatalf("outside an install: err = %v, want ErrNotInstalling", err)
}
s.v3.testBeforeSlotWrite = nil
beginV3(t, s, 0, idA)
writes = countSlotWritesV3(s)
if _, err := s.SyncInstallLog(idB); !errors.Is(err, ErrInstallIDMismatch) {
t.Fatalf("another ID: err = %v, want ErrInstallIDMismatch", err)
}
if writes.Load() != 0 {
t.Fatal("a refused install-log sync wrote a slot")
}
}
// The ack is mode A whatever the WMode: on a lagged (mode C) store the slot
// carries W = H as soon as SyncInstallLog returns, with BaseState still
// installing, and a crash keeps that W and the install. Mutant: the ack
// without its publication (the lagged mode's deferred W) fails here.
func TestInstallLogV3IsModeAAndSurvivesACrash(t *testing.T) {
s, path := newStoreV3(t, WModeLagged)
h := beginV3(t, s, 0, idA)
for lsn := uint64(1); lsn <= 3; lsn++ {
if err := h.ApplyInstallEntry(uint32(lsn), blk(byte(lsn)), lsn); err != nil {
t.Fatal(err)
}
}
H, err := s.SyncInstallLog(idA)
if err != nil || H != 3 {
t.Fatalf("SyncInstallLog = (%d, %v), want 3", H, err)
}
crashRecoveryHardeningStore(t, s)
a, b := slotsV3(t, path)
newest := a
if b.SlotGen > a.SlotGen {
newest = b
}
if newest.W != 3 || newest.BaseState != BaseInstalling || newest.BaseInstallID != idA {
t.Fatalf("newest slot after the ack: W %d state %d, want W 3 installing under A", newest.W, newest.BaseState)
}
r, err := openUnmappedWALStoreV3ForTest(path)
if err != nil {
t.Fatal(err)
}
r.DisableAutoFlushForRecoveryTest()
t.Cleanup(func() { crashRecoveryHardeningStore(t, r) })
if _, err := r.Recover(); !errors.Is(err, ErrBaseIncomplete) || errors.Is(err, ErrInstallSuffixDamaged) {
t.Fatalf("reopen: err = %v, want an intact ErrBaseIncomplete", err)
}
}
+9
View File
@@ -1080,6 +1080,12 @@ func (s *WALStore) Sync() (uint64, error) {
targetDirectFrontier := s.pendingDirectFrontierLSN
var targetGen uint64
if s.v3 != nil {
// The logical Sync is gated while installing (DESIGN 7): exactly
// (0, ErrBaseInstalling), no batch, no new W.
if s.v3.pub.current().BaseState == BaseInstalling {
s.mu.RUnlock()
return 0, ErrBaseInstalling
}
targetGen = s.v3.recoverGen.Load() // captured with targetHead (Recover holds s.mu)
}
s.mu.RUnlock()
@@ -1107,6 +1113,9 @@ func (s *WALStore) Sync() (uint64, error) {
if v.recoverGen.Load() != targetGen {
return 0, errV3RecoveredMeanwhile
}
if v.pub.current().BaseState == BaseInstalling {
return 0, ErrBaseInstalling // an install began meanwhile
}
}
s.mu.Lock()
// A fault latched while this Sync waited (another caller's fsync or
+1
View File
@@ -290,6 +290,7 @@ The "Machine / transition" column refers to Part A. Notes under a table record w
| `INV-WAL-V3-FENCE-001` | Before any append after a v3 recovery, the store zeroes exactly the logical WAL interval [E, floor+WALSize) (floor = both slots' same-nonce reuse floor) split at the physical wrap, fsyncs it through the leaf, then publishes retainedHead = E; no byte before E or outside the interval changes, so records dropped by one recovery never resurface after a second crash. | M1 Recovering → Serving (v3) | `core/storage/walstore_v3.go` `WALStore.fenceV3`, `recoverV3`; `core/storage/recovery_v3.go` `fenceRangesV3` | `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestWALStoreV3NoFenceResurrectsInBothModes`, `TestWALStoreV3FenceTouchesNoByteBeforeTheHead`, `TestWALStoreV3RecoversAHistoryEndingAtTheLastRepresentableCursor` (`core/storage/walstore_v3_test.go`); `TestRecoveryV3FenceRangesAreExact` (`core/storage/recovery_v3_test.go`) | `WALFormat` `NoResurrection` (claude05) | STUB |
| `INV-WAL-V3-RESET-001` | A v3 nonce/position reset is refused, writing nothing, unless the dirty map is empty (no entry names an old-incarnation WAL position) and every appended LSN is checkpointed (CheckpointLSN >= appended, hence = acknowledged W). It publishes the new nonce with an empty cursor space into one slot and then the other, and is successful only after both. A crash between the two opens the new incarnation; no reuse floor exists across the two nonces, and no writer binds until Recover's head publication completes the other slot. LSNs, W and the map root are unchanged. A read holds no lock across its WAL read; it validates the whole record it read (CRC, footer, type, LBA, LSN) against the resolving dirty entry and re-resolves on a mismatch, so a position reused by the new incarnation never serves another block (LSN allocation runs on across a reset; no nonce is checked). It reports WAL damage only for an unchanged entry with the same recovery generation before and after the attempt (bumped at the start and the end of every recovery and reset); a failed pread is substrate I/O. | M1 Serving → Serving (reset, dark) | `core/storage/reset_v3.go` `WALStore.resetIncarnationV3`, `descriptorPublisherV3.resetIncarnationV3`, `halfResetV3`; `core/storage/descriptor_v3.go` `mergeDescriptorV3Mode`; `core/storage/walstore_v3.go` open and `recoverV3` | `TestResetV3RefusesWhileUncheckpointed`, `TestResetV3RefusesTheCurrentOrAZeroNonce`, `TestResetV3RetainedButCheckpointedBytesDoNotBlock`, `TestResetV3PublishesBothSlotsAndOnlyThenHasAFloor`, `TestResetV3CrashOutcomes`, `TestResetV3OrdinaryPublicationsCannotChangeTheNonce` (`core/storage/reset_v3_test.go`); `TestWALStoreV3ResetRefusesUncheckpointedOrUnacknowledgedData`, `TestWALStoreV3ResetPublishesBothSlotsAndWritesRecoverAcrossACrash`, `TestWALStoreV3ResetCrashOutcomes`, `TestWALStoreV3HalfResetRefusesWritesUntilRecover`, `TestWALStoreV3ReadParkedAcrossAResetAndOverwriteReturnsItsOwnBlock`, `TestWALStoreV3ReadMissRecheckParkedAcrossAResetReturnsItsOwnBlock`, `TestWALStoreV3ReadOfADamagedLiveRecordIsAnIntegrityFault`, `TestWALStoreV3ReadAcrossARecoveryThatReusesTheSamePositionAndLSNIsNotDamage`, `TestWALStoreV3ReadIOErrorsAreSubstrateIONotWALIntegrity`, `TestWALStoreV3ReadAdmittedBetweenRecoverBumpAndClearIsNotDamage` (`core/storage/reset_store_v3_test.go`) | `WALFormat` reset (claude05 r4.5, pending) | STUB |
| `INV-WAL-V3-BASE-001` | A v3 BASE install begins only under `installMu` exclusive (draining the old ID's admitted mutations) and only when BaseLSN covers the acknowledged W (published or not yet), the checkpoint and every appended LSN (an unacknowledged record above BaseLSN would leave a hole behind BaseCursor; codex01 row 9a P1-1); otherwise it is refused, writing nothing, with `ErrInstallBaseUncovered` or `ErrInstallSupersedeUncovered`. It publishes installing (BaseLSN, BaseCursor = the writer head P, the ID) into both slots before the first BASE mutation. BASE extent writes and install-lane applies go only through the handle, under `installMu` shared: a handle lives until the next begin (an install epoch), `WriteBase` needs installing under its ID, and an install-lane apply is also admitted after the handle's own completion while installed or retired, because the session's WAL lane can outlive its BaseDone (DESIGN r17.4; `ErrInstallSuperseded` otherwise); the install lane keeps the order and gap rules. Complete validates the ID under `installMu` exclusive, fsyncs the BASE bytes and the suffix, runs the checkpoint's metadata and chunk barriers and publishes installed with retainedTail >= BaseCursor together with a fresh owned-map candidate carrying the BASE writes' UNKNOWN (codex01 row 9a P1-2) and stops serving the superseded pre-BASE records. installing -> none is refused (no abort); installed -> none retires only once the checkpoint covers BaseLSN and both slots carry a tail at or past BaseCursor. | M1 Serving → Installing → Serving (dark) | `core/storage/base_install_v3.go` `WALStore.beginBaseInstallV3`, `installHandleV3.WriteBase`, `installHandleV3.ApplyInstallEntry`, `WALStore.markBaseCompleteV3`; `core/storage/descriptor_v3.go` `baseTransitionAllowedV3`, `retireBaseV3` | `TestBaseInstallV3BeginPublishesInstallingIntoBothSlots`, `TestBaseInstallV3BeginRefusesBelowW`, `TestBaseInstallV3BeginCoversTheAcknowledgedNotYetPublishedW`, `TestBaseInstallV3BeginRefusals`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash`, `TestBaseInstallV3InstallingToNoneIsRefused`, `TestBaseInstallV3RetiresOnlyOnceTheCheckpointCoversBaseLSN`, `TestBaseInstallV3ApplyInstallEntryOrderAndGap`, `TestBaseInstallV3HeldOldWriteDrainsBeforeANewBegin`, `TestBaseInstallV3ParkedOldFrameIsRefusedAfterASupersession`, `TestBaseInstallV3BeginRefusesBelowTheHighestAppendedLSN`, `TestBaseInstallV3CompletePersistsTheMapUnknownOfBaseWrites`, `TestBaseInstallV3BeginRefusesWithAnAttachedChunkLayer`, `TestBaseInstallV3CompletedHandleAppliesUntilTheNextBegin` (`core/storage/base_install_v3_test.go`); `TestDescriptorV3BaseTransitionTable`; tagged `swblock_format_v3_test`: `TestReceiverV3InstallThroughTheHandle`, `TestReceiverV3HeldOldBaseWriteDrainsBeforeANewSession`, `TestReceiverV3ParkedOldFrameIsRefusedAfterANewSession`, `TestReceiverV3SupersededBaseDoneFailsWithoutAnAck`, `TestReceiverV3WALAfterBaseDoneStillApplies`, `TestReceiverV3WALAfterBaseDoneSurvivesACrash` (`core/recovery/receiver_install_format_v3_test.go`) | `WALFormat` handle and BASE configs (claude05 R17c, pending) | STUB |
| `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, rechecked at its completion. The receiver's durable progress ack is `SyncInstallLog(installID)` on the narrow `InstallLogSyncer` (not on `LogicalStorage`; named only by `core/storage` and `core/recovery`): under `installMu` shared it refuses outside an install (`ErrNotInstalling`) or for another ID (`ErrInstallIDMismatch`), freezes H, fsyncs the WAL and publishes W = max(W, H) with BaseState still installing, always mode A. It attests log durability only. After the session's own completion the receiver acks through the ordinary `Sync`. A v2 store's `SyncInstallLog` is its `Sync`. | M1 Installing (dark) | `core/storage/install_log_v3.go` `WALStore.SyncInstallLog`; `core/storage/walstore.go` `WALStore.Sync`; `core/recovery/receiver.go` `sendAck` | `TestInstallLogV3SyncIsGatedWhileInstalling`, `TestInstallLogV3Refusals`, `TestInstallLogV3IsModeAAndSurvivesACrash` (`core/storage/install_log_v3_test.go`); `TestInstallLogSyncerIsReceiverOnly` (`core/recovery/install_log_boundary_test.go`); tagged `TestReceiverV3ProgressAckIsTheInstallLog` | `WALFormat` install-log ack (claude05) | 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` | `TestNVMeWriteFUACompletion` (`core/frontend/nvme/fua_test.go`); `TestDispatch_WriteFUASyncsBeforeCompleting` (`core/frontend/ublk/dispatch_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. | 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`); `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 |