Files
seaweedfs/seaweed-block/internal/docs/current-plan.md
T

3.4 KiB

Current Plan: Phase 76 Returned-Replica Failback Executor Boundary

Status: complete.

Goal

Phase 75 created the failback handoff target:

SwBlockReplicaFailback

Phase 76 adds the first executor boundary for that target. The executor can read targets and write SwBlockReplicaFailback.status, but it still cannot execute failback.

This phase is intentionally status-only. It does not advance authority, change the primary, swap publish targets, publish frontend paths, or mutate storage.

Deliverables

D1: Status-Only Failback Executor

Added:

sw-block ops failback-executor

For each target it writes:

state=blocked
reasonCode=failback_policy_disabled
failbackMutationAllowed=false
failbackStarted=false
authorityEpochAdvanced=false
singlePrimaryAfterFailback=false
publishTargetSwappedAfterFailback=false

Invalid targets are also blocked:

reasonCode=missing_required_facts

D2: Kubernetes Status Writer

Added:

WriteReplicaFailbackStatus(...)

The writer patches only:

swblockreplicafailbacks/status

It never patches spec, finalizers, Events, workloads, storage objects, or frontend publication resources.

D3: Helm Packaging + RBAC

Added disabled-by-default packaging:

failbackExecutor.create=false
failbackExecutor.dryRun=true

RBAC is status-only:

swblockreplicafailbacks: get,list,watch
swblockreplicafailbacks/status: get,update,patch

D4: Gate

Added:

scripts/run-phase76-failback-executor-boundary-gate.sh
testops/scenarios/failback-executor-boundary-chain.yaml

The gate proves:

failback executor writes disabled/blocked status
dry-run writes no status
invalid targets are blocked
status writer uses /status
RBAC is status-only
failback_attempts=0
authority_mutation_allowed=false
frontend_publication_allowed=false
storage_mutation_allowed=false

Non-Claims

Phase 76 does not implement:

real failback execution
authority epoch mutation
primary reassignment
publish-target swap
frontend publication
blockvolume frontend switching
storage/workload mutation
NVMe ANA behavior

Verification

go test ./core/ops -run "TestFailbackExecutor|TestPhase76|TestKubernetesStatusClientPatchesOnlyStatusSubresources" -count=1 -v
go test ./cmd/sw-block -run "TestOpsFailbackExecutor|TestOpsFailbackTargetOwner" -count=1 -v
go test ./core/ops ./cmd/sw-block
helm lint charts/seaweed-block
helm template sw-block charts/seaweed-block --set failbackExecutor.create=true
"C:\Program Files\Git\bin\bash.exe" scripts/run-phase76-failback-executor-boundary-gate.sh .
C:\work\swblock.exe validate testops\scenarios\failback-executor-boundary-chain.yaml

Terminal evidence:

phase76_failback_executor_boundary_status=ok
core_ops_failback_executor_tests=pass
cmd_failback_executor_tests=pass
failback_executor_writes_disabled_status=true
failback_executor_dry_run_no_status_write=true
kubernetes_writer_failback_status_subresource=true
failback_executor_rbac_status_only=true
failback_attempts=0
authority_mutation_allowed=false
frontend_publication_allowed=false
storage_mutation_allowed=false

Next

The next step is a failback execution preflight/runtime contract. It must remain disabled until it can prove the full terminal evidence: authority ownership, epoch advance, single-primary state, publish-target swap, and cross-volume identity isolation.