From 3987ae0e5225f524a19a3fedcf655dc6fb7fe99f Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 18 Nov 2026 08:14:54 -0800 Subject: [PATCH] test(storage): retain C11 fixture evidence outside production graph --- .../core/storage/legacy_fixture_isolation_test.go | 8 +++++++- seaweed-block/docs/design/invariants.md | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/seaweed-block/core/storage/legacy_fixture_isolation_test.go b/seaweed-block/core/storage/legacy_fixture_isolation_test.go index 6f2778c2d4..71ce5bb712 100644 --- a/seaweed-block/core/storage/legacy_fixture_isolation_test.go +++ b/seaweed-block/core/storage/legacy_fixture_isolation_test.go @@ -40,11 +40,13 @@ func TestLegacyFixtureIsolation(t *testing.T) { defer cancel() cmd := exec.CommandContext(ctx, "go", "list", "-deps", "-json", "./core/storage") cmd.Dir = filepath.Join("..", "..") + cmd.WaitDelay = 2 * time.Second out, err := cmd.Output() if err != nil { t.Fatalf("default production transitive import graph: %v", err) } dec := json.NewDecoder(strings.NewReader(string(out))) + foundStorage := false for dec.More() { var p struct { ImportPath string @@ -57,13 +59,17 @@ func TestLegacyFixtureIsolation(t *testing.T) { t.Errorf("unexpected frozen import %s", p.ImportPath) } if p.ImportPath == "github.com/seaweedfs/seaweed-block/core/storage" { + foundStorage = true for _, n := range p.GoFiles { - if n == "format_v3_test_support.go" { + if n == "format_v3_test_support.go" || n == "legacy_c11_file_fixture_test.go" { t.Fatal("test constructors entered default production import closure") } } } } + if !foundStorage { + t.Fatal("production dependency graph did not contain core/storage") + } } func legacyConstructorReferences(f *ast.File, forbidden map[string]bool) []string { diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 06c30e0774..401f3891d0 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -63,6 +63,8 @@ stateDiagram-v2 | 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` | | any | Closed | `Close`; a store with a latched fault does not write the final superblock | `core/storage/walstore.go` `WALStore.Close` | — | +Production C11 file persistence was removed in row 14b: the durable provider no longer constructs a bitmap sidecar, and the historical file codec exists only in `legacy_c11_file_fixture_test.go`. `INV-CUT-BITMAP-001` retains its explicit legacy engine tests until row 14a; it does not certify the v3 disk format. Native checkpoint/capture coverage is `TestWALStoreV3_AutomaticMapCheckpoint`, `TestChunkLayerV3_CaptureUsesOwnedMapAfterCheckpoint`, and `TestChunkLayer_OwnedMapIncrementalAfterRestart` (checkpointed and WAL-only changes survive reopen without a C11 sidecar). The production map publication/coverage rules remain `INV-WAL-V3-MAP-PUBLISH-001`; no descriptor transition, format or durability boundary changes here. The receiver session bitmap (`INV-RECV-BITMAP-CORE`) 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](format-v3-legacy-test-inventory.md). 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; the offline migration CLI acquires the same lock before any descriptor read or mutation (`INV-WAL-V3-OWNER-001`). Contention refuses open/migration without changing bytes; descriptor close or process exit releases ownership. This implements the existing offline-migration precondition, not a new serving state. 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-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](block-design.md#24-known-issues-and-work-in-progress) and are not ledger rows.