mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
Merge #640's branch at its newest head into ci/process-level-tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
584ce5e67a
2 files changed
+15
-7
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user