docs: audit v3 admission and reclaim liveness replacements

This commit is contained in:
pingqiu committed 2026-11-18 15:54:34 -08:00
1 parent cf888fa844
commit cd5d7db0ed
2 files changed
+59 -21

No files matched your search

@@ -713,8 +713,8 @@
],
"reason": "v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors",
"v3_controls": [
"TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes",
"TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime"
"TestWALStoreV3AdmissionBurstFiveRings",
"TestWALStoreV3AdmissionUsesNativeOccupancy"
],
"todo": "row 14a: move or retire explicitly only after replacement/migration review; no deletion in 12b"
},
@@ -767,8 +767,9 @@
],
"reason": "v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors",
"v3_controls": [
"TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes",
"TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime"
"TestWALStoreV3AdmissionUsesNativeOccupancy",
"TestWALStoreV3AdmissionStallDeadlineAndResume",
"TestWALStoreV3AdmissionBurstFiveRings"
],
"todo": "row 14a: move or retire explicitly only after replacement/migration review; no deletion in 12b"
},
@@ -1156,10 +1157,8 @@
],
"reason": "raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes",
"v3_controls": [
"TestWALIOV3_RealWriterReopenScan",
"TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes",
"TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash",
"TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness"
"TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate",
"TestWALStoreV3HalfResetRefusesWritesUntilRecover"
],
"todo": "row 14a: move or retire explicitly only after replacement/migration review; no deletion in 12b"
},
@@ -1711,10 +1710,8 @@
],
"reason": "raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes",
"v3_controls": [
"TestWALIOV3_RealWriterReopenScan",
"TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes",
"TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash",
"TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness"
"TestWALStoreV3ReclaimKeepsPartialBatchAndRetention",
"TestWALStoreV3ReclaimRolloverProgressWithoutNewCheckpoint"
],
"todo": "row 14a: move or retire explicitly only after replacement/migration review; no deletion in 12b"
},
@@ -1726,10 +1723,8 @@
],
"reason": "raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes",
"v3_controls": [
"TestWALIOV3_RealWriterReopenScan",
"TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes",
"TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash",
"TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness"
"TestWALIOV3_FloorAndPwriteFailureRefuse",
"TestWALStoreV3ReclaimSecondSlotFailureKeepsOldPin"
],
"todo": "row 14a: move or retire explicitly only after replacement/migration review; no deletion in 12b"
},
@@ -64,11 +64,11 @@ TODO(row 14a): relocate or retire every listed legacy control explicitly; preser
| `core/storage/walstore_checkpoint_safety_test.go::TestFlusherSnapshotCannotOverwriteLaterDirectBase` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/flusher_snapshot_cut_test.go::TestFlusherSnapshotCutPreservesSyncedWrites` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/walstore_checkpoint_safety_test.go::TestFlusherWALSlotMismatchFailsClosed` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/flusher_test.go::TestFlusher_AdvancesCheckpointBeforeReadFromExtent` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/flusher_test.go::TestFlusher_AdvancesCheckpointBeforeReadFromExtent` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3AdmissionBurstFiveRings`, `TestWALStoreV3AdmissionUsesNativeOccupancy` |
| `core/storage/flusher_test.go::TestFlusher_ConcurrentWriteRaceLBAStaysFresh` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/flusher_test.go::TestFlusher_ManyDirtyEntriesCheckpointStaysCorrect` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/flusher_test.go::TestFlusher_RecoveryHonorsCheckpoint` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/flusher_test.go::TestFlusher_ReleasesWALPressureAfterCheckpoint` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/flusher_test.go::TestFlusher_ReleasesWALPressureAfterCheckpoint` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3AdmissionUsesNativeOccupancy`, `TestWALStoreV3AdmissionStallDeadlineAndResume`, `TestWALStoreV3AdmissionBurstFiveRings` |
| `core/storage/chunk_restore_test.go::TestFreshRestoreBitmapStartsAtClaimedHEAD` | legacy C11 bitmap persistence/reconciliation or pre-v3 permissive frontier/record surgery | `TestChunkLayerV3_CaptureUsesOwnedMapAfterCheckpoint`, `TestChunkLayerV3_IgnoresProvidedLegacyBitmap`, `TestChunkLayerV3_MapOnlyRefusesLegacyBASEHeaderMutation` |
| `core/storage/flusher_test.go::TestRecovery_DeterministicAcrossMultipleOpens` | v2 engine/layout, forced legacy fields or callback seams; v3 uses coherent descriptors | `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3_FlushMaterializationBoundToRecoveryLifetime` |
| `core/storage/walstore_checkpoint_safety_test.go::TestRunningFlusherCannotOverwriteDirectBase` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
@@ -94,7 +94,7 @@ TODO(row 14a): relocate or retire every listed legacy control explicitly; preser
| `core/storage/walstore_checkpoint_safety_test.go::TestWALStoreMutationAPIsRejectAfterClose` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/walstore_activation_test.go::TestWALStoreProductionRefusesLegacyWithoutMutation` | legacy input construction for the native public-refusal control itself; the production test stays on v3 | `TestWALStoreProductionRefusesLegacyWithoutMutation` |
| `core/storage/walstore_sticky_race_test.go::TestWALStoreQueuedSyncAfterAFailedFsyncIsRefused` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/walstore_persisted_tail_test.go::TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
| `core/storage/walstore_persisted_tail_test.go::TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3HalfResetRefusesWritesUntilRecover` |
| `core/storage/walstore_midhistory_hole_test.go::TestWALStoreRecoverKeepsATornTail` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
| `core/storage/walstore_recovery_frontier_gap_test.go::TestWALStoreRecoverKeepsSyncedEntriesAboveAnUnpersistedFrontierJump` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
| `core/storage/walstore_recovery_lww_test.go::TestWALStoreRecoverLastWriterWinsAcrossScanOrder` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
@@ -131,10 +131,53 @@ TODO(row 14a): relocate or retire every listed legacy control explicitly; preser
| `core/storage/walstore_recycle_pin_test.go::TestWALStore_RecycleGate_SourceActive_ClampsAtFloor` | fabricated v2 checkpoint/retention geometry; v3 replacement drives real acknowledged writes and both slots | `TestWALStoreV3RecycleFloorCompatibilityMatrix`, `TestWALStoreV3RetentionCompatibilityMatrix`, `TestWALStoreV3ReclaimKeepsPartialBatchAndRetention` |
| `core/storage/walstore_recycle_pin_test.go::TestWALStore_RecycleGate_SourceInactive_LegacyBehavior` | fabricated v2 checkpoint/retention geometry; v3 replacement drives real acknowledged writes and both slots | `TestWALStoreV3RecycleFloorCompatibilityMatrix`, `TestWALStoreV3RetentionCompatibilityMatrix`, `TestWALStoreV3ReclaimKeepsPartialBatchAndRetention` |
| `core/storage/walstore_format_admission_test.go::TestWALStore_UnknownFormatWithoutFactoryRefused` | raw frozen v2 codec/format fixtures remain; v3 has a distinct CRC32C/binding/dual-slot byte contract | `TestWALIOV3_RealWriterReopenScan`, `TestDescriptorV3PublishAlternatesSlotsAndReopenSelectsNewest`, `TestWALStoreProductionRefusesLegacyWithoutMutation` |
| `core/storage/walstore_persisted_tail_test.go::TestWALWriterBatchReuseIsBoundedByTheDurableTail` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
| `core/storage/walstore_persisted_tail_test.go::TestWALWriterReuseIsBoundedByTheDurableTail` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_RealWriterReopenScan`, `TestWALStoreV3RecoversEveryAcknowledgedWriteInBothModes`, `TestWALStoreV3DroppedRecordsNeverResurfaceAfterASecondCrash`, `TestDurableStartup_Issue51_WALStoreV3CommittedHoleBlocksReadiness` |
| `core/storage/walstore_persisted_tail_test.go::TestWALWriterBatchReuseIsBoundedByTheDurableTail` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALStoreV3ReclaimKeepsPartialBatchAndRetention`, `TestWALStoreV3ReclaimRolloverProgressWithoutNewCheckpoint` |
| `core/storage/walstore_persisted_tail_test.go::TestWALWriterReuseIsBoundedByTheDurableTail` | raw v2 header/window/IEEE-CRC/permissive scan assumptions; native v3 refuses holes below W and fences rolled-back suffixes | `TestWALIOV3_FloorAndPwriteFailureRefuse`, `TestWALStoreV3ReclaimSecondSlotFailureKeepsOldPin` |
| `core/storage/walstore_checkpoint_safety_test.go::TestWriteExtentDirectFailureRetainsDirtyWAL` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/walstore_checkpoint_safety_test.go::TestWriteExtentDirectSupersededWALDoesNotReappearAfterRestart` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
| `core/storage/walstore_checkpoint_safety_test.go::TestWriteExtentDirectSupersedesPriorDirtyWAL` | v2 fd/callback/checkpoint injection or direct-extent API; v3 fails through the shared publisher/owned map and uses install handles | `TestDescriptorV3FsyncFailureIsStickyAndPublishesNothing`, `TestDescriptorV3SlotWriteErrorLatchesAndPinsTheCandidate`, `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore`, `TestBaseInstallV3CompleteServesTheImageAcrossACrash` |
Native typed-error controls use the owned-map v3 store directly: `TestChunkCut_UploadFailureIsRemoteUnavailable` checks both upload error causes; `TestChunkCut_ClosedLayerIsTyped` checks the closed-cut cause; `TestChunkCut_CASLostToMovedHeadIsHeadConflict` checks ambiguous CAS with a moved HEAD remains a conflict, not fencing. They are not legacy coverage mappings. `TestLegacyFixtureIsolationRejectsFunctionValues` exercises direct calls, package/local aliases and function arguments against the same reference guard. CI executes both default and explicit tagged configurations.
## Liveness audit after the native admission regression
The earlier replacement matrix mapped checkpoint safety to generic recovery
controls. That did not test the *binding* of the common admission controller to
v3 occupancy. The production closure was therefore incomplete: the legacy writer
remained at zero and no test crossed the default ring while relying on automatic
pressure relief. Codec, manual-flush and safety tests could all pass.
The audit inspected the retained legacy constructor inventory and storage tests
using admission, pressure, throttling, `errWALFull`, wait/timeout and stalled-flusher
paths. The five concrete retained controls above now name their native counterparts:
`TestFlusher_AdvancesCheckpointBeforeReadFromExtent`,
`TestFlusher_ReleasesWALPressureAfterCheckpoint`,
`TestWALWriterReuseIsBoundedByTheDurableTail`,
`TestWALWriterBatchReuseIsBoundedByTheDurableTail`, and
`TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry`.
The last three include safety gates needed to make reuse liveness safe; v3's
sticky persistence failure intentionally requires physical reopen rather than
v2's same-instance retry. These are not claimed to have identical retry semantics.
`TestWriteExtentDirectSupersedesPriorDirtyWAL` also mentions pressure, but tests
BASE supersession, not admission; its existing install/map mapping stays intact.
Raw writer controls remain format-specific; no test is removed.
| Behaviour | Native-v3 control | Scope |
| --- | --- | --- |
| Healthy burst and automatic pressure relief | `TestWALStoreV3AdmissionBurstFiveRings` | Fresh mapped 64 KiB ring, five ring sizes of writes, Sync every ten blocks, real automatic flusher, all submitted bytes read back; legacy-sampler mutant must fail this test |
| Production default geometry and frontend Flush | `TestWALStoreChunkV3_SequentialBurstFlush` | Public provider, 64 MiB WAL, 320 MiB via NVMe handler, periodic Flush and literal-byte readback |
| Occupancy and checkpoint pressure reset | `TestWALStoreV3AdmissionUsesNativeOccupancy` | Actual append size and both-slot released floor, not a mocked pressure value |
| Soft-watermark throttling | `TestWALStoreV3AdmissionSoftThrottles` | Real occupied v3 ring drives a positive bounded soft delay; only sleep is recorded |
| Hard watermark, stopped flusher, timeout and resumed progress | `TestWALStoreV3AdmissionStallDeadlineAndResume` | Native occupied ring, bounded timeout, waiter remains blocked until actual checkpoint/reclaim then resumes |
| Close during pressure | `TestWALStoreV3AdmissionCloseEndsPressureWait` | Closed pressured store refuses with the typed close error rather than admitting |
| Idle/admission rollover without a new checkpoint | `TestWALStoreV3ReclaimRolloverProgressWithoutNewCheckpoint` | Both single/batch admission triggers plus idle and unchanged-checkpoint paths |
| Flusher persistence fault | `TestWALStoreV3_AutomaticMapPersistenceFailureLatchesStore` | Real owned-map failure latches the store; no false progress or unsafe admission |
There were no dedicated `walAdmission` unit tests in the retained v2 suite for
soft delay, hard-wait timeout or stopped-flusher resumption. Those gaps are covered
by the new native tests rather than reported as already covered. The new small-ring
tests use the production engine, controller and flusher with test-only geometry;
they do not replace the public default-size provider control. They preserve the
existing bounded admission policy, not a reservation guarantee for oversized or
concurrently pre-admitted batches, or a promise that an entirely unsynced ring can
reclaim unacknowledged bytes.