chore: keep public PR changes to implementation and tests

This commit is contained in:
pingqiu committed 2026-11-18 22:57:12 -08:00
1 parent bdeb3faf5e
commit 254f6ba7ee
3 files changed
+3 -16

No files matched your search

@@ -183,9 +183,6 @@ stateDiagram-v2
## 6. Snapshots, forks, retention, GC, volume delete
**Create capacity.** New volumes larger than 16 TiB - 4 KiB (17,592,186,040,320 bytes) are refused before provisioning, WAL allocation or durable VOLUME creation. CSI, lifecycle intent, Catalog and local WAL create share the same bound. A fork inherits its source geometry only within the same capacity bound; refusal leaves no parent claim. Existing store-open formats are unchanged. This is static admission, not a new lifecycle state.
- **Snapshot** (`Catalog.CreateSnapshot`): claim the name with an exclusive name record `{request, attempt}` (a retry gets its own attempt back); check the volume is not being deleted; write an intent with a deadline; re-check the deadline; exclusively create `snaps/<name>/<attempt>` holding a copy of the HEAD root. An unknown outcome keeps the intent; the caller retries with the same request id.
- **Fork** (`Catalog.Fork`): claim the parent snapshot, check the source is not being deleted, write the target `VOLUME` (origin fork), then a HEAD at gen 1, epoch 0, no holder, with the parent's `RemoteLSN` and references. No segment or chunk is copied: the fork's references are owner-qualified, so it reads the parent's objects, and its root alone keeps them live after the parent snapshot is deleted.
- **Retention** (`retention.go`): classes `semantic` and `pinned`; newest N, recent window and log-spaced keeps; a snapshot with a live fork claim is always kept; deletion uses the same conditional mark as `DeleteSnapshot`.
@@ -206,7 +203,7 @@ HEAD states:
```mermaid
stateDiagram-v2
[*] --> active: create within capacity bound (gen 1, epoch 0) or inherited fork HEAD within capacity bound
[*] --> active: initial HEAD (gen 1, epoch 0) or fork HEAD
active --> active: holder's cut CAS (gen+1)
active --> detached: Detach final cut
detached --> active: takeover CAS (higher epoch, new holder)
+2 -8
View File
@@ -229,7 +229,7 @@ HEAD states, snapshots, forks, intents, key bindings, GC and volume delete in th
| From | To | Guard | Enforced in | Protects |
|---|---|---|---|---|
| — | `active` (gen 1, epoch 0) | new volume capacity is at most 16 TiB - 4 KiB before creation; the first HEAD is an exclusive create (`CASHead` with expected gen 0); a fork HEAD carries the parent's `RemoteLSN` and references | `core/frontend/chunkstore/chunk_remote.go` `CASHead`; `core/frontend/chunkstore/catalog.go` `EnsureVolume`, `Fork` | `INV-WS-HEAD-CAS-001` |
| — | `active` (gen 1, epoch 0) | the first HEAD is an exclusive create (`CASHead` with expected gen 0); a fork HEAD carries the parent's `RemoteLSN` and references | `core/frontend/chunkstore/chunk_remote.go` `CASHead`; `core/frontend/chunkstore/catalog.go` `EnsureVolume`, `Fork` | `INV-WS-HEAD-CAS-001` |
| `active` | `active` | a holder's cut or a takeover CAS (M4, M5) | `core/frontend/chunkstore/chunk_remote.go` `CASHead` | `INV-WS-HEAD-CAS-001`, `INV-WS-HEAD-MONOTONE-001` |
| `active` | `detached` | `Detach` final cut | `core/storage/chunk_layer.go` `chunkLayerImpl.Detach` | `INV-WS-CLEAN-MOVE-001` |
| `detached` | `active` | takeover CAS by a new holder at a higher epoch | `core/storage/chunk_restore.go` `ClaimChunkHead` | `INV-WS-CLAIM-BEFORE-SERVE-001` |
@@ -247,7 +247,7 @@ HEAD states, snapshots, forks, intents, key bindings, GC and volume delete in th
| — | name held | exclusive name record `{request, attempt}`; a retry with the same request id gets its own attempt back | `core/frontend/chunkstore/catalog.go` `CreateSnapshot`, `claimName` | `INV-SNAP-EXPLICIT-DELETE-001` |
| name held | published | the volume is not being deleted; an intent with a deadline is written and the deadline is re-checked; exclusive create of the attempt path | `core/frontend/chunkstore/catalog.go` `CreateSnapshot` | `INV-SNAP-EXPLICIT-DELETE-001` |
| published | deleting | `DeleteSnapshot` or retention for this attempt, never while a fork claim is live | `core/frontend/chunkstore/catalog.go` `DeleteSnapshot`; `core/frontend/chunkstore/retention.go` `markDeleting` | `INV-SNAP-EXPLICIT-DELETE-001` |
| published | fork | require inherited geometry within the create capacity bound; require inherited geometry within the create capacity bound; claim the parent snapshot, check the source is not being deleted, write the target `VOLUME`, then its HEAD; no chunk is copied | `core/frontend/chunkstore/catalog.go` `Fork`, `claimForkParent` | `INV-GC-REACHABLE-001` |
| published | fork | claim the parent snapshot, check the source is not being deleted, write the target `VOLUME`, then its HEAD; no chunk is copied | `core/frontend/chunkstore/catalog.go` `Fork`, `claimForkParent` | `INV-GC-REACHABLE-001` |
**Intents and key bindings.**
@@ -469,12 +469,6 @@ Notes:
|---|---|---|---|---|---|---|
| `INV-NVME-H2C-RANGE-001` | An H2CData range exceeding the expected transfer size is refused before slicing, including a uint32 offset-plus-length overflow; an exact-bound payload is preserved. | Frontend H2C receive validation; no storage state transition | `core/frontend/nvme/session.go` `recvH2CData` | `TestRecvH2CDataRangeBounds` (`core/frontend/nvme/h2c_bounds_test.go`) | — | ACTIVE |
### Volume create capacity
| ID | Invariant | Transition | Enforced in | Regression tests | Model | Status |
|---|---|---|---|---|---|---|
| `INV-VOLUME-CREATE-SIZE-001` | Creation refuses capacity above 16 TiB - 4 KiB before provisioning, allocating a WAL, or persisting a volume record. Geometry checks cannot overflow. | M6 initial create (static parameter admission) | `core/geometry/volume_size.go`; lifecycle `CreateVolume`, CSI `volumeSpecFromCreateRequest`, catalog `EnsureVolume`, `claimForkParent`, storage `CreateWALStoreWithOptions` | `TestCreateVolumeRejectsBeyondUint32LBACap`, `TestCSICreateVolumeCapacityCapBeforeProvision`, `TestEnsureVolumeRejectsBeyondUint32LBACap`, `TestCreateWALStoreRefusesOversizeBeforeFilesystem`, `TestForkRejectsLegacyOversizedGeometry` | Static geometry bound; no protocol state or transition added | ACTIVE |
## Part C. Change rules
How a fix or a feature is calibrated against this model:
-4
View File
@@ -274,7 +274,3 @@ Recover/reset snapshot recheck and saved-file readers are covered by the
native `TestCutCOWV3_*` caller controls, not claimed as model proofs.
The earlier thirteen-spec parse statement above predates this imported model;
no new independent TLC/parse or cloud run is claimed here.
### Static volume create capacity
`INV-VOLUME-CREATE-SIZE-001` bounds a new volume to 16 TiB - 4 KiB. The current ControlPlane/ChunkLifecycle models abstract volume identity and create/delete ordering, not byte capacity or block geometry; this admission bound is not a TLC property. The actual CSI, lifecycle, Catalog and WAL create caller controls in `volume_size_limit_test.go` establish the bound before side effects. No modeled state or action is changed.