mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
phase110: prove nvme path-loss support surfaces (#61)
This commit is contained in:
1 parent
6c6d61253a
commit
9b4e5876d6
7 files changed
+487
-54
No files matched your search
@@ -640,6 +640,26 @@ func TestPhase109NVMeStatusSurfaceScenarioChecksCRDAndSupportSurfaces(t *testing
|
||||
}
|
||||
}
|
||||
|
||||
func TestPhase110NVMePathLossScenarioChecksSupportSurfaces(t *testing.T) {
|
||||
body := g15dReadFile(t, "testops", "scenarios", "nvme-tcp-path-loss-status-surface-chain.yaml")
|
||||
for _, want := range []string{
|
||||
"phase110_nvme_tcp_path_loss_status_surface_status=ok",
|
||||
"run-nvme-mounted-failover-smoke.sh",
|
||||
"cluster-after-failover.json",
|
||||
"product-observation/cluster-evidence.json",
|
||||
"nvme_multipath_path_missing",
|
||||
"surface_ready_true_count=0",
|
||||
"operator_snapshot_reason=nvme_multipath_path_missing",
|
||||
"dashboard_reason=nvme_multipath_path_missing",
|
||||
"explain_reason=nvme_multipath_path_missing",
|
||||
"mutation_allowed=false",
|
||||
} {
|
||||
if !strings.Contains(body, want) {
|
||||
t.Fatalf("phase110 path-loss scenario missing %q", want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPhase20FirstVolumeScenarioPinsPublishedUserGate(t *testing.T) {
|
||||
body := g15dReadFile(t, "testops", "scenarios", "activation-day1-first-volume-chain.yaml")
|
||||
for _, want := range []string{
|
||||
|
||||
@@ -128,6 +128,50 @@ func TestObservationReportSummaryAndHTMLIncludeManagedVolumeNVMeStatus(t *testin
|
||||
}
|
||||
}
|
||||
|
||||
func TestObservationReportSurfacesNVMeMissingPathWithoutFalseReady(t *testing.T) {
|
||||
cluster := NewClusterEvidence(time.Date(2026, 6, 29, 12, 0, 0, 0, time.UTC))
|
||||
cluster.ManagedVolumes = []ManagedVolumeProjection{ProjectManagedVolume(ManagedVolumeFacts{
|
||||
VolumeID: "pvc-nvme-loss",
|
||||
PVCName: "nvme-pvc",
|
||||
DesiredReplicas: 2,
|
||||
Replicas: []ReplicaFact{{
|
||||
ReplicaID: "r2",
|
||||
Observed: true,
|
||||
Role: "primary",
|
||||
FrontendProtocol: "nvme",
|
||||
FrontendAddr: "127.0.0.1:4421",
|
||||
FrontendNQN: "nqn.2026-05.io.seaweedfs:pvc-nvme-loss",
|
||||
FrontendNSID: 1,
|
||||
}},
|
||||
})}
|
||||
|
||||
summary := RenderObservationReportSummary(cluster)
|
||||
for _, want := range []string{
|
||||
"managed_volume=pvc-nvme-loss status=blocked reason=nvme_multipath_path_missing",
|
||||
"managed_volume_nvme=pvc-nvme-loss nqn=nqn.2026-05.io.seaweedfs:pvc-nvme-loss nsid=1 addr=127.0.0.1:4421 addrs=127.0.0.1:4421 path_count=1 multipath_observed=false reason=nvme_multipath_path_missing",
|
||||
"managed_volume_condition=Ready status=False reason=nvme_multipath_path_missing",
|
||||
"managed_volume_condition=Blocked status=True reason=nvme_multipath_path_missing",
|
||||
} {
|
||||
if !strings.Contains(summary, want) {
|
||||
t.Fatalf("summary missing %q:\n%s", want, summary)
|
||||
}
|
||||
}
|
||||
if strings.Contains(summary, "managed_volume_condition=Ready status=True") {
|
||||
t.Fatalf("summary must not claim Ready=True for missing NVMe path:\n%s", summary)
|
||||
}
|
||||
|
||||
explain := RenderObservationExplainText(cluster)
|
||||
if !strings.Contains(explain, "managed_volume pvc-nvme-loss status=blocked reason=nvme_multipath_path_missing") {
|
||||
t.Fatalf("explain missing blocked reason:\n%s", explain)
|
||||
}
|
||||
if !strings.Contains(explain, "managed_volume_nvme protocol=nvme nqn=nqn.2026-05.io.seaweedfs:pvc-nvme-loss nsid=1 addr=127.0.0.1:4421 addrs=127.0.0.1:4421 path_count=1 multipath_observed=false reason=nvme_multipath_path_missing") {
|
||||
t.Fatalf("explain missing nvme missing-path status:\n%s", explain)
|
||||
}
|
||||
if strings.Contains(explain, "managed_volume_condition Ready status=True") {
|
||||
t.Fatalf("explain must not claim Ready=True for missing NVMe path:\n%s", explain)
|
||||
}
|
||||
}
|
||||
|
||||
func TestObservationReportSurfacesNVMeLoopbackCrossNodeWithoutISCSIAction(t *testing.T) {
|
||||
cluster := NewClusterEvidence(time.Date(2026, 6, 29, 12, 0, 0, 0, time.UTC))
|
||||
cluster.ManagedVolumes = []ManagedVolumeProjection{ProjectManagedVolume(ManagedVolumeFacts{
|
||||
|
||||
@@ -538,6 +538,16 @@ Recommended order from here:
|
||||
`operator-snapshot.json`, dashboard `/operator-snapshot.json`, and
|
||||
`ops explain`. The gate owns its CRD baseline so stale live CRDs cannot
|
||||
silently prune new status fields.
|
||||
68. Phase 110: NVMe/TCP Path-Loss Status Surface Honesty. **Closed
|
||||
2026-06-29, runner PASS**
|
||||
Reused the live mounted NVMe/TCP one-path-loss gate from Phase 101 and
|
||||
replayed its after-failover `cluster-after-failover.json` through the
|
||||
support-bundle surfaces. Report summary, report `operator-snapshot.json`,
|
||||
dashboard `/operator-snapshot.json`, and `ops explain` all preserve
|
||||
`blocked/nvme_multipath_path_missing`, `path_count=1`,
|
||||
`multipath_observed=false`, `mutation_allowed=false`, and zero false
|
||||
`Ready=True`. This is support-surface replay of real standalone path-loss
|
||||
evidence, not a live Kubernetes CRD negative-path-loss claim.
|
||||
|
||||
The internal release-train contract is
|
||||
`internal/docs/ref/operation-layer-v0.5-release-train.md`. Phases 41-44 close
|
||||
|
||||
@@ -1,94 +1,112 @@
|
||||
# Current Plan: Phase 109 NVMe/TCP Status Surface Evidence
|
||||
# Current Plan: Phase 110 NVMe/TCP Path-Loss Status Surface Honesty
|
||||
|
||||
Status: closed.
|
||||
|
||||
QA run `20260629-161917-a0ef` passed 22/22 actions. Sign-off:
|
||||
`internal/docs/qa-assignments/phase109-nvme-tcp-status-surface-evidence-qa-signoff.md`.
|
||||
QA run `20260629-210857-5c3b` passed 23/23 actions. Sign-off:
|
||||
`internal/docs/qa-assignments/phase110-nvme-tcp-path-loss-status-surface-qa-signoff.md`.
|
||||
|
||||
## Why This Is Next
|
||||
|
||||
Phase 106 proved single-PVC cross-node NVMe/TCP attach. Phase 107 proved
|
||||
two-PVC identity/NQN isolation. Phase 108 proved repeated two-PVC lifecycle
|
||||
cleanup without per-cycle residue.
|
||||
Phase 109 proved healthy NVMe/TCP identity across CRD, report,
|
||||
operator-snapshot, dashboard, and explain. Phase 101 already proved the live
|
||||
standalone one-path-loss behavior: a mounted NVMe/TCP workload survives losing
|
||||
one path, and the product must not claim `Ready=True` while only one of the
|
||||
expected two paths remains.
|
||||
|
||||
The next risk is operator visibility. A transport can work and clean up, but
|
||||
still be operationally weak if the Kubernetes CRD status, report,
|
||||
operator-snapshot, dashboard, and explain surfaces do not agree on the NVMe
|
||||
protocol identity. For users, this is the difference between "it works in the
|
||||
lab" and "I can diagnose which NQN/address a PVC is using."
|
||||
The remaining risk is negative visibility. A transport can detect path loss but
|
||||
still be operationally unsafe if support surfaces replay stale or over-optimistic
|
||||
state. Phase 110 turns the real Phase 101 path-loss evidence into a support
|
||||
bundle and proves every user-facing cold-reader surface preserves the same
|
||||
non-ready reason.
|
||||
|
||||
## Product Goal
|
||||
|
||||
Prove the supported-lab NVMe/TCP multi-volume path publishes the same protocol,
|
||||
NQN, namespace ID, address, path count, and readiness reason across all user
|
||||
inspection surfaces.
|
||||
Prove that real NVMe/TCP one-path-loss evidence replays as
|
||||
`blocked/nvme_multipath_path_missing` across report, operator-snapshot,
|
||||
dashboard, and explain, with no false `Ready=True` and no mutating action.
|
||||
|
||||
Required behavior:
|
||||
|
||||
- install the NVMe/TCP chart path with `operatorStatus.create=true` and
|
||||
`lifecycleOwner.create=true`;
|
||||
- CSI creates `SwBlockVolume` CRs for the two PVCs;
|
||||
- lifecycle-owner adds the protection finalizer;
|
||||
- operator-status writes `.status.nvme` for both volumes;
|
||||
- report summary, `operator-snapshot.json`, dashboard
|
||||
`/operator-snapshot.json`, and `ops explain` agree with the CRD;
|
||||
- `publishTarget` matches `nvme.nvmeAddr`;
|
||||
- all surfaces show `ready/first_volume_verified`;
|
||||
- cleanup leaves zero residue.
|
||||
- run the existing live mounted NVMe/TCP failover/path-loss script;
|
||||
- confirm live source evidence starts with two paths and ends with one path;
|
||||
- confirm live source reason is `nvme_multipath_path_missing`;
|
||||
- normalize `cluster-after-failover.json` into
|
||||
`product-observation/cluster-evidence.json`;
|
||||
- replay with `sw-block ops report --from-bundle`;
|
||||
- replay with `sw-block ops dashboard --from-bundle`;
|
||||
- replay with `sw-block ops explain volume --from-bundle`;
|
||||
- prove all surfaces agree on `blocked/nvme_multipath_path_missing`;
|
||||
- prove `Ready=True` is absent everywhere;
|
||||
- cleanup leaves zero NVMe residue.
|
||||
|
||||
## D1: Surface Agreement Gate
|
||||
## D1: Live Source Gate
|
||||
|
||||
Scenario:
|
||||
|
||||
```text
|
||||
testops/scenarios/nvme-tcp-status-surface-evidence-chain.yaml
|
||||
testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml
|
||||
```
|
||||
|
||||
Expected terminal evidence:
|
||||
|
||||
```text
|
||||
phase109_nvme_tcp_status_surface_status=ok
|
||||
volume_count=2
|
||||
crd_nvme_status_count=2
|
||||
report_nvme_status_count=2
|
||||
operator_snapshot_nvme_status_count=2
|
||||
dashboard_nvme_status_count=2
|
||||
explain_nvme_status_count=2
|
||||
all_surfaces_status=ready
|
||||
all_surfaces_reason=first_volume_verified
|
||||
all_surfaces_protocol=nvme
|
||||
publish_target_matches_nvme_addr=true
|
||||
phase101_nvme_path_failure_status=ok
|
||||
before_path_count=2
|
||||
after_path_count=1
|
||||
after_nvme_reason=nvme_multipath_path_missing
|
||||
after_ready_true=false
|
||||
final_nvme_residue_count=0
|
||||
```
|
||||
|
||||
Actual evidence:
|
||||
|
||||
```text
|
||||
phase101_nvme_path_failure_status=ok
|
||||
before_path_count=2
|
||||
after_path_count=1
|
||||
after_nvme_reason=nvme_multipath_path_missing
|
||||
after_ready_true=false
|
||||
final_nvme_residue_count=0
|
||||
```
|
||||
|
||||
## D2: Support Surface Replay Gate
|
||||
|
||||
Expected terminal evidence:
|
||||
|
||||
```text
|
||||
phase110_nvme_tcp_path_loss_status_surface_status=ok
|
||||
live_path_loss_source=phase101
|
||||
before_path_count=2
|
||||
after_path_count=1
|
||||
after_nvme_reason=nvme_multipath_path_missing
|
||||
after_ready_true=false
|
||||
report_reason=nvme_multipath_path_missing
|
||||
operator_snapshot_reason=nvme_multipath_path_missing
|
||||
dashboard_reason=nvme_multipath_path_missing
|
||||
explain_reason=nvme_multipath_path_missing
|
||||
surface_ready_true_count=0
|
||||
mutation_allowed=false
|
||||
```
|
||||
|
||||
Actual terminal evidence matched the expected keys exactly.
|
||||
Actual evidence matched the expected keys exactly.
|
||||
|
||||
## D2: Cleanup Gate
|
||||
## D3: Cleanup Gate
|
||||
|
||||
After the surface agreement assertions, uninstall Helm and run the strict
|
||||
cleanup verifier.
|
||||
|
||||
Expected evidence:
|
||||
Expected terminal evidence:
|
||||
|
||||
```text
|
||||
cleanup_status=ok
|
||||
k8s_residue_count=0
|
||||
iscsi_residue_count=0
|
||||
process_residue_count=0
|
||||
multipath_residue_count=0
|
||||
hostpath_residue_count=0
|
||||
failure_count=0
|
||||
final_nvme_residue_count=0
|
||||
```
|
||||
|
||||
Actual cleanup evidence matched the expected keys exactly.
|
||||
Actual source and final cleanup evidence matched the expected key.
|
||||
|
||||
## Non-Claims
|
||||
|
||||
Phase 109 still does not claim:
|
||||
Phase 110 does not claim:
|
||||
|
||||
- RoCE/NVMe-RDMA;
|
||||
- performance or SLO;
|
||||
- broad distro/kernel compatibility;
|
||||
- production HA;
|
||||
- multi-path failover across real hosts;
|
||||
- more than the supported-lab two-PVC status surface agreement gate.
|
||||
- live Kubernetes CRD negative projection for NVMe path loss;
|
||||
- more than support-surface replay of real standalone one-path-loss evidence.
|
||||
@@ -276,6 +276,13 @@ rebuild, delete safety, or cleanup must start as a separate gated phase.
|
||||
address, path count, ready status, and `first_volume_verified` reason across
|
||||
`SwBlockVolume.status.nvme`, report summary, report operator snapshot,
|
||||
dashboard operator snapshot, and `ops explain`.
|
||||
- Phase 110 NVMe/TCP Path-Loss Status Surface Honesty is closed. The real
|
||||
standalone mounted one-path-loss evidence from Phase 101 now replays through
|
||||
report, operator-snapshot, dashboard, and explain as
|
||||
`blocked/nvme_multipath_path_missing`, with `path_count=1`,
|
||||
`multipath_observed=false`, read-only actions, and no false `Ready=True`.
|
||||
This deliberately remains a support-surface replay gate, not a live
|
||||
Kubernetes CRD negative-path-loss claim.
|
||||
- Later protocol candidates: implement a real NVMe/RDMA target or characterize
|
||||
NVMe/TCP performance. Keep these separate so correctness, transport, and
|
||||
performance claims do not get mixed.
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
# Phase 110 NVMe/TCP Path-Loss Status Surface QA Sign-off
|
||||
|
||||
Status: PASS.
|
||||
|
||||
Source: `phase110-nvme-tcp-path-loss-status-honesty`.
|
||||
|
||||
QA run: `20260629-210857-5c3b`.
|
||||
|
||||
Scenario:
|
||||
|
||||
```text
|
||||
testops/scenarios/nvme-tcp-path-loss-status-surface-chain.yaml
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```text
|
||||
23/23 actions PASS
|
||||
```
|
||||
|
||||
## Scope
|
||||
|
||||
Phase 110 does not create a new failure injection. It reuses the existing live
|
||||
Phase 101 mounted NVMe/TCP path-loss gate, then projects the captured
|
||||
after-failover evidence through the normal support-bundle surfaces.
|
||||
|
||||
This proves that a real one-path-loss state is not lost or softened by report,
|
||||
operator-snapshot, dashboard, or explain replay.
|
||||
|
||||
## Terminal Evidence
|
||||
|
||||
Live source evidence:
|
||||
|
||||
```text
|
||||
phase101_nvme_path_failure_status=ok
|
||||
before_path_count=2
|
||||
before_multipath_observed=true
|
||||
after_status=blocked
|
||||
after_reason=nvme_multipath_path_missing
|
||||
after_nvme_reason=nvme_multipath_path_missing
|
||||
after_ready_true=false
|
||||
after_path_count=1
|
||||
after_multipath_observed=false
|
||||
final_nvme_residue_count=0
|
||||
```
|
||||
|
||||
Surface replay evidence:
|
||||
|
||||
```text
|
||||
phase110_nvme_tcp_path_loss_status_surface_status=ok
|
||||
live_path_loss_source=phase101
|
||||
before_path_count=2
|
||||
after_path_count=1
|
||||
after_nvme_reason=nvme_multipath_path_missing
|
||||
after_ready_true=false
|
||||
report_reason=nvme_multipath_path_missing
|
||||
operator_snapshot_reason=nvme_multipath_path_missing
|
||||
dashboard_reason=nvme_multipath_path_missing
|
||||
explain_reason=nvme_multipath_path_missing
|
||||
surface_ready_true_count=0
|
||||
mutation_allowed=false
|
||||
```
|
||||
|
||||
Report summary evidence:
|
||||
|
||||
```text
|
||||
managed_volume=v1 status=blocked reason=nvme_multipath_path_missing
|
||||
managed_volume_nvme=v1 nqn=nqn.2026-05.io.seaweedfs:failover-v1 nsid=1 addr=127.0.0.1:42415 addrs=127.0.0.1:42415 path_count=1 multipath_observed=false reason=nvme_multipath_path_missing
|
||||
managed_volume_condition=Ready status=False reason=nvme_multipath_path_missing severity=warning
|
||||
managed_volume_condition=Blocked status=True reason=nvme_multipath_path_missing severity=warning
|
||||
managed_volume_action=observe.collect_bundle mode=read_only side_effect=observe executor=ops decision=allowed
|
||||
read_only=true
|
||||
```
|
||||
|
||||
Explain evidence:
|
||||
|
||||
```text
|
||||
managed_volume v1 status=blocked reason=nvme_multipath_path_missing
|
||||
managed_volume_nvme protocol=nvme nqn=nqn.2026-05.io.seaweedfs:failover-v1 nsid=1 addr=127.0.0.1:42415 addrs=127.0.0.1:42415 path_count=1 multipath_observed=false reason=nvme_multipath_path_missing
|
||||
managed_volume_condition Ready status=False reason=nvme_multipath_path_missing severity=warning
|
||||
managed_volume_condition Blocked status=True reason=nvme_multipath_path_missing severity=warning
|
||||
managed_volume_action observe.collect_bundle mode=read_only side_effect=observe executor=ops decision=allowed
|
||||
```
|
||||
|
||||
## Verdict
|
||||
|
||||
PASS. The live NVMe/TCP path-loss source starts with two paths and ends with
|
||||
one path. The managed-volume status is consistently
|
||||
`blocked/nvme_multipath_path_missing` across report, operator-snapshot,
|
||||
dashboard, and explain. No surface claims `Ready=True`, and no mutating action
|
||||
is exposed.
|
||||
|
||||
## Non-Claims
|
||||
|
||||
- This is not a live Kubernetes CRD negative-path-loss gate.
|
||||
- This is not a RoCE/NVMe-RDMA claim.
|
||||
- This is not a performance/SLO, production HA, or broad host compatibility
|
||||
claim.
|
||||
- This does not claim more than support-surface replay of real standalone
|
||||
mounted NVMe/TCP one-path-loss evidence.
|
||||
@@ -0,0 +1,234 @@
|
||||
name: nvme-tcp-path-loss-status-surface-chain
|
||||
timeout: 35m
|
||||
|
||||
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: pre_clean
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: exec
|
||||
node: m02
|
||||
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate"
|
||||
|
||||
- name: live_path_loss_source
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 20m
|
||||
cmd: "cd {{ product_root }} && bash scripts/run-nvme-mounted-failover-smoke.sh {{ product_root }}"
|
||||
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^phase101_nvme_path_failure_status=ok$"
|
||||
save_as: live_path_loss_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ live_path_loss_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^before_path_count=2$"
|
||||
save_as: before_two_paths
|
||||
- action: assert_greater
|
||||
actual: "{{ before_two_paths }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^after_path_count=1$"
|
||||
save_as: after_one_path
|
||||
- action: assert_greater
|
||||
actual: "{{ after_one_path }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^after_nvme_reason=nvme_multipath_path_missing$"
|
||||
save_as: live_missing_path_reason
|
||||
- action: assert_greater
|
||||
actual: "{{ live_missing_path_reason }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^after_ready_true=false$"
|
||||
save_as: live_no_false_ready
|
||||
- action: assert_greater
|
||||
actual: "{{ live_no_false_ready }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^final_nvme_residue_count=0$"
|
||||
save_as: live_nvme_clean
|
||||
- action: assert_greater
|
||||
actual: "{{ live_nvme_clean }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: support_surface_replay
|
||||
actions:
|
||||
- action: exec
|
||||
node: m02
|
||||
timeout: 5m
|
||||
cmd: |
|
||||
set -eu
|
||||
ROOT=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface
|
||||
GATE="$ROOT/gate"
|
||||
BUNDLE="$ROOT/replay-bundle"
|
||||
SURFACES="$ROOT/surfaces"
|
||||
mkdir -p "$BUNDLE/product-observation" "$SURFACES/dashboard" "$SURFACES/explain" "$ROOT/asserts"
|
||||
cp "$GATE/cluster-after-failover.json" "$BUNDLE/product-observation/cluster-evidence.json"
|
||||
cp "$GATE/phase101-nvme-path-failure-summary.txt" "$BUNDLE/"
|
||||
cd {{ product_root }}
|
||||
go build -o "$ROOT/bin/sw-block" ./cmd/sw-block
|
||||
"$ROOT/bin/sw-block" ops report --from-bundle "$BUNDLE" --out "$SURFACES/report" > "$SURFACES/report.stdout.txt" 2> "$SURFACES/report.stderr.txt"
|
||||
"$ROOT/bin/sw-block" ops explain volume --from-bundle "$BUNDLE" v1 > "$SURFACES/explain/v1.txt" 2> "$SURFACES/explain/v1.stderr.txt"
|
||||
port=$(python3 - <<'PY'
|
||||
import socket
|
||||
s=socket.socket(); s.bind(('127.0.0.1',0)); print(s.getsockname()[1]); s.close()
|
||||
PY
|
||||
)
|
||||
"$ROOT/bin/sw-block" ops dashboard --from-bundle "$BUNDLE" --listen "127.0.0.1:${port}" --serve-duration 8s > "$SURFACES/dashboard/stdout.txt" 2> "$SURFACES/dashboard/stderr.txt" &
|
||||
dashboard_pid=$!
|
||||
trap 'kill "$dashboard_pid" >/dev/null 2>&1 || true; wait "$dashboard_pid" >/dev/null 2>&1 || true' EXIT
|
||||
for _ in $(seq 1 80); do
|
||||
if curl -fsS "http://127.0.0.1:${port}/operator-snapshot.json" > "$SURFACES/dashboard/operator-snapshot.json" 2> "$SURFACES/dashboard/curl.stderr.txt"; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
test -s "$SURFACES/dashboard/operator-snapshot.json"
|
||||
python3 - <<'PY'
|
||||
import json
|
||||
from pathlib import Path
|
||||
root = Path('/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface')
|
||||
gate_summary = (root / 'gate/phase101-nvme-path-failure-summary.txt').read_text()
|
||||
report_summary = (root / 'surfaces/report/summary.txt').read_text()
|
||||
explain = (root / 'surfaces/explain/v1.txt').read_text()
|
||||
report_snapshot = json.loads((root / 'surfaces/report/operator-snapshot.json').read_text())
|
||||
dashboard_snapshot = json.loads((root / 'surfaces/dashboard/operator-snapshot.json').read_text())
|
||||
evidence = json.loads((root / 'replay-bundle/product-observation/cluster-evidence.json').read_text())
|
||||
|
||||
def kv(text, key):
|
||||
for line in text.splitlines():
|
||||
if line.startswith(key + '='):
|
||||
return line.split('=', 1)[1].strip()
|
||||
return ''
|
||||
|
||||
if kv(gate_summary, 'before_path_count') != '2':
|
||||
raise SystemExit('live source did not start with two paths')
|
||||
if kv(gate_summary, 'after_path_count') != '1':
|
||||
raise SystemExit('live source did not lose exactly one path')
|
||||
if kv(gate_summary, 'after_nvme_reason') != 'nvme_multipath_path_missing':
|
||||
raise SystemExit('live source reason mismatch')
|
||||
if kv(gate_summary, 'after_ready_true') != 'false':
|
||||
raise SystemExit('live source reported false Ready=True')
|
||||
|
||||
managed = evidence.get('managed_volumes') or []
|
||||
if len(managed) != 1:
|
||||
raise SystemExit(f'expected one managed volume in source evidence, got {len(managed)}')
|
||||
status = managed[0]
|
||||
nvme = status.get('nvme') or {}
|
||||
if status.get('status') != 'blocked' or status.get('reason_code') != 'nvme_multipath_path_missing':
|
||||
raise SystemExit(f'source managed status mismatch: {status}')
|
||||
if nvme.get('path_count') != 1 or nvme.get('reason_code') != 'nvme_multipath_path_missing':
|
||||
raise SystemExit(f'source nvme status mismatch: {nvme}')
|
||||
|
||||
if 'managed_volume=v1 status=blocked reason=nvme_multipath_path_missing' not in report_summary:
|
||||
raise SystemExit('report summary missing blocked/missing-path reason')
|
||||
if 'managed_volume_nvme=v1 ' not in report_summary or 'path_count=1' not in report_summary or 'reason=nvme_multipath_path_missing' not in report_summary:
|
||||
raise SystemExit('report summary missing nvme path-loss detail')
|
||||
if 'managed_volume_condition=Ready status=True' in report_summary:
|
||||
raise SystemExit('report summary has false Ready=True')
|
||||
if 'managed_volume v1 status=blocked reason=nvme_multipath_path_missing' not in explain:
|
||||
raise SystemExit('explain missing blocked/missing-path reason')
|
||||
if 'managed_volume_nvme protocol=nvme' not in explain or 'path_count=1' not in explain or 'reason=nvme_multipath_path_missing' not in explain:
|
||||
raise SystemExit('explain missing nvme path-loss detail')
|
||||
if 'managed_volume_condition Ready status=True' in explain:
|
||||
raise SystemExit('explain has false Ready=True')
|
||||
|
||||
def check_snapshot(name, snap):
|
||||
vols = snap.get('volumes') or []
|
||||
if len(vols) != 1:
|
||||
raise SystemExit(f'{name} volume count={len(vols)}')
|
||||
st = vols[0].get('status') or {}
|
||||
nv = st.get('nvme') or {}
|
||||
if st.get('status') != 'blocked' or st.get('reason_code') != 'nvme_multipath_path_missing':
|
||||
raise SystemExit(f'{name} status mismatch: {st}')
|
||||
if nv.get('protocol') != 'nvme' or nv.get('path_count') != 1 or nv.get('reason_code') != 'nvme_multipath_path_missing':
|
||||
raise SystemExit(f'{name} nvme mismatch: {nv}')
|
||||
for condition in st.get('conditions') or []:
|
||||
if condition.get('type') == 'Ready' and condition.get('status') == 'True':
|
||||
raise SystemExit(f'{name} false Ready=True')
|
||||
mutation = snap.get('mutation') or {}
|
||||
if mutation.get('mutation_allowed') is not False:
|
||||
raise SystemExit(f'{name} mutation boundary mismatch: {mutation}')
|
||||
|
||||
check_snapshot('report operator-snapshot', report_snapshot)
|
||||
check_snapshot('dashboard operator-snapshot', dashboard_snapshot)
|
||||
(root / 'asserts/phase110-surface-summary.txt').write_text('\n'.join([
|
||||
'phase110_nvme_tcp_path_loss_status_surface_status=ok',
|
||||
'live_path_loss_source=phase101',
|
||||
'before_path_count=2',
|
||||
'after_path_count=1',
|
||||
'after_nvme_reason=nvme_multipath_path_missing',
|
||||
'after_ready_true=false',
|
||||
'report_reason=nvme_multipath_path_missing',
|
||||
'operator_snapshot_reason=nvme_multipath_path_missing',
|
||||
'dashboard_reason=nvme_multipath_path_missing',
|
||||
'explain_reason=nvme_multipath_path_missing',
|
||||
'surface_ready_true_count=0',
|
||||
'mutation_allowed=false',
|
||||
]) + '\n')
|
||||
PY
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt"
|
||||
pattern: "^phase110_nvme_tcp_path_loss_status_surface_status=ok$"
|
||||
save_as: surface_ok
|
||||
- action: assert_greater
|
||||
actual: "{{ surface_ok }}"
|
||||
threshold: "0"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/asserts/phase110-surface-summary.txt"
|
||||
pattern: "^surface_ready_true_count=0$"
|
||||
save_as: no_false_ready_surface
|
||||
- action: assert_greater
|
||||
actual: "{{ no_false_ready_surface }}"
|
||||
threshold: "0"
|
||||
|
||||
- name: collect_and_cleanup
|
||||
always: true
|
||||
actions:
|
||||
- action: pre_run_cleanup
|
||||
node: m02
|
||||
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
||||
nvme_disconnect: "true"
|
||||
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
||||
- action: grep_log
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface/gate/phase101-nvme-path-failure-summary.txt"
|
||||
pattern: "^final_nvme_residue_count=0$"
|
||||
save_as: nvme_clean
|
||||
ignore_error: true
|
||||
- action: collect_path
|
||||
node: m02
|
||||
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase110-nvme-path-loss-surface"
|
||||
name: "remote-phases"
|
||||
ignore_error: true
|
||||
Reference in new issue
Block a user