From c300cf3173dfa6fc9dd303963cd78a9c07531670 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 03:28:29 -0800 Subject: [PATCH 1/2] F1 restore targets are placement only Each round's restore target was listed with size_bytes, so blockmaster created it as an ordinary volume and the restore into it was refused (target_exists: bound to another restore request). Targets now carry their placement only and their restore creates them; sources are unchanged. Co-Authored-By: Claude Opus 5.5 --- .../blockvolume/snapshot_ladder_f1_integration_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go b/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go index 0cf2cb6ad6..4e8ccbb2ef 100644 --- a/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go +++ b/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go @@ -215,10 +215,12 @@ func f1StartEnv(t *testing.T, cfg f1Config) (*handoffEnv, *daemon) { for i := 1; i <= cfg.Volumes; i++ { add(fmt.Sprintf("v%d", i), fmt.Sprintf("v%d", i), i) } + targets := map[string]bool{} for r := 1; r <= cfg.Rounds; r++ { for i := 1; i <= cfg.Volumes; i++ { v := f1RestoreTarget(i, r) add(v, v, i+cfg.Volumes*r) + targets[v] = true } } var vols strings.Builder @@ -229,7 +231,11 @@ func f1StartEnv(t *testing.T, cfg f1Config) (*handoffEnv, *daemon) { sort.Strings(keys) for _, k := range keys { b := env.hosts[k] - fmt.Fprintf(&vols, " - id: %s\n size_bytes: 268435456\n replication_factor: 1\n placements:\n - server_id: s1\n replica_id: %s\n", b.volume, b.replica) + size := " size_bytes: 268435456\n" + if targets[k] { + size = "" // a restore target: placement only, its restore creates it + } + fmt.Fprintf(&vols, " - id: %s\n%s replication_factor: 1\n placements:\n - server_id: s1\n replica_id: %s\n", b.volume, size, b.replica) } spec := filepath.Join(h.dir, "cluster-spec.yaml") must(os.WriteFile(spec, []byte(fmt.Sprintf("nodes:\n - server_id: s1\n data_addr: %s\n ctrl_addr: %s\nvolumes:\n%s", h.dataAddr, h.ctrlAddr, vols.String())), 0o644)) From a4db4270b33d1865f532bf44341b2546b9a80b9e Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 03:28:30 -0800 Subject: [PATCH 2/2] C3 kill: fill progress lost to a kill is not a failure A chunk made local is recorded in the store at its next checkpoint, so a kill shortly after a fill may leave that chunk absent again; it is fetched again on its next read and no data is lost. The test no longer requires fill progress to survive the kill (it logs it) and keeps every data check: no partly filled chunk is served, and every acknowledged write survives. Co-Authored-By: Claude Opus 5.5 --- .../snapshot_ladder_c3kill_integration_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/snapshot_ladder_c3kill_integration_test.go b/seaweed-block/cmd/blockvolume/snapshot_ladder_c3kill_integration_test.go index 070d0fe644..916f446a9b 100644 --- a/seaweed-block/cmd/blockvolume/snapshot_ladder_c3kill_integration_test.go +++ b/seaweed-block/cmd/blockvolume/snapshot_ladder_c3kill_integration_test.go @@ -184,9 +184,10 @@ func (env *handoffEnv) awaitFill(t *testing.T, target string, r *fillReader, bas // (SIGKILL) while chunks are being made local. v1 fills a restore target only // on access, so a reader drives the fill. // -// 1. Killed with some chunks local and some not, then started again: what -// was local survives (fewer than 32 absent). Every other chunk is read -// back: each is the snapshot's (a partly filled chunk is never served). +// 1. Killed with some chunks local and some not, then started again (fill +// progress not yet written at a checkpoint may be lost: those chunks +// are fetched again). Every other chunk is read back: each is the +// snapshot's (a partly filled chunk is never served). // 2. The guest writes (acknowledged); killed again while a fill is running // and restarted, every acknowledged write reads back. // 3. The guest writes once more and every chunk is made local (no chunk @@ -219,9 +220,10 @@ func TestSnapshotLadderC3KilledHydrating(t *testing.T) { reader.stop() t.Logf("killed with %d of %d chunks absent", absent, len(chunks)) target = env.startTarget(t, "v2", "blockvolume-v2-after-fill-kill") - if after := kzReadStats(t, env.hosts["n-v2"]).AbsentChunks; after >= len(chunks) { - t.Fatalf("after the restart %d of %d chunks are absent: nothing made local survived the kill", after, len(chunks)) - } + // Fill progress is written at the store's next checkpoint, so a kill + // may lose some or all of it (standalone-deployment.md, restore step 4): + // such chunks are absent again and are fetched again on their next read. + t.Logf("after the restart %d of %d chunks are absent", kzReadStats(t, env.hosts["n-v2"]).AbsentChunks, len(chunks)) var even []uint64 for c := uint64(0); c < 32; c += 2 { even = append(even, c)