From 02fdb71c7d2a87a1026eb0d666816df26025fc55 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 26 Apr 2026 10:37:13 -0700 Subject: [PATCH] blockmaster: --expected-slots-per-volume flag (was hardcoded 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cmd/blockmaster/main.go hardcoded ExpectedSlotsPerVolume: 3 in the TopologyControllerConfig. The TopologyController's validateVolumeTopology rejects every observation snapshot whose slot count differs from this value, returning an error from SubmitObservedState that propagates back to the observation host without a master-log line. Result with a 2-node smoke topology (m01-primary + m02-replica): master is silent, no assignments minted, volumes timeout at durable open with frontend.ErrNotReady — the symptom QA hit during G5-4 cross-node bring-up. Fix: add --expected-slots-per-volume CLI flag, default 3 (production RF=3 unchanged). 2-node smoke clusters pass --expected-slots-per-volume 2. Long-term refactor (separate ticket): the validator should compare snapshot slot count against the topology's per-volume slot count, not a single global config — that's the real per-volume RF model. Refs: sw-block/design/v3-phase-15-g5-m0102-bringup-answer.md Co-Authored-By: Claude Opus 4.7 (1M context) --- seaweed-block/cmd/blockmaster/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/seaweed-block/cmd/blockmaster/main.go b/seaweed-block/cmd/blockmaster/main.go index bf16f2f0e2..25804d4c6b 100644 --- a/seaweed-block/cmd/blockmaster/main.go +++ b/seaweed-block/cmd/blockmaster/main.go @@ -19,9 +19,10 @@ import ( ) type flags struct { - authorityStore string - listen string - topology string + authorityStore string + listen string + topology string + expectedSlotsPerVol int // printReadyLine: test-only flag that emits a single // structured JSON line to stdout after the gRPC listener is // bound, so L2 subprocess tests can parse the ready event. @@ -35,6 +36,7 @@ func parseFlags(args []string) (flags, error) { fs.StringVar(&f.authorityStore, "authority-store", "", "durable authority store directory (required)") fs.StringVar(&f.listen, "listen", "127.0.0.1:0", "gRPC listen address (e.g. 127.0.0.1:9180)") fs.StringVar(&f.topology, "topology", "", "path to accepted-topology YAML (required for assignment to mint)") + fs.IntVar(&f.expectedSlotsPerVol, "expected-slots-per-volume", 3, "RF/expected slot count per volume; the controller rejects observation snapshots whose slot count differs (default 3, set to 2 for 2-node smoke clusters)") fs.BoolVar(&f.printReadyLine, "t0-print-ready", false, "internal test-only: emit one structured JSON line on stdout after listener bound") fs.SetOutput(os.Stderr) if err := fs.Parse(args); err != nil { @@ -79,7 +81,7 @@ func run(f flags) int { Listen: f.listen, Topology: topo, Freshness: authority.FreshnessConfig{FreshnessWindow: 30 * time.Second, PendingGrace: 1 * time.Second}, - ControllerConfig: authority.TopologyControllerConfig{ExpectedSlotsPerVolume: 3}, + ControllerConfig: authority.TopologyControllerConfig{ExpectedSlotsPerVolume: f.expectedSlotsPerVol}, } h, err := master.New(cfg) if err != nil {