mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 11:07:31 +01:00
fix(storage): check the drain hold with the snapshot; backstop at the extent writer
A flusher cycle that started before the owner armed the hold (the flusher runs from open) could pass the entry check, pause, and then drain the dirty map Recover filled after the hold. The hold is now checked under store.mu with the dirty-map snapshot: Recover takes store.mu after the hold is set, so such a cycle sees it (red locally without this: the paused cycle advances the checkpoint 1 -> 2 before attach). writeExtentUnlocked refuses while held and no layer is attached, so a writer the census misses fails loudly. The census counts every reference (calls, aliases, method expressions) per site, with negative controls. Tests: the provider holds on create and open (walstore-chunk only); the post-attach drain advances the checkpoint and a fetch of the chunk keeps the now-local block. block-design.md's WAL lifecycle shows the hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f4e7ff4be6
commit
e839a773e1
6 files changed
+222
-43
No files matched your search
@@ -0,0 +1,50 @@
|
||||
package durable
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/frontend"
|
||||
"github.com/seaweedfs/seaweed-block/core/storage"
|
||||
)
|
||||
|
||||
type drainHoldView struct{}
|
||||
|
||||
func (drainHoldView) Projection() frontend.Projection {
|
||||
return frontend.Projection{VolumeID: "v1", ReplicaID: "r1", Epoch: 1, EndpointVersion: 1}
|
||||
}
|
||||
|
||||
// Both production sites that open a walstore-chunk store (create and open)
|
||||
// hold its extent drain until the chunk layer attaches, before Recover; a
|
||||
// plain walstore store is never held.
|
||||
func TestProviderHoldsTheDrainOfAChunkStoreOnCreateAndOpen(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
impl ImplName
|
||||
held bool
|
||||
}{{ImplWALStoreChunk, true}, {ImplWALStore, false}} {
|
||||
t.Run(string(c.impl), func(t *testing.T) {
|
||||
p := &DurableProvider{cfg: ProviderConfig{NumBlocks: 64, BlockSize: 4096, ChunkBlocks: 4}, view: drainHoldView{}}
|
||||
path := filepath.Join(t.TempDir(), "v1.bin")
|
||||
h, err := p.createFresh("v1", path, c.impl)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ws := h.storage.(*storage.WALStore)
|
||||
if ws.ExtentDrainHeld() != c.held {
|
||||
t.Fatalf("create: drain held %v; want %v", ws.ExtentDrainHeld(), c.held)
|
||||
}
|
||||
if err := ws.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
h, err = p.openExisting("v1", path, c.impl)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ws = h.storage.(*storage.WALStore)
|
||||
defer ws.Close()
|
||||
if ws.ExtentDrainHeld() != c.held {
|
||||
t.Fatalf("open: drain held %v; want %v", ws.ExtentDrainHeld(), c.held)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -62,13 +62,24 @@ func TestReplayedWriteIsNotDrainedBeforeTheChunkLayerAttaches(t *testing.T) {
|
||||
if got, err := s2.Read(9); err != nil || !bytes.Equal(got, newer) {
|
||||
t.Fatalf("after restart LBA 9 = %#x (err %v); want the synced write %#x", got[0], err, newer[0])
|
||||
}
|
||||
// After attach the drain runs, marks the block local, and a later read
|
||||
// still returns the write (no fetch installs over it).
|
||||
// Attach released the hold; the drain now runs and advances the
|
||||
// checkpoint, and it marked the block local: a fetch of its chunk (a
|
||||
// read of LBA 10, still absent) does not install over it.
|
||||
if s2.ExtentDrainHeld() {
|
||||
t.Fatal("attach did not release the hold")
|
||||
}
|
||||
before := s2.CheckpointLSN()
|
||||
if err := s2.flusher.flushOnce(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if cp := s2.CheckpointLSN(); cp <= before {
|
||||
t.Fatalf("the drain after attach did not advance the checkpoint (%d -> %d)", before, cp)
|
||||
}
|
||||
if _, err := s2.Read(10); err != nil { // fetches chunk 2
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, err := s2.Read(9); err != nil || !bytes.Equal(got, newer) {
|
||||
t.Fatalf("after the drain LBA 9 = %#x (err %v); want the synced write %#x", got[0], err, newer[0])
|
||||
t.Fatalf("after the drain and a fetch of its chunk, LBA 9 = %#x (err %v); want the synced write %#x", got[0], err, newer[0])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,48 +144,150 @@ func TestABaseInstallIsRefusedWhileTheDrainIsHeld(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Every path that writes the extent is listed with how it keeps a block
|
||||
// written before the chunk layer attaches local: the flusher's drain (held
|
||||
// until attach), a BASE (refused while held) and a fetched block (only an
|
||||
// attached layer fetches). A new writer fails here until it is classified.
|
||||
// extentWriterSites counts, per enclosing function, every reference to the
|
||||
// extent writer: a call, a method value (an alias such as w :=
|
||||
// s.writeExtentUnlocked) or a method expression.
|
||||
func extentWriterSites(files []*ast.File) map[string]int {
|
||||
sites := map[string]int{}
|
||||
for _, file := range files {
|
||||
for _, decl := range file.Decls {
|
||||
fn, ok := decl.(*ast.FuncDecl)
|
||||
if !ok || fn.Body == nil {
|
||||
continue
|
||||
}
|
||||
ast.Inspect(fn.Body, func(n ast.Node) bool {
|
||||
if sel, ok := n.(*ast.SelectorExpr); ok && sel.Sel.Name == "writeExtentUnlocked" {
|
||||
sites[fn.Name.Name]++
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
}
|
||||
return sites
|
||||
}
|
||||
|
||||
// Every path that writes the extent is listed, with how it keeps a block
|
||||
// written before the chunk layer attaches local, by exact site count: the
|
||||
// flusher's drain (held until attach), a BASE (refused while held) and a
|
||||
// fetched block (only an attached layer fetches). A new writer, an alias of
|
||||
// the writer or a second reference in a listed function fails here until it
|
||||
// is classified; writeExtentUnlocked itself refuses while held (backstop).
|
||||
func TestExtentWritersAreEnumerated(t *testing.T) {
|
||||
want := map[string]string{
|
||||
"writeExtentIfCurrent": "the flusher's drain; held until attach (flushOnceInternal)",
|
||||
"WriteBase": "BASE install; refused while held (BeginBaseInstall)",
|
||||
"installFetchedBlock": "a fetched block; only an attached chunk layer fetches",
|
||||
want := map[string]int{
|
||||
"writeExtentIfCurrent": 1, // the flusher's drain; held until attach (flushOnceInternal)
|
||||
"WriteBase": 1, // BASE install; refused while held (BeginBaseInstall)
|
||||
"installFetchedBlock": 1, // a fetched block; only an attached chunk layer fetches
|
||||
}
|
||||
fset := token.NewFileSet()
|
||||
pkgs, err := parser.ParseDir(fset, ".", func(fi fs.FileInfo) bool { return !strings.HasSuffix(fi.Name(), "_test.go") }, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got := map[string]bool{}
|
||||
var files []*ast.File
|
||||
for _, pkg := range pkgs {
|
||||
for _, file := range pkg.Files {
|
||||
for _, decl := range file.Decls {
|
||||
fn, ok := decl.(*ast.FuncDecl)
|
||||
if !ok || fn.Body == nil {
|
||||
continue
|
||||
}
|
||||
ast.Inspect(fn.Body, func(n ast.Node) bool {
|
||||
if call, ok := n.(*ast.CallExpr); ok {
|
||||
if sel, ok := call.Fun.(*ast.SelectorExpr); ok && sel.Sel.Name == "writeExtentUnlocked" {
|
||||
got[fn.Name.Name] = true
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
for _, f := range pkg.Files {
|
||||
files = append(files, f)
|
||||
}
|
||||
}
|
||||
for name := range got {
|
||||
if _, ok := want[name]; !ok {
|
||||
t.Errorf("%s writes the extent and is not classified: a block it writes before the chunk layer attaches must be held or marked local", name)
|
||||
got := extentWriterSites(files)
|
||||
for name, n := range got {
|
||||
if want[name] != n {
|
||||
t.Errorf("%s references the extent writer %d time(s), listed %d: classify each site (held, refused or attached-only)", name, n, want[name])
|
||||
}
|
||||
}
|
||||
for name, why := range want {
|
||||
if !got[name] {
|
||||
t.Errorf("listed extent writer %s (%s) no longer calls writeExtentUnlocked; update the list", name, why)
|
||||
for name, n := range want {
|
||||
if got[name] == 0 {
|
||||
t.Errorf("listed extent writer %s (%d site) no longer references writeExtentUnlocked; update the list", name, n)
|
||||
}
|
||||
}
|
||||
|
||||
// Negative controls: an alias and a second reference are both counted.
|
||||
src := `package storage
|
||||
func (s *WALStore) aliasWriter() { w := s.writeExtentUnlocked; _ = w(0, nil) }
|
||||
func (s *WALStore) twoWrites() { _ = s.writeExtentUnlocked(0, nil); _ = s.writeExtentUnlocked(1, nil) }
|
||||
func exprWriter() { _ = (*WALStore).writeExtentUnlocked }
|
||||
`
|
||||
f, err := parser.ParseFile(token.NewFileSet(), "control.go", src, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if c := extentWriterSites([]*ast.File{f}); c["aliasWriter"] != 1 || c["twoWrites"] != 2 || c["exprWriter"] != 1 {
|
||||
t.Fatalf("the census missed a control site: %v", c)
|
||||
}
|
||||
}
|
||||
|
||||
// The structural backstop: a store awaiting its chunk layer refuses any
|
||||
// extent write, so a writer missed by the enumeration fails loudly; once a
|
||||
// layer is attached the same write is admitted.
|
||||
func TestAHeldStoreRefusesAnyExtentWriteUntilAttached(t *testing.T) {
|
||||
s, _, _ := crashableStore(t)
|
||||
s.HoldExtentDrainUntilChunkLayer()
|
||||
if err := s.writeExtentUnlocked(0, makeBlock(ctBlockSize, 0x11)); !errors.Is(err, ErrDrainHeldForChunkLayer) {
|
||||
t.Fatalf("extent write while held: %v; want ErrDrainHeldForChunkLayer", err)
|
||||
}
|
||||
mustAttach(t, s, newFakeChunkRemote(), ctConfig(1))
|
||||
if s.ExtentDrainHeld() {
|
||||
t.Fatal("attach did not release the hold")
|
||||
}
|
||||
if err := s.writeExtentUnlocked(0, makeBlock(ctBlockSize, 0x11)); err != nil {
|
||||
t.Fatalf("extent write after attach: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// A flusher cycle that began before the owner armed the hold (the flusher
|
||||
// starts at open) and pauses after its entry checks must not drain the
|
||||
// dirty map Recover fills after the hold: the hold is checked with the
|
||||
// snapshot, under store.mu, which Recover takes.
|
||||
func TestACycleStartedBeforeTheHoldDoesNotDrainTheRecoveredWrite(t *testing.T) {
|
||||
s, path, crash := crashableStore(t)
|
||||
f := newFakeChunkRemote()
|
||||
cfg := ctConfig(1)
|
||||
layer := mustAttach(t, s, f, cfg)
|
||||
if _, err := s.Write(9, makeBlock(ctBlockSize, 0x89)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
mustSyncFlush(t, s)
|
||||
if _, err := layer.Capture(ctTimeout(t)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := layer.EvictChunk(2); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
newer := makeBlock(ctBlockSize, 0xE9)
|
||||
if _, err := s.Write(9, newer); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := s.Sync(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
crash()
|
||||
|
||||
s2, err := OpenWALStore(path) // the flusher is running from here
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { closeBounded(t, s2) })
|
||||
s2.DisableAutoFlushForRecoveryTest() // its ticks are replaced by the cycle below
|
||||
entered, release := make(chan struct{}), make(chan struct{})
|
||||
s2.flusher.beforeSnapshotForTest = func() { close(entered); <-release }
|
||||
done := make(chan error, 1)
|
||||
go func() { done <- s2.flusher.flushOnce() }() // a cycle that saw no hold
|
||||
<-entered
|
||||
s2.HoldExtentDrainUntilChunkLayer()
|
||||
before := s2.CheckpointLSN()
|
||||
if _, err := s2.Recover(); err != nil {
|
||||
t.Fatalf("local recovery: %v", err)
|
||||
}
|
||||
close(release)
|
||||
if err := <-done; err != nil {
|
||||
t.Fatalf("the paused cycle: %v", err)
|
||||
}
|
||||
s2.flusher.beforeSnapshotForTest = nil
|
||||
if cp := s2.CheckpointLSN(); cp != before {
|
||||
t.Fatalf("the paused cycle advanced the checkpoint %d -> %d before attach", before, cp)
|
||||
}
|
||||
mustAttach(t, s2, f, cfg)
|
||||
if got, err := s2.Read(9); err != nil || !bytes.Equal(got, newer) {
|
||||
t.Fatalf("after attach LBA 9 = %#x (err %v); want the synced write %#x", got[0], err, newer[0])
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,9 @@ type flusher struct {
|
||||
// taken and the publication lock released: the window in which a
|
||||
// concurrent append is not in this cycle's checkpoint. Tests only.
|
||||
afterSnapshotForTest func()
|
||||
// beforeSnapshotForTest, when set, runs after a cycle's entry checks
|
||||
// and before it takes store.mu for the dirty-map snapshot.
|
||||
beforeSnapshotForTest func()
|
||||
// Pauses after materialization/fsync, before map proof preparation. Tests only.
|
||||
afterExtentSyncForTest func()
|
||||
// Pauses after checkpoint/reuse publication, before the outer DM cleanup.
|
||||
@@ -159,14 +162,6 @@ func (f *flusher) flushOnceAllowClosed() error {
|
||||
func (f *flusher) flushOnceInternal(allowClosed bool) (err error) {
|
||||
cycleStart := time.Now()
|
||||
store := f.store
|
||||
// A store opened for chunk use drains nothing before its chunk layer
|
||||
// attaches: the dirty blocks stay in the WAL (replayed again after a
|
||||
// crash) and are served from the dirty map; the first drain after
|
||||
// attach marks them local (OnExtentWrite). This includes the final
|
||||
// flush of a stop.
|
||||
if store.drainHeld.Load() {
|
||||
return nil
|
||||
}
|
||||
if err := store.stickyIOFault(); err != nil {
|
||||
return err // no checkpoint advance after a failed fsync
|
||||
}
|
||||
@@ -175,11 +170,25 @@ func (f *flusher) flushOnceInternal(allowClosed bool) (err error) {
|
||||
return fmt.Errorf("flusher: pressure WAL sync: %w", err)
|
||||
}
|
||||
|
||||
if f.beforeSnapshotForTest != nil {
|
||||
f.beforeSnapshotForTest()
|
||||
}
|
||||
store.mu.RLock()
|
||||
if store.closed && !allowClosed {
|
||||
store.mu.RUnlock()
|
||||
return nil
|
||||
}
|
||||
// A store opened for chunk use drains nothing before its chunk layer
|
||||
// attaches: the dirty blocks stay in the WAL (replayed again after a
|
||||
// crash) and are served from the dirty map; the first drain after
|
||||
// attach marks them local (OnExtentWrite). This includes the final
|
||||
// flush of a stop. Checked under store.mu, with the snapshot: the owner
|
||||
// sets the hold before Recover, which takes store.mu, so a cycle that
|
||||
// started before the hold and snapshots the recovered dirty map sees it.
|
||||
if store.drainHeld.Load() {
|
||||
store.mu.RUnlock()
|
||||
return nil
|
||||
}
|
||||
snapshotStart := time.Now()
|
||||
// Hold the publication lock across all shards: a later shard must not
|
||||
// include a write whose predecessor was omitted from an earlier shard.
|
||||
|
||||
@@ -343,6 +343,12 @@ func (s *WALStore) writeExtentIfCurrent(lba, expectedLSN uint64, data []byte) (b
|
||||
}
|
||||
|
||||
func (s *WALStore) writeExtentUnlocked(lba uint32, data []byte) error {
|
||||
// Backstop for INV-CHUNK-LOCAL-BEFORE-FETCH-001: a store awaiting its
|
||||
// chunk layer writes no extent block, so a writer that escapes the
|
||||
// held drain fails loudly instead of leaving a block not marked local.
|
||||
if s.drainHeld.Load() && s.chunk.Load() == nil {
|
||||
return fmt.Errorf("%w: extent write of LBA %d", ErrDrainHeldForChunkLayer, lba)
|
||||
}
|
||||
off := int64(s.extentBase + uint64(lba)*uint64(s.sb.BlockSize))
|
||||
if _, err := s.fd.WriteAt(data, off); err != nil {
|
||||
return fmt.Errorf("storage: write extent LBA %d: %w", lba, err)
|
||||
|
||||
@@ -152,7 +152,7 @@ The watermarks are `WALStore.checkpointLSN` (persisted as the superblock's `WALC
|
||||
stateDiagram-v2
|
||||
[*] --> Appended: Write (pwrite, LSN assigned, dirty map)
|
||||
Appended --> Synced: covering Sync (group fsync)
|
||||
Synced --> InExtent: flusher writes extent, fsync
|
||||
Synced --> InExtent: flusher writes extent, fsync (a chunk store: only once its chunk layer is attached, held from before Recover; no BASE while held)
|
||||
InExtent --> Checkpointed: superblock with checkpoint and released tail fsynced
|
||||
Checkpointed --> Reusable: writer may overwrite the released WAL bytes
|
||||
Appended --> Lost: crash before Sync (allowed)
|
||||
@@ -168,6 +168,7 @@ stateDiagram-v2
|
||||
| Replay is last writer wins by LSN | `dirty_map.go` `putAtIfNewer` | `TestWALStoreRecoverLastWriterWinsAcrossScanOrder` (`core/storage/walstore_recovery_lww_test.go`) | yes |
|
||||
| WAL bytes the on-disk superblock still declares retained are never reused | `wal_writer.go` `spaceUsed`, `durableTail`; `walstore.go` `persistCheckpointReleasing` | `TestWALWriterReuseIsBoundedByTheDurableTail`, `TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry` (`core/storage/walstore_persisted_tail_test.go`) | yes |
|
||||
| A checkpoint never passes a synced write that is not yet in the extent | `flusher.go` (whole-map snapshot under the publication lock) | `TestFlusherSnapshotCutPreservesSyncedWrites` (`core/storage/flusher_snapshot_cut_test.go`); `TestWALStoreCheckpointSIGKILLCrashWindows` (`core/storage/walstore_checkpoint_crash_linux_test.go`) | yes |
|
||||
| A chunk store drains no block to the extent before its chunk layer attaches, so a fetched chunk never installs over a replayed write | `flusher.go` `flushOnceInternal` (under the snapshot lock); `walstore.go` `HoldExtentDrainUntilChunkLayer`, `writeExtentUnlocked` (backstop); `durable/provider.go` | `TestReplayedWriteIsNotDrainedBeforeTheChunkLayerAttaches`, `TestACycleStartedBeforeTheHoldDoesNotDrainTheRecoveredWrite` (`core/storage/chunk_replay_before_attach_test.go`) | no |
|
||||
| Synced entries above an intentional LSN gap (a rebuild's frontier jump) are kept | `recovery.go` (replay keyed on the checkpoint, not on a contiguous prefix) | `TestWALStoreRecoverKeepsSyncedEntriesAboveAnUnpersistedFrontierJump` (`core/storage/walstore_recovery_frontier_gap_test.go`) | yes |
|
||||
| A failed checkpoint metadata write neither publishes nor recycles | `persistCheckpointReleasing` | `TestFlusherCheckpointMetadataFailureDoesNotPublishOrRecycle` (`core/storage/walstore_checkpoint_safety_test.go`) | — |
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ Notes:
|
||||
| `INV-CUT-HYDRATION-WAIT-001` | A read command shares its arrival deadline across chunks. A timed-out waiter returns typed pending without cancelling a shared fill. Per-layer worker and distinct-flight limits bound remote work; Close wakes waiters and joins issued fills before storage release. Physical/hash errors remain terminal. | M4 Holder (hydration wait) | `core/storage/chunk_hydration.go`; `core/storage/walstore.go` `ReadContext`; `core/frontend/durable/storage_adapter.go` `readStorageBlock`; `core/frontend/nvme/session.go` `handleRead` | `TestDurableHydration_MultipleChunksShareOneDeadline`, `TestDurableHydration_NVMePreservesPhysicalAndHashErrors`, `TestSessionReadBudgetIncludesQueueResidence`, `TestChunkHydration_QueueAndWorkerLimitsAreBounded`, `TestChunkHydration_CloseWakesCallerAndJoinsUninterruptibleGet`, `TestChunkHydration_ContextlessReadAllowsSlowFill`, `TestChunkHydration_NewGenerationDoesNotJoinStaleGet`, `TestChunkHydration_StaleCompletionKeepsReplacement`, `TestDurableHydration_RMWFenceWinsCallerExpiry` | — | ACTIVE |
|
||||
| `INV-CUT-HYDRATION-PROGRESS-001` | The status reports per volume the HEAD-named chunks still to hydrate (`AbsentChunks`) and the chunks hydrated so far (`Hydration.Completed`, cumulative); a read of an un-hydrated chunk moves both by one, a repeat read neither. Observation only. | M5 hydration (reader; no transition) | `core/storage/chunk_layer.go` `Stats` (`absentHydratable`); `core/storage/chunk_hydration.go` `hydrationWorker` | `TestHydrationProgressCountersFollowFirstReads` (`core/frontend/durable/hydration_progress_test.go`) | — | ACTIVE |
|
||||
| `INV-CUT-READMISS-001` | A block fetched from HEAD after a move is installed only if it does not overwrite a newer local extent version; a newer WAL-only write still wins on reads, and HEAD's value may be installed beneath it as the backing value, which is correct if a crash loses that unsynced write. | M4 Holder (lazy restore) | `core/storage/chunk_layer.go` `OnReadMiss`, `installFetchedBlock`; `core/storage/walstore.go` `readFromExtent` | `TestChunkLayer_WALOnlyOverlapReadNeverReturnsUntouchedZero` (`core/storage/chunk_layer_races_test.go`); `TestWALStore_PostReadMissRechecksWALFormat` (`core/storage/walstore_read_miss_v3_test.go`; real-store v2/v3 dispatch) | — | ACTIVE |
|
||||
| `INV-CHUNK-LOCAL-BEFORE-FETCH-001` | A block that reaches the extent while its chunk is absent is local to the chunk layer before any fetch can install over it: a store opened for chunk use drains nothing to the extent and takes no BASE until its chunk layer attaches. | M4 Holder (lazy restore) | `core/frontend/durable/provider.go` (open and create of `walstore-chunk`, before Recover); `core/storage/walstore.go` `HoldExtentDrainUntilChunkLayer`; `core/storage/flusher.go` `flushOnceInternal` (every drain, the stop's included); `core/storage/base_install_v3.go` `BeginBaseInstall`; `core/storage/chunk_layer.go` `attachChunkLayerImpl` (releases the hold) | `TestReplayedWriteIsNotDrainedBeforeTheChunkLayerAttaches`, `TestAStopBeforeAttachDrainsNothing`, `TestABaseInstallIsRefusedWhileTheDrainIsHeld`, `TestExtentWritersAreEnumerated` (`core/storage/chunk_replay_before_attach_test.go`) | — | ACTIVE |
|
||||
| `INV-CHUNK-LOCAL-BEFORE-FETCH-001` | A block that reaches the extent while its chunk is absent is local to the chunk layer before any fetch can install over it: a store opened for chunk use drains nothing to the extent and takes no BASE until its chunk layer attaches. | M4 Holder (lazy restore) | `core/frontend/durable/provider.go` (open and create of `walstore-chunk`, before Recover); `core/storage/walstore.go` `HoldExtentDrainUntilChunkLayer`, `writeExtentUnlocked` (refuses while held, the backstop); `core/storage/flusher.go` `flushOnceInternal` (every drain, the stop's included, checked with the snapshot under `store.mu`); `core/storage/base_install_v3.go` `BeginBaseInstall`; `core/storage/chunk_layer.go` `attachChunkLayerImpl` (releases the hold) | `TestReplayedWriteIsNotDrainedBeforeTheChunkLayerAttaches`, `TestACycleStartedBeforeTheHoldDoesNotDrainTheRecoveredWrite`, `TestAStopBeforeAttachDrainsNothing`, `TestABaseInstallIsRefusedWhileTheDrainIsHeld`, `TestAHeldStoreRefusesAnyExtentWriteUntilAttached`, `TestExtentWritersAreEnumerated` (`core/storage/chunk_replay_before_attach_test.go`); `TestProviderHoldsTheDrainOfAChunkStoreOnCreateAndOpen` (`core/frontend/durable/provider_drain_hold_test.go`) | — | ACTIVE |
|
||||
| `INV-CUT-TIMER-RESTART-001` | A successful cut of any kind restarts the periodic timer, which runs on in-process monotonic time (a restart starts a fresh schedule; wall-clock steps move nothing). | M5 periodic trigger (before Admit) | `core/frontend/durable/provider_chunk.go` `chunkLoop` | `TestWALStoreChunk_ExplicitCutRestartsTheTimer`, `TestWALStoreChunk_ExplicitCutOverlappingTheTimerRestartsIt` (`core/frontend/durable/provider_chunk_sched_test.go`); `TestCutPolicy_TimerRunsOnObservationTime`, `TestCutPolicy_StaggerPreservesExplicitTimerReset` (`core/frontend/durable/cut_policy_test.go`) | — | ACTIVE |
|
||||
| `INV-CUT-TIMER-SKIP-001` | A periodic cut decided from an older last cut is skipped under the capture lock: no automatic cut follows another within the interval. | M5 periodic trigger (before Admit) | `core/storage/chunk_periodic_cut.go` `CutUnlessCutSince`; `core/frontend/durable/provider_chunk.go` `chunkLoop` | `TestChunkPeriodicCut_SkipsAfterANewerCut`, `TestChunkPeriodicCut_SkipsANewerCutWithAnOlderStamp` (`core/storage/chunk_periodic_cut_test.go`); `TestWALStoreChunk_ExplicitCutOverlappingTheTimerRestartsIt` (`core/frontend/durable/provider_chunk_sched_test.go`) | — | ACTIVE |
|
||||
| `INV-CUT-TIMER-SLOT-WAIT-001` | A periodic cut refused because every host cut slot is held is a wait, not a failure: no backoff or minimum spacing; it retries after a random delay under 200 ms that shrinks with lateness, and status reports the wait until any later cut succeeds. Other errors keep the backoff. | M5 periodic trigger (before Admit) | `core/frontend/durable/provider_chunk.go` `cutPolicy.after`, `chunkLoop`; `core/hostlimit/limiter.go` `ErrSlotsHeld` | `TestCutPolicy_HostSlotBusyIsAWaitNotAFailure`, `TestCutPolicy_SuccessDuringSlotWaitDropsTheSlotRetry`, `TestCutWaitSlot_StatusEndsTheWaitAfterALaterCut`, `TestNewSlotDelay_ShrinksWithLateness`, `TestCutPolicy_OneSlotWaitBound` (`core/frontend/durable/cut_policy_test.go`); `TestTimerCutRunsSoonAfterHostSlotFrees`, `TestSlotWaitEndsWithASuccessfulDetachSeal` (`core/frontend/durable/host_slot_wait_test.go`); `TestAdmitClosedDuringPoolAcquisitionIsRevoked` (`core/hostlimit/limiter_test.go`) | — | ACTIVE |
|
||||
|
||||
Reference in new issue
Block a user