From 52f87933282776cc42e99d3fc05af07051e9c34a Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 25 Nov 2026 18:09:03 -0800 Subject: [PATCH] docs: who may fail over through the alpha executor, its admin certificate limit, and that the request flags are not evidence Co-Authored-By: Claude Opus 5.5 --- seaweed-block/cmd/sw-block/failover.go | 11 +++++++---- .../deploy/k8s/alpha/failback-executor.yaml | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/seaweed-block/cmd/sw-block/failover.go b/seaweed-block/cmd/sw-block/failover.go index 453a344795..9df0b2e0ea 100644 --- a/seaweed-block/cmd/sw-block/failover.go +++ b/seaweed-block/cmd/sw-block/failover.go @@ -33,8 +33,9 @@ The operator's failover of volume V's primary to replica R, for a standalone (systemd) deployment. blockmaster decides: when the current primary is unreachable it runs the fencing round (every other replica fenced at E+1) and moves the line only to a ready replica holding the highest fenced end; a -reachable primary's move is a planned move under its guard. A refusal changes -nothing. +reachable primary's move is a planned move under its guard. --target-data +and --target-ctrl must be blockmaster's record of the replica (its heartbeat); +other addresses are refused. A refusal changes nothing. The fencing round stops the old primary's writes, not its reads: power the old node off or cut it from its clients first, then confirm with @@ -88,8 +89,10 @@ func runOpsFailover(args []string, stdout, stderr io.Writer) int { TargetCtrlAddr: ctrl, ExpectedCurrentReplicaID: curReplica, ExpectedCurrentEpoch: curEpoch, - // The operator's assertions the runtime requires; blockmaster's gate - // (the fencing round for an unreachable primary) decides the move. + // Required by the runtime but decide nothing (they are not evidence): + // blockmaster's gate (the fencing round for an unreachable primary) + // decides the move, and the target is published at blockmaster's own + // record of its addresses (a request naming others is refused). AckEligible: true, FrontendFencedBeforeFailback: true, // --confirm-old-node-off DurableFrontierCovered: true, diff --git a/seaweed-block/deploy/k8s/alpha/failback-executor.yaml b/seaweed-block/deploy/k8s/alpha/failback-executor.yaml index ff5b9a7946..dcdd371124 100644 --- a/seaweed-block/deploy/k8s/alpha/failback-executor.yaml +++ b/seaweed-block/deploy/k8s/alpha/failback-executor.yaml @@ -3,6 +3,23 @@ # admin-only ExecuteFailback over mutual TLS (client Secret # sw-block-failback-executor-tls from scripts/k8s-alpha-certs.sh). The CRD is # charts/seaweed-block/crds/swblockreplicafailbacks.block.seaweedfs.com.yaml. +# +# Who may fail over: the executor holds a full admin client certificate and +# executes what a SwBlockReplicaFailback object says, so the right to create or +# change those objects in kube-system IS the right to fail over any volume. +# Grant it only to the cluster administrators who would run +# `sw-block ops failover` by hand. blockmaster still decides every move (the +# fencing round for an unreachable primary) and publishes the target at its +# own record of the replica's addresses, never the object's. +# +# The object field that asserts the old primary's frontend is fenced +# (frontendFencedBeforeFailback) is the operator's confirmation that the old +# node is off or cut from its clients (the fencing round stops its writes, +# not its reads). Automation must never set it. +# +# Limit, dated 2026-11-26: the certificate carries the admin role although the +# executor makes one call (ExecuteFailback); a role limited to that call is +# not in this release. apiVersion: v1 kind: ServiceAccount metadata: