From 86d4eb6c94603ec31eefb03c946d6d04dc9ff031 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 16 Nov 2026 19:49:08 -0800 Subject: [PATCH] fix(master): prove frontier coverage before an RF3 promotion (docs, gofmt) State the survivor rule for an unknown required frontier in the design doc and keep the missing acknowledged-frontier source as a known gap. Co-Authored-By: Claude Opus 5.5 --- .../core/host/master/promotion_frontier_coverage_test.go | 2 +- seaweed-block/docs/design/kubernetes-block-design.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/seaweed-block/core/host/master/promotion_frontier_coverage_test.go b/seaweed-block/core/host/master/promotion_frontier_coverage_test.go index 8bc3269f25..c134b7063e 100644 --- a/seaweed-block/core/host/master/promotion_frontier_coverage_test.go +++ b/seaweed-block/core/host/master/promotion_frontier_coverage_test.go @@ -20,7 +20,7 @@ func TestUnknownFrontierSurvivorsNeeded(t *testing.T) { }{ {"sync-quorum", 2, 2}, // RF3: K=1, every acked write is on >=1 of 2 peers {"sync_quorum", 2, 2}, - {"sync-all", 2, 1}, // RF3: K=2, every acked write is on both peers + {"sync-all", 2, 1}, // RF3: K=2, every acked write is on both peers {"sync-quorum", 4, 3}, // RF5: K=2 {"sync-all", 4, 1}, } { diff --git a/seaweed-block/docs/design/kubernetes-block-design.md b/seaweed-block/docs/design/kubernetes-block-design.md index 0489c71b02..184bdf81e2 100644 --- a/seaweed-block/docs/design/kubernetes-block-design.md +++ b/seaweed-block/docs/design/kubernetes-block-design.md @@ -208,7 +208,7 @@ The volume computes whether it may become primary; blockmaster decides; only the | 5 | `post_close_durable_ack_needed` | a recovered replica has not delivered its post-rebuild durable acknowledgement | | 6 | `promotion_ready` | all checks pass | -**RF=3 gate** (`core/host/master/promotion_probe.go`, `promotionAllowedReplicas`, `chooseAllowedPromotionTarget`): no promotion when the probe failed or is not installed, or the ack profile is unknown; a candidate is skipped when it is not `replica_ready` with a known frontier, or its durable LSN is below the required frontier. The decision is recorded as an ops event (`candidate_covers_required_frontier`, `candidate_frontier_behind`, `no_promotion_ready_candidate`). The required frontier per volume (`RequiredLSNByVolume`) is not set by `cmd/blockmaster` today, so the effective rule is "ready, highest durable LSN" (§12). +**RF=3 gate** (`core/host/master/promotion_probe.go`, `promotionAllowedReplicas`, `chooseAllowedPromotionTarget`): no promotion when the probe failed or is not installed, or the ack profile is unknown; a candidate is skipped when it is not `replica_ready` with a known frontier, or its durable LSN is below the required frontier. The decision is recorded as an ops event (`candidate_covers_required_frontier`, `candidate_frontier_behind`, `no_promotion_ready_candidate`). The required frontier per volume (`RequiredLSNByVolume`) is not set by `cmd/blockmaster` today, so the frontier is unknown and coverage is proven from the survivors instead: with `sync_quorum` or `sync_all`, the ready candidate with the highest durable LSN is promoted only when at least P-K+1 of the P peers are probed ready (known durable LSN) and have a fresh heartbeat, where K is the number of peer acks a write needs (`waitForSyncAcks`: P for `sync_all`, (P+1)/2 for `sync_quorum`). Any P-K+1 peers include one that holds every acknowledged write. For RF=3 that is both peers under `sync_quorum` and one under `sync_all`; with fewer, nothing is promoted. An unknown frontier is never read as zero. `best_effort` is unchanged (§12). **What blocks a promotion:** any engine reason above; `unhealthy_reason` set or withdrawn; an unreachable or ineligible server; boot grace still holding; a current primary whose probe is ready; a snapshot rejected for slot count; slots that changed while the probe ran. @@ -305,7 +305,7 @@ These are found by reading the code at this revision; most are tracked for fixes - **No primary lease on the Kubernetes path.** A primary cut off from blockmaster keeps admitting I/O under its last assignment until it observes a newer one. The replicas' epoch floors refuse its shipped frames, which fails its `Sync` under `sync_quorum` or `sync_all`; under best-effort, the chart default, its local `fsync` still acknowledges. Its frontend also keeps reporting Active/Optimized, so a node that still reaches it may keep using that path. The workspace lease (`--workspace-lease`) requires `walstore-chunk` and is not rendered for Kubernetes volumes. - **Synchronous durability needs two settings.** `replication.ackProfile` reaches blockvolume only with `compat.launcherReplicationAckFlag: true`. -- **The RF=3 required frontier is not wired.** `RequiredLSNByVolume` is never set by `cmd/blockmaster`, so promotion picks the ready candidate with the highest durable LSN without checking it against the last acknowledged sync. +- **The RF=3 required frontier is not wired.** `RequiredLSNByVolume` is never set by `cmd/blockmaster`, and the master has no source for it: heartbeats carry no LSN and the master stores no acknowledged LSN. Promotion therefore relies on the survivor rule in §6 (all peers seen under `sync_quorum`), so an RF=3 `sync_quorum` volume with one peer down and its primary lost is not promoted automatically. A real acknowledged-frontier source remains a gap. - **Returned-replica rebuild is not deployable through Helm.** The executor exists, but `--runtime-rebuild-endpoint` is not rendered. - **CSI publish is not fenced per node.** `ControlStatusLookup` ignores the node id. - **The CSI node uses the controller's service account**, with write access to PVs, PVCs and `SwBlockVolume` objects.