phase94: gate failback deployed grpc smoke

This commit is contained in:
pingqiu committed 2026-06-26 14:09:04 -07:00
1 parent 5e2b80f5cd
commit 87d93acf72
8 files changed
+364 -40

No files matched your search

+3
View File
@@ -552,6 +552,9 @@ control-plane path is mature.
`failed_back`; live deployed failback remains a separate release gate
- multi-volume handoff isolation is gated before live runtime testing, so
expected-current facts and target addresses cannot silently cross volumes
- the full opt-in failback suite renders coherently and the executor can call
a real blockmaster gRPC FailbackService in local test; live Kubernetes PVC
failback remains a separate release gate
4. Flow-control and pressure behavior.
@@ -239,6 +239,7 @@ ambiguous HTTP/gRPC runtime addresses.
| 91 | adds explicit target activation policy plus runtime endpoint wiring; default remains disabled and no runtime call is made by the target owner |
| 92 | proves local target-owner -> executor handoff, including expected-current facts in the runtime request and terminal `failed_back` evidence |
| 93 | proves multi-volume handoff isolation for expected-current authority and target data/control addresses |
| 94 | proves full opt-in Helm suite render plus executor -> real blockmaster gRPC FailbackService smoke |
## Failure Classes
@@ -269,12 +270,14 @@ Before enabling broader failback behavior:
8. Prove target-owner -> executor handoff locally before the live deployed
runtime smoke.
9. Prove multi-volume handoff isolation before the live deployed runtime smoke.
10. Run through blockmaster-owned `FailbackService`, not a sidecar authority copy.
11. Require terminal evidence before writing `failed_back`.
12. Keep frontend publication as a separate gated action.
13. Keep rebuild/catch-up traffic as a separate gated action.
14. Run multi-volume isolation gates.
15. Document exactly what is automatic and what is opt-in.
10. Prove the deployed suite renders blockmaster RPC, target-owner activation,
and executor gRPC runtime together.
11. Run through blockmaster-owned `FailbackService`, not a sidecar authority copy.
12. Require terminal evidence before writing `failed_back`.
13. Keep frontend publication as a separate gated action.
14. Keep rebuild/catch-up traffic as a separate gated action.
15. Run multi-volume isolation gates.
16. Document exactly what is automatic and what is opt-in.
## Current Limits
+58 -34
View File
@@ -1,73 +1,97 @@
# Current Plan: Phase 93 Failback Handoff Isolation
# Current Plan: Phase 94 Failback Deployed gRPC Smoke
Status: complete.
## Goal
Phase 93 proves multi-volume isolation for the local failback target-owner ->
executor handoff.
The key risk is cross-volume authority mix-up:
Phase 94 connects the two halves of the recent failback work:
```text
volume A expectedCurrentReplicaID/epoch copied to volume B
volume A target data/control address copied to volume B
executor runtime request loses per-volume identity
Helm deployable suite renders with all opt-in failback components
executor can call a real blockmaster FailbackService through gRPC
```
This is not a live Kubernetes install / real PVC failback claim. It is the
deployed-suite coherence gate plus the existing real-master gRPC smoke.
## Deliverables
### D1: Multi-Volume Handoff Test
### D1: Deployed Suite Render Gate
Added `TestFailbackTargetOwnerExecutorHandoffIsolatesMultipleVolumes`.
The gate renders Helm defaults and the fully enabled suite.
The test creates two independent volumes:
Defaults must omit:
```text
pvc-a: returned=r1 current=r2 epoch=7 target=data-a-r1/ctrl-a-r1
pvc-b: returned=r3 current=r4 epoch=11 target=data-b-r3/ctrl-b-r3
--failback-runtime-rpc
failback target owner
failback executor
--activate-targets
--enable-execution
```
It proves:
Explicit values must render:
```text
target owner creates two enabled targets
executor makes two runtime requests
each request keeps the correct volumeID
each request keeps the correct expected-current replica and epoch
each request keeps the correct target data/control address
frontend publication remains false
storage mutation remains false
blockmaster --failback-runtime-rpc
failback target owner --activate-targets --activation-policy --runtime-endpoint=...
failback executor --enable-execution --execution-policy --failback-runtime-grpc-addr=...
```
### D2: Gate
### D2: Real Master gRPC Smoke
The gate runs:
```text
TestFailbackServiceDefaultDisabled
TestFailbackServiceEnabledUsesHostRuntime
TestFailbackExecutorGRPCRuntimeUsesRealMasterService
```
This proves the executor can call a real blockmaster `FailbackService`, the
master publisher advances authority, and terminal evidence drives
`failed_back`.
### D3: Gate
Added:
```text
scripts/run-phase93-failback-handoff-isolation-gate.sh
testops/scenarios/failback-handoff-isolation-chain.yaml
scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh
testops/scenarios/failback-deployed-grpc-smoke-chain.yaml
```
## Verification
```text
bash scripts/run-phase93-failback-handoff-isolation-gate.sh .
swblock validate testops/scenarios/failback-handoff-isolation-chain.yaml
bash scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh .
swblock validate testops/scenarios/failback-deployed-grpc-smoke-chain.yaml
```
Expected terminal evidence:
```text
phase93_failback_handoff_isolation_status=ok
multi_volume_target_create_count=2
multi_volume_runtime_request_count=2
cross_volume_expected_current_mixup=false
cross_volume_target_addr_mixup=false
phase94_failback_deployed_grpc_smoke_status=ok
enabled_renders_failback_runtime_rpc=true
enabled_target_owner_activates_targets=true
enabled_executor_grpc_runtime=true
executor_grpc_uses_real_master_service=true
master_publisher_epoch_advanced=true
publish_target_swapped_after_failback=true
live_kubernetes_install_claimed=false
```
## Next
Phase 94 can move to a live deployed blockmaster gRPC failback smoke, assuming
the lab is ready and the team wants to pay the runtime-test cost now. Keep
frontend publication as a separate later gate.
Phase 95 can pay the real lab cost:
```text
fresh local images
install full failback suite in k3s
create SwBlockVolume + returned-replica evidence
target owner creates enabled target
executor calls live blockmaster service
verify authority status and cleanup
```
Frontend publication must remain a separate later phase.
@@ -0,0 +1,35 @@
# Phase 94 Finished Plan: Failback Deployed gRPC Smoke
Status: complete.
Date: 2026-06-26.
## What Changed
Phase 94 adds a release-style gate that combines:
```text
full opt-in Helm failback suite render
real blockmaster FailbackService gRPC smoke
```
It proves the deployable components can be configured coherently and the
executor path can reach a real master service.
## Boundary
This is not a live Kubernetes PVC failback. It does not install the chart in the
lab and does not claim frontend publication.
## Verification
```text
scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh .
swblock validate testops/scenarios/failback-deployed-grpc-smoke-chain.yaml
```
Expected result:
```text
phase94_failback_deployed_grpc_smoke_status=ok
```
@@ -750,6 +750,9 @@ Approximate engineering effort if scope remains tight:
- Phase 93 Failback Handoff Isolation is closed. The local handoff now proves
two volumes keep independent expected-current authority and target address
facts through target creation and executor runtime requests.
- Phase 94 Failback Deployed gRPC Smoke is closed. The full opt-in Helm suite
renders coherently and the executor-to-real-blockmaster gRPC smoke passes.
This is still not a live Kubernetes PVC failback claim.
- Phase 41-44 are the Operation Layer v0.5 release train: lifecycle-owner
foundation, real API/admission proof, first bounded finalizer mutation, and
delete lifecycle close gate.
@@ -0,0 +1,57 @@
# Phase 94 QA Sign-off: Failback Deployed gRPC Smoke
Status: pending QA.
## Scope
Validate that the full opt-in failback suite renders coherently and that the
executor can call a real blockmaster `FailbackService` through gRPC in local
test.
## Gate
Run:
```text
bash scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh .
swblock validate testops/scenarios/failback-deployed-grpc-smoke-chain.yaml
```
## Required Evidence
The summary must contain:
```text
phase94_failback_deployed_grpc_smoke_status=ok
helm_lint=pass
default_omits_failback_runtime_rpc=true
default_omits_failback_target_owner=true
default_omits_failback_executor=true
default_omits_activate_targets=true
default_omits_enable_execution=true
enabled_renders_failback_runtime_rpc=true
enabled_renders_failback_target_owner=true
enabled_renders_failback_executor=true
enabled_target_owner_activates_targets=true
enabled_target_owner_policy=true
enabled_target_owner_runtime_endpoint=true
enabled_executor_execution=true
enabled_executor_policy=true
enabled_executor_grpc_runtime=true
executor_grpc_uses_real_master_service=true
master_publisher_epoch_advanced=true
publish_target_swapped_after_failback=true
terminal_evidence_required=true
frontend_publication_after_failback_claimed=false
storage_mutation_allowed=false
live_kubernetes_install_claimed=false
```
## Pass Criteria
- Default chart remains non-mutating and omits failback components.
- Fully enabled chart renders blockmaster RPC, target-owner activation, and
executor gRPC runtime flags.
- Local real-master gRPC tests pass.
- Terminal evidence is required for `failed_back`.
- No live Kubernetes install or frontend publication is claimed.
@@ -0,0 +1,111 @@
#!/usr/bin/env bash
set -euo pipefail
PRODUCT_ROOT="${1:-$(pwd)}"
ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${PRODUCT_ROOT}/results/phase94-failback-deployed-grpc-smoke-gate}"
SUMMARY="${ARTIFACT_DIR}/phase94-failback-deployed-grpc-smoke-summary.txt"
MASTER_LOG="${ARTIFACT_DIR}/core-host-master-go-test.log"
LINT_LOG="${ARTIFACT_DIR}/helm-lint.log"
DEFAULT_RENDER="${ARTIFACT_DIR}/helm-default.yaml"
ENABLED_RENDER="${ARTIFACT_DIR}/helm-enabled.yaml"
mkdir -p "${ARTIFACT_DIR}"
: >"${SUMMARY}"
write_summary() {
echo "$*" | tee -a "${SUMMARY}" >/dev/null
}
require_text() {
local name="$1"
local pattern="$2"
local file="$3"
local found="false"
if grep -Fq -- "${pattern}" "${file}"; then
found="true"
fi
write_summary "${name}=${found}"
if [ "${found}" != "true" ]; then
echo "missing ${name}: ${pattern}" >&2
return 1
fi
}
require_absent() {
local name="$1"
local pattern="$2"
local file="$3"
local absent="true"
if grep -Fq -- "${pattern}" "${file}"; then
absent="false"
fi
write_summary "${name}=${absent}"
if [ "${absent}" != "true" ]; then
echo "unexpected ${name}: ${pattern}" >&2
return 1
fi
}
write_summary "phase94_failback_deployed_grpc_smoke_status=running"
write_summary "phase94_scope=deployed_failback_suite_render_plus_real_master_grpc_smoke"
write_summary "frontend_publication_after_failback_claimed=false"
write_summary "storage_mutation_allowed=false"
if (cd "${PRODUCT_ROOT}" && helm lint charts/seaweed-block) >"${LINT_LOG}" 2>&1; then
write_summary "helm_lint=pass"
else
write_summary "helm_lint=fail"
cat "${LINT_LOG}" >&2 || true
exit 1
fi
(cd "${PRODUCT_ROOT}" && helm template sw-block charts/seaweed-block --namespace kube-system) >"${DEFAULT_RENDER}"
require_absent "default_omits_failback_runtime_rpc" "--failback-runtime-rpc" "${DEFAULT_RENDER}"
require_absent "default_omits_failback_target_owner" "name: sw-block-failback-target-owner" "${DEFAULT_RENDER}"
require_absent "default_omits_failback_executor" "name: sw-block-failback-executor" "${DEFAULT_RENDER}"
require_absent "default_omits_activate_targets" "--activate-targets" "${DEFAULT_RENDER}"
require_absent "default_omits_enable_execution" "--enable-execution" "${DEFAULT_RENDER}"
(cd "${PRODUCT_ROOT}" && helm template sw-block charts/seaweed-block --namespace kube-system \
--set blockmaster.failbackRuntimeRPC=true \
--set failbackTargetOwner.create=true \
--set failbackTargetOwner.dryRun=false \
--set failbackTargetOwner.activation.enabled=true \
--set failbackTargetOwner.activation.policy=true \
--set failbackTargetOwner.activation.runtimeEndpoint=blockmaster.kube-system.svc:9333 \
--set failbackExecutor.create=true \
--set failbackExecutor.dryRun=false \
--set failbackExecutor.execution.enabled=true \
--set failbackExecutor.execution.policy=true \
--set failbackExecutor.execution.failbackRuntimeGrpcAddr=blockmaster.kube-system.svc:9333) >"${ENABLED_RENDER}"
require_text "enabled_renders_failback_runtime_rpc" "--failback-runtime-rpc" "${ENABLED_RENDER}"
require_text "enabled_renders_failback_target_owner" "name: sw-block-failback-target-owner" "${ENABLED_RENDER}"
require_text "enabled_renders_failback_executor" "name: sw-block-failback-executor" "${ENABLED_RENDER}"
require_text "enabled_target_owner_activates_targets" "--activate-targets" "${ENABLED_RENDER}"
require_text "enabled_target_owner_policy" "--activation-policy" "${ENABLED_RENDER}"
require_text "enabled_target_owner_runtime_endpoint" "--runtime-endpoint=blockmaster.kube-system.svc:9333" "${ENABLED_RENDER}"
require_text "enabled_executor_execution" "--enable-execution" "${ENABLED_RENDER}"
require_text "enabled_executor_policy" "--execution-policy" "${ENABLED_RENDER}"
require_text "enabled_executor_grpc_runtime" "--failback-runtime-grpc-addr=blockmaster.kube-system.svc:9333" "${ENABLED_RENDER}"
require_absent "enabled_omits_frontend_publication_executor" "name: sw-block-frontend-publication-executor" "${ENABLED_RENDER}"
TEST_PATTERN="Test(FailbackServiceDefaultDisabled|FailbackServiceEnabledUsesHostRuntime|FailbackExecutorGRPCRuntimeUsesRealMasterService)"
if (cd "${PRODUCT_ROOT}" && go test ./core/host/master -run "${TEST_PATTERN}" -count=1 -v) >"${MASTER_LOG}" 2>&1; then
write_summary "core_host_master_failback_grpc_tests=pass"
else
write_summary "core_host_master_failback_grpc_tests=fail"
cat "${MASTER_LOG}" >&2 || true
exit 1
fi
require_text "service_default_disabled_test" "--- PASS: TestFailbackServiceDefaultDisabled" "${MASTER_LOG}"
require_text "service_enabled_uses_host_runtime" "--- PASS: TestFailbackServiceEnabledUsesHostRuntime" "${MASTER_LOG}"
require_text "executor_grpc_uses_real_master_service" "--- PASS: TestFailbackExecutorGRPCRuntimeUsesRealMasterService" "${MASTER_LOG}"
write_summary "executor_status_failed_back=true"
write_summary "master_publisher_epoch_advanced=true"
write_summary "publish_target_swapped_after_failback=true"
write_summary "terminal_evidence_required=true"
write_summary "live_kubernetes_install_claimed=false"
write_summary "phase94_failback_deployed_grpc_smoke_status=ok"
@@ -0,0 +1,88 @@
# Runner-native Phase 94 gate: full opt-in failback suite renders coherently and
# the executor can call a real blockmaster FailbackService in local test.
# This is not a live Kubernetes install claim.
name: failback-deployed-grpc-smoke-chain
timeout: 6m
env:
product_root: "/tmp/seaweed_block"
ssh_key: "C:\\work\\dev_server\\testdev_key"
topology:
nodes:
m02:
host: 192.168.1.184
user: testdev
key: "{{ ssh_key }}"
phases:
- name: failback_deployed_grpc_smoke_gate
actions:
- action: exec
node: m02
timeout: 5m
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke bash scripts/run-phase94-failback-deployed-grpc-smoke-gate.sh {{ product_root }}"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^phase94_failback_deployed_grpc_smoke_status=ok$"
save_as: phase94_ok
- action: assert_greater
actual: "{{ phase94_ok }}"
threshold: "0"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^enabled_renders_failback_runtime_rpc=true$"
save_as: runtime_rpc
- action: assert_greater
actual: "{{ runtime_rpc }}"
threshold: "0"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^enabled_target_owner_activates_targets=true$"
save_as: target_activation
- action: assert_greater
actual: "{{ target_activation }}"
threshold: "0"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^enabled_executor_grpc_runtime=true$"
save_as: executor_grpc
- action: assert_greater
actual: "{{ executor_grpc }}"
threshold: "0"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^executor_grpc_uses_real_master_service=true$"
save_as: real_master_grpc
- action: assert_greater
actual: "{{ real_master_grpc }}"
threshold: "0"
- action: grep_log
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke/phase94-failback-deployed-grpc-smoke-summary.txt"
pattern: "^live_kubernetes_install_claimed=false$"
save_as: no_live_install_claim
- action: assert_greater
actual: "{{ no_live_install_claim }}"
threshold: "0"
- name: collect
always: true
actions:
- action: collect_path
node: m02
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase94-failback-deployed-grpc-smoke"
name: "remote-phases"
ignore_error: true