Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start

# Conflicts:
#	core/frontend/chunkstore/head_readers_test.go
#	docs/design/invariants.md
This commit is contained in:
pingqiu committed 2026-11-24 18:45:58 -08:00
commit 7ed69b1635
7 files changed
+174 -36

No files matched your search

@@ -0,0 +1,102 @@
package chunkstore
import (
"go/ast"
"go/parser"
"go/token"
"os"
"path/filepath"
"sort"
"strings"
"testing"
)
// deleteSites is every non-test function in core/ and cmd/ that deletes a
// filer entry (DeleteEntry) or builds a volume directory name (VolumeDir),
// with what it deletes or where the name comes from. Nothing removes a
// deleted HEAD, a VOLUME or a volume directory, and a volume directory is
// named only from a reference (a root's owner name and id) or from the
// master's volume record, never from a name given plus an id read from
// that same directory. A new site fails until it is classified here.
var deleteSites = map[string]string{
"core/frontend/chunkstore/catalog.go Catalog.dropIntent -> DeleteEntry": "an intent entry (old store)",
"core/frontend/chunkstore/catalog.go Catalog.DeleteSnapshot -> DeleteEntry": "a snapshot name entry, conditional on its attempt (old store)",
"core/frontend/chunkstore/chunk_remote.go ChunkRemote.DeleteIntent -> DeleteEntry": "an intent entry (old store)",
"core/frontend/chunkstore/retention.go Catalog.freeName -> DeleteEntry": "a snapshot name entry, conditional on its attempt (old store)",
"core/frontend/chunkstore/swfs.go SWFS.DeleteEntry -> DeleteEntry": "the filer client itself",
"core/frontend/chunkstore/layout/read.go Image.Chunk -> VolumeDir": "a foreign chunk's directory from the reference's owner name and id",
}
func TestDeleteAndDirectorySites_Enumeration(t *testing.T) {
root := filepath.Join("..", "..", "..")
found := map[string]bool{}
for _, top := range []string{"core", "cmd"} {
err := filepath.Walk(filepath.Join(root, top), func(p string, fi os.FileInfo, err error) error {
if err != nil {
return err
}
if fi.IsDir() || !strings.HasSuffix(p, ".go") || strings.HasSuffix(p, "_test.go") || strings.Contains(p, "filerpb") {
return nil
}
file, err := parser.ParseFile(token.NewFileSet(), p, nil, 0)
if err != nil {
return err
}
rel, _ := filepath.Rel(root, p)
rel = filepath.ToSlash(rel)
for _, d := range file.Decls {
fn, ok := d.(*ast.FuncDecl)
if !ok || fn.Body == nil {
continue
}
name := fn.Name.Name
if fn.Recv != nil && len(fn.Recv.List) == 1 {
switch x := fn.Recv.List[0].Type.(type) {
case *ast.Ident:
name = x.Name + "." + name
case *ast.StarExpr:
name = x.X.(*ast.Ident).Name + "." + name
}
}
ast.Inspect(fn.Body, func(n ast.Node) bool {
c, ok := n.(*ast.CallExpr)
if !ok {
return true
}
var callee string
switch x := c.Fun.(type) {
case *ast.SelectorExpr:
callee = x.Sel.Name
case *ast.Ident:
callee = x.Name
}
if callee == "DeleteEntry" || callee == "VolumeDir" {
key := rel + " " + strings.TrimPrefix(name, "*") + " -> " + callee
found[key] = true
}
return true
})
}
return nil
})
if err != nil {
t.Fatal(err)
}
}
var added, gone []string
for k := range found {
if _, ok := deleteSites[k]; !ok {
added = append(added, k)
}
}
for k := range deleteSites {
if !found[k] {
gone = append(gone, k)
}
}
sort.Strings(added)
sort.Strings(gone)
if len(added) != 0 || len(gone) != 0 {
t.Fatalf("delete or directory-naming sites changed: classify each (it must not remove a HEAD, a VOLUME or a volume directory, and a directory name must come from a reference or the master's record).\nnew: %v\ngone: %v", added, gone)
}
}
@@ -40,7 +40,7 @@ var headReaders = map[string]string{
"core/frontend/chunkstore/share_guard.go beginShare -> ReadHead": "refuses outcome_unknown: the HEAD to share is no longer current",
"core/frontend/chunkstore/usage.go Usage -> ReadHead": "GAP: reports an empty image, no error (probe Usage)",
"core/frontend/chunkstore/verify.go readHead -> LookupEntry": "finding ROOT_INVALID (probe Verify)",
"core/frontend/chunkstore/layout/delete.go OperatorReleaseDependent -> ReadHead": "reads the source's HEAD (absent: refuses ErrHeadAbsent) and the target's: with no HEAD and no VOLUME the target was never created and gets a deleted HEAD written exclusively before the release; with VOLUME and no HEAD it is being created and is refused (probe LayoutOperatorRelease)",
"core/frontend/chunkstore/layout/delete.go OperatorReleaseDependent -> ReadHead": "reads the source's HEAD (absent: refuses ErrHeadAbsent) and the target's: a target without HEAD (never created, or a restore that died between its VOLUME and its HEAD) gets a deleted HEAD written exclusively before the release (probe LayoutOperatorRelease)",
"core/frontend/chunkstore/layout/start.go Start -> ReadHead": "refuses ErrHeadAbsent and creates nothing (probe LayoutStart)",
"core/frontend/chunkstore/layout/remove.go RemoveUnreachable -> ReadHead": "refuses ErrHeadAbsent and writes nothing to the objects (probe LayoutRemoval)",
"core/frontend/chunkstore/layout/head.go runTransition -> ReadHead": "refuses ErrHeadAbsent and writes nothing; no layout transition creates a HEAD (probe LayoutTransition)",
@@ -295,8 +295,9 @@ func TestHeadReaders_AbsentHeadProbes(t *testing.T) {
t.Fatal(err)
}
src := &presentLayoutHead{}
if _, err := layout.OperatorReleaseDependent(ctx, src, &absentLayoutHead{}, r, tid); !errors.Is(err, layout.ErrTargetLive) || src.updates != 0 {
t.Fatalf("operator release of a target with VOLUME and no HEAD: %v, %d writes; want ErrTargetLive and none", err, src.updates)
withVol := &absentLayoutHead{}
if _, err := layout.OperatorReleaseDependent(ctx, src, withVol, r, tid); err != nil || withVol.created == nil || withVol.created.State != layout.StateDeleted {
t.Fatalf("operator release of a target with VOLUME and no HEAD: %v, tombstone %+v; want a deleted HEAD written, then the release", err, withVol.created)
}
none, _ := layout.NewReader("/swblock/chunks", "t", func(context.Context, string) ([]byte, bool, error) { return nil, false, nil })
tomb := &absentLayoutHead{}
@@ -5,6 +5,7 @@ import (
"context"
"errors"
"fmt"
"strings"
)
// HEAD states: a live volume, one being deleted, one deleted.
@@ -138,6 +139,11 @@ func DeleteVolume(ctx context.Context, st HeadStore, gone HolderGone, id VolumeI
if gone == nil || os == nil {
return errors.New("layout: delete needs a holder check and an object store")
}
for _, rel := range objects {
if !isObjectPath(rel) {
return fmt.Errorf("%w: %q is not a pool, segment or root object; HEAD, VOLUME and the directory stay", ErrMalformed, rel)
}
}
if err := gone.NoHolder(ctx); err != nil {
return fmt.Errorf("%w: %v", ErrHolderActive, err)
}
@@ -166,12 +172,13 @@ func DeleteVolume(ctx context.Context, st HeadStore, gone HolderGone, id VolumeI
// exists and is deleted or no longer names the source, read first: its
// HEAD is deleting or deleted; its directory's VOLUME carries another id;
// or its HEAD is live and no root in it (current or snapshot) names a
// chunk of the source. A target never created (no VOLUME, no HEAD) first
// gets a deleted HEAD written exclusively in its never-reused directory,
// so the restore that registered it can never create it later, and is
// then released. A live target that still names the source, one being
// created (VOLUME without HEAD), and one whose HEAD appeared before the
// tombstone are refused (ErrTargetLive); the source is not written then.
// chunk of the source. A target without HEAD (never created, or a restore
// that died between its VOLUME and its HEAD) first gets a deleted HEAD
// written exclusively in its never-reused directory, so the restore that
// registered it can never create it later, and is then released. A live
// target that still names the source, and one whose HEAD appeared before
// the tombstone, are refused (ErrTargetLive); the source is not written
// then.
func OperatorReleaseDependent(ctx context.Context, source HeadStore, target TargetStore, r *Reader, targetID VolumeID) (Head, error) {
sh, found, err := source.ReadHead(ctx)
if err != nil {
@@ -192,11 +199,12 @@ func OperatorReleaseDependent(ctx context.Context, source HeadStore, target Targ
switch {
case hasHead && (th.State == StateDeleting || th.State == StateDeleted):
case hasVolume && id != targetID:
case !hasVolume && !hasHead:
// Never created: a deleted HEAD written exclusively in the target's
case !hasHead:
// No HEAD (never created, or a restore that died between its VOLUME
// and its HEAD): a deleted HEAD written exclusively in the target's
// never-reused directory makes sure the restore can never create it
// later; only then is the dependent released. If a HEAD appeared
// first, the restore got there: refused, re-run decides.
// first, the restore got there: refused, a re-run decides.
tomb := Head{VolumeID: targetID, Activity: Activity{Kind: ActIdle}, State: StateDeleted}
if err := target.CreateDeletedHead(ctx, tomb); err != nil {
if errors.Is(err, ErrExists) {
@@ -204,7 +212,7 @@ func OperatorReleaseDependent(ctx context.Context, source HeadStore, target Targ
}
return Head{}, err
}
case hasVolume && hasHead:
default:
names, err := namesVolume(ctx, r, th, sh.VolumeID)
if err != nil {
return Head{}, err
@@ -212,8 +220,6 @@ func OperatorReleaseDependent(ctx context.Context, source HeadStore, target Targ
if names {
return Head{}, fmt.Errorf("%w: %s still names chunks of the source", ErrTargetLive, r.vol)
}
default:
return Head{}, fmt.Errorf("%w: %s is being created", ErrTargetLive, r.vol)
}
return RunReleaseDependent(ctx, source, targetID)
}
@@ -248,3 +254,15 @@ func namesVolume(ctx context.Context, r *Reader, h Head, owner VolumeID) (bool,
}
return false, nil
}
// isObjectPath reports whether rel names a content-named object of the
// volume (a chunk, a segment or a root): the only entries a volume delete
// removes. HEAD (which stays, deleted), VOLUME and the directory are not.
func isObjectPath(rel string) bool {
for _, dir := range []string{PoolDir + "/", SegDir + "/", RootDir + "/"} {
if strings.HasPrefix(rel, dir) && len(rel) > len(dir) && !strings.Contains(rel, "..") {
return true
}
}
return false
}
@@ -315,9 +315,9 @@ func operatorCase(t *testing.T, tgtHead *Head, tgtVolume *VolumeID, namesSource
// exists and is deleted or no longer names the source: its HEAD deleting
// or deleted, its name holding another volume (another VOLUME id), or a
// live HEAD none of whose roots names a chunk of the source. A live target
// that still names the source and one being created (VOLUME without HEAD)
// are refused and the source is unchanged. A target never created (no
// VOLUME, no HEAD) gets a deleted HEAD written exclusively in its
// that still names the source is refused and the source is unchanged. A
// target without HEAD (never created, or a restore that died between its
// VOLUME and its HEAD) gets a deleted HEAD written exclusively in its
// never-reused directory, so the restore can never create it later, and
// only then is released.
func TestOperatorReleaseDependent(t *testing.T) {
@@ -334,18 +334,18 @@ func TestOperatorReleaseDependent(t *testing.T) {
release bool
want error
}{
"live target naming the source": {&live, &tid, true, false, ErrTargetLive},
"live target no longer naming it": {&live, &tid, false, true, nil},
"target being created": {nil, &tid, false, false, ErrTargetLive},
"target never created": {nil, nil, false, true, nil},
"target deleting": {&deleting, &tid, true, true, nil},
"name holds another volume": {nil, &other, false, true, nil},
"live target naming the source": {&live, &tid, true, false, ErrTargetLive},
"live target no longer naming it": {&live, &tid, false, true, nil},
"restore died between its creates": {nil, &tid, false, true, nil},
"target never created": {nil, nil, false, true, nil},
"target deleting": {&deleting, &tid, true, true, nil},
"name holds another volume": {nil, &other, false, true, nil},
} {
src, tgt, r := operatorCase(t, tc.head, tc.volume, tc.namesSource)
before := src.updates
_, err := OperatorReleaseDependent(ctx, src, tgt, r, tid)
released := len(src.h.Snapshots["daily"].Dependents) == 0
if tc.head == nil && tc.volume == nil && (tgt.h == nil || tgt.h.State != StateDeleted || tgt.h.VolumeID != tid) {
if tc.head == nil && (tc.volume == nil || *tc.volume == tid) && (tgt.h == nil || tgt.h.State != StateDeleted || tgt.h.VolumeID != tid) {
t.Errorf("%s: target HEAD %+v; want a deleted HEAD (tombstone) of the target's id written before the release", name, tgt.h)
}
if tc.release && (err != nil || !released) {
@@ -383,3 +383,15 @@ func (r *raceTarget) CreateDeletedHead(ctx context.Context, h Head) error {
}
return r.memHead.CreateDeletedHead(ctx, h)
}
// A volume delete removes only content-named objects: HEAD (which stays,
// deleted), VOLUME and the directory are refused before any write.
func TestDeleteVolume_RemovesOnlyObjects(t *testing.T) {
for _, bad := range []string{HeadName, VolumeName, "", "pool/", "pool/../HEAD", "other/x"} {
w := newDeleteWorld()
o := w.objects()
if err := DeleteVolume(context.Background(), w.t, gone{}, idFor("t"), []HeadStore{w.src}, o, append(append([]string(nil), w.rels...), bad)); !errors.Is(err, ErrMalformed) || w.t.updates != 0 || len(o.writes) != 0 {
t.Errorf("delete listing %q: %v (%d HEAD writes, %d object writes); want ErrMalformed and nothing written", bad, err, w.t.updates, len(o.writes))
}
}
}
@@ -415,14 +415,14 @@ func TestHead_RefusesInvalidUTF8(t *testing.T) {
rn := RootName{Hash: Sum([]byte("r"))}
bad := "a\xff"
for name, h := range map[string]Head{
"holder": {Epoch: 1, Holder: bad, Activity: Activity{Kind: ActIdle}},
"holder": {Epoch: 1, Holder: bad, ClaimID: "k", VolumeID: idFor("v1"), Activity: Activity{Kind: ActIdle}},
"session": {Epoch: 1, Holder: "a", ClaimID: "k", VolumeID: idFor("v1"), Activity: Activity{Kind: ActSnap, Session: bad}},
"snapshot": {Epoch: 1, Holder: "a", ClaimID: "k", VolumeID: idFor("v1"), Activity: Activity{Kind: ActIdle}, Snapshots: map[string]Snapshot{bad: {Root: rn}}},
"dependent": {Epoch: 1, Holder: "a", ClaimID: "k", VolumeID: idFor("v1"), Activity: Activity{Kind: ActIdle}, Snapshots: map[string]Snapshot{"n": {Root: rn, Dependents: []Dependent{{Target: bad, TargetID: idFor("x"), Root: rn}}}}},
"claim id": {Epoch: 1, Holder: "a", ClaimID: bad, VolumeID: idFor("v1"), Activity: Activity{Kind: ActIdle}},
} {
if _, err := h.Encode(); !errors.Is(err, ErrMalformed) {
t.Errorf("%s %q: %v; want ErrMalformed", name, bad, err)
if _, err := h.Encode(); !errors.Is(err, ErrMalformed) || !strings.Contains(err.Error(), "not valid UTF-8") {
t.Errorf("%s %q: %v; want the UTF-8 refusal", name, bad, err)
}
}
h := idleHead()
@@ -12,6 +12,10 @@ import (
// identity: written once, never changed.
const VolumeName = "VOLUME"
// HeadName is the entry, under the volume root, that holds the volume's
// HEAD; it is never removed (a deleted volume keeps its deleted HEAD).
const HeadName = "HEAD"
// VolumeID is a volume's identity: random, chosen when the volume is
// created. A volume's name is a path and can be created again after a
// delete; its id cannot, so a volume created again satisfies no reference
+9 -8
View File
@@ -525,9 +525,9 @@ stateDiagram-v2
idle --> snap: Begin(s)
snap --> idle: Abort(s)
snap --> idle: Commit(s, root)
idle --> idle: Claim(e)
snap --> idle: Claim(e), s void
clean --> idle: Claim(e), c void
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)
clean --> clean: RemoveUnreachable(shard)
@@ -540,7 +540,7 @@ stateDiagram-v2
| idle | snap(s) | caller is the holder at HEAD's epoch (epoch and server); 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; activity is snap(s); over idle it succeeds without a write and means only that no activity remains | head.go `Head.Abort` | `INV-SNAPK-ABORT-001` |
| snap(s) | idle, current = root | holder at HEAD's epoch; activity is snap(s); the previous manifest builds to HEAD's current root; the new own chunks, every segment and the root are present | commit.go `Head.Commit`, `RunCommit` | `INV-SNAPK-COMMIT-REACH-001`, `INV-SNAPK-TXN-INTERRUPT-001` |
| any | idle at epoch e | e above HEAD's epoch (the same epoch and server is a replay); every older holder's lease has ended, checked after the read and before the update | claim.go `Head.Claim`, `RunClaim` (`LeaseWait.OldLeaseEnded`) | `INV-SNAPK-CLAIM-LEASE-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` |
| idle | clean(c) | holder at HEAD's epoch; 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; 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 with clean(c) open (HEAD read once, after BeginClean); a name is deleted only if no root in HEAD (current or snapshot) names it in this volume's pool; each removal is a mark conditional on the plan's metadata, then a delete conditional on that mark | remove.go `RemoveUnreachable` | `INV-SNAPK-REMOVE-MARK-001` |
@@ -549,7 +549,7 @@ stateDiagram-v2
## Part B. Invariant ledger
362 rows: 291 ACTIVE, 67 STUB, 4 ARCHIVED; 15 kept from the internal ledger, 347 new.
363 rows: 292 ACTIVE, 67 STUB, 4 ARCHIVED; 15 kept from the internal ledger, 348 new.
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.
@@ -1113,11 +1113,12 @@ Notes:
| `INV-SNAPK-DELETE-GATE-001` | HEAD becomes deleting only with no holder (checked immediately before), no open activity and no snapshot with dependents; from deleting on, no holder transition, claim or removal applies. | M9 idle → deleting | `core/frontend/chunkstore/layout` `delete.go` `Head.MarkDeleting`; `head.go` `holderErr` | `TestMarkDeleting_Closure`, `TestMarkDeleted_Closure`, `TestDeleting_RefusesEveryHolderStep`, `TestDeleteVolume` | — (the snapshot kernel model is not in this repository) | 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 volume lives in the directory <name>-<first 8 hex of its volume id>, created exclusively and never reused; a foreign chunk is read from the directory its reference's owner name and id give, after that directory's VOLUME id is checked. | Content-named layout | `core/frontend/chunkstore/layout` `volume.go` `VolumeDir`; `read.go` `Image.Chunk` | `TestRead_ForeignChunkFromSourcePool`, `TestRead_ForeignChunkNeedsTheOwnersVolumeID` | — (the snapshot kernel model is not in this repository) | ACTIVE |
| `INV-SNAPK-TOMBSTONE-001` | For a restore target never created the operator writes a deleted HEAD exclusively in its directory before releasing the dependent, so the restore cannot create it later; only that command creates a tombstone (source scan). | 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-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-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 never created, 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, a target being created (VOLUME without HEAD) 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-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` | `TestStart_OwnEpochFreshRootRefusedBeforeClaim`, `TestStart_OwnEpochSameRootContinues`, `TestStart_LostClaimReplyContinues`, `TestStart_SameHostForcedSuccessorRefusesTheRemountedOldRoot` | — (the snapshot kernel model is not in this repository) | 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` | — (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 |