diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 1544f928da..bf89c1c76b 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -1336,8 +1336,8 @@ Notes: | `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-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-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 rereads HEAD after receipt publication and refuses a deleting/deleted or absent volume. Retained pending work refuses readmission after close; retained terminal outcomes stay immutable. This does not prove that remote writes have drained. | M9 admission | `checkSnapshotOperationAdmission`, `createOperationReceipt`, create/delete admission | `TestSnapshotOperationAdmissionRechecksHeadAfterPublication`, `TestSnapshotOperationClosedVolumeRefusesPendingKeepsTerminal` | Volume-close refinement; drain premise still owed | STUB | -| `INV-SNAP-OP-END-001` | After ordered volume deletion, remove its receipts by full volume/sequence and then INDEX by full volume/kind; an interrupted cleanup reruns. Missing or deleted HEAD never restarts index admission. HEAD, VOLUME and directories stay. | M9 deleted → operation namespace ended | `snapshot_operation_cleanup.go`; `BCatalog.DeleteVolume`; `writeOperationIndex` | `TestSnapshotOperationVolumeDeleteEndsNamespace`, `TestSnapshotOperationVolumeDeleteCleanupReruns`, `TestSnapshotOperationVolumeDeleteSparesForeignReceipt`, `TestSnapshotOperationCleanupRequiresDeletedHead` | SnapOps namespace lifetime ends with volume; native qualification owed | STUB | +| `INV-SNAP-OP-ADMISSION-CLOSE-001` | Admission rereads HEAD after receipt publication and refuses a deleting/deleted or absent volume. Retained pending work refuses readmission after close; retained terminal outcomes stay immutable. This does not prove that remote writes have drained. | M9 admission | `checkSnapshotOperationAdmission`, `createOperationReceipt`, create/delete admission | `TestSnapshotOperationAdmissionRechecksHeadAfterPublication`, `TestSnapshotOperationClosedVolumeRefusesPendingKeepsTerminal` | SnapVolDel rows 254-256; admission/server-apply bound still owed | STUB | +| `INV-SNAP-OP-END-001` | After ordered volume deletion, remove its receipts by full volume/sequence and then INDEX by full volume/kind; an interrupted cleanup reruns. Missing or deleted HEAD never restarts index admission. HEAD, VOLUME and directories stay. | M9 deleted → operation namespace ended | `snapshot_operation_cleanup.go`; `BCatalog.DeleteVolume`; `writeOperationIndex` | `TestSnapshotOperationVolumeDeleteEndsNamespace`, `TestSnapshotOperationVolumeDeleteCleanupReruns`, `TestSnapshotOperationVolumeDeleteSparesForeignReceipt`, `TestSnapshotOperationCleanupRequiresDeletedHead` | SnapVolDel rows 254-256; NoOrphanAfterEnd control red until bounded drain is enforced | 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`, `TestScheduledSnapshotAtTheLimitStillPublishes`, `TestChunkSnapshotRefusalsAreTyped`, `TestLayoutProviderSnapshotVolume` | — (the snapshot kernel model is not in this repository) | ACTIVE | diff --git a/seaweed-block/docs/design/snapshot-operation-index.md b/seaweed-block/docs/design/snapshot-operation-index.md index 64404577ce..677993cf05 100644 --- a/seaweed-block/docs/design/snapshot-operation-index.md +++ b/seaweed-block/docs/design/snapshot-operation-index.md @@ -130,6 +130,10 @@ The two-executor namespace-empty control therefore remains intentionally red. A final sweep needs an enforced admission/server-apply window or a durable publication fence. Caller cancellation alone is not proof of remote quiescence; no complete namespace-close guarantee is claimed until that premise is enforced. +SnapVolDel rows 254-256 cover the safe rule and the missing-check/drain controls; +the model assumes an admission writes nothing after its request/HEAD-step bound. +The production adapter must establish that premise, including remote application +of an already dispatched write, before the final sweep can close the namespace. ## CLI-owned catalog attempt boundary