diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index aa90753dcb..a9eb9eb8be 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -275,6 +275,10 @@ HEAD states, snapshots, forks, intents, key bindings, GC and volume delete in th | `deleting` | `purging` | commit point, bound to the same delete incarnation | `core/frontend/chunkstore/volume_delete.go` `commitHeadPurging` | `INV-VOLDEL-COMMIT-001` | | `purging` | `deleted` | chunks dropped and `VOLUME` marked deleted | `core/frontend/chunkstore/volume_delete.go` `finishHeadDeleted`, `markVolumeDeleted` | `INV-VOL-ID-NO-REUSE-001` | | `deleting`, `purging`, `deleted` | — | no claim or cut moves HEAD; only the delete's own transitions | `core/frontend/chunkstore/chunk_remote.go` `CASHead` | `INV-HEAD-DELETE-FROZEN-001` | +| `INV-VERIFY-READONLY-001` | Verify writes nothing to the filer or the blob store at any depth: no intent, mark, tombstone, binding or needle. | M6 (reader; no transition) | `core/frontend/chunkstore/verify.go` `Catalog.Verify` | `TestVerify_ReadOnlyAtEveryDepth` (`core/frontend/chunkstore/verify_test.go`) | — | ACTIVE | +| `INV-VERIFY-RECHECK-001` | Verify reports a miss only if its root still names the chunk when it is rechecked: a miss under HEAD is a finding only if the current HEAD still names the key at that index, and a miss under a snapshot only if that attempt is still published and not deleting. A reader that can outlive GC's grace holds no claim, so it rechecks its root. | M6 (reader beside GC mark) | `core/frontend/chunkstore/verify.go` `Catalog.Verify` | `TestVerify_SupersededDuringPass`, `TestVerify_SnapshotDeletedDuringPass`, `TestVerify_SharedChunkReportedUnderStillNamingRoot` (`core/frontend/chunkstore/verify_test.go`) | — | ACTIVE | +| `INV-VERIFY-NOTFOUND-001` | Verify reports `NEEDLE_MISSING` only when the blob store answers that the needle does not exist; any other read failure is retried and then reported as `READ_ERROR`, which means not verified. | M6 (reader) | `core/frontend/chunkstore/verify.go` `Catalog.Verify`; `core/frontend/chunkstore/swfs.go` `Get` (`ErrBlobNotFound`) | `TestVerify_PersistentReadErrorIsNotAMissingNeedle`, `TestVerify_TransientReadIsRetried`, `TestSWFS_GetNotFoundIsErrBlobNotFound` (`core/frontend/chunkstore/verify_test.go`) | — | ACTIVE | +| `INV-CHUNK-CLI-SINGLE-FILER-001` | Every `sw-block ops chunk` command, gc included, runs the single-filer check of `INV-WS-SINGLE-FILER-001` before its first catalog read or write, and refuses otherwise. | M4 (startup) → Refused, for the offline commands | `cmd/sw-block/chunk.go` `dialChunkFiler`; `cmd/sw-block/chunk_gc.go` `chunkGC` | `TestOpsChunk_RefusesMultiFiler` (`cmd/sw-block/chunk_verify_test.go`) | — | ACTIVE | | — | `aborted` | a GC copy sweep settles a dead fork by an exclusive create of an aborted HEAD tombstone, so the fork can never publish | `core/frontend/chunkstore/catalog.go` `AbortFork`; `core/frontend/chunkstore/gc_copy.go` `SweepCopies` | — | **Snapshots and forks.**