diff --git a/seaweed-block/docs/releases/nvme-tcp-supported-lab.md b/seaweed-block/docs/releases/nvme-tcp-supported-lab.md index ef4b669e44..3c46ace9e4 100644 --- a/seaweed-block/docs/releases/nvme-tcp-supported-lab.md +++ b/seaweed-block/docs/releases/nvme-tcp-supported-lab.md @@ -96,6 +96,7 @@ The supported-lab claim is intentionally narrow: | 152 | Mounted multi-block WAL recovery compatibility | PASS | | 153 | WAL multi-block release-boundary documentation | PASS | | 154 | Durable-status HeadLSN diagnostic cleanup | PASS | +| 155 | Mounted durable-status HeadLSN confirmation | PASS | Key QA sign-offs: @@ -134,6 +135,7 @@ Key QA sign-offs: - `internal/docs/qa-assignments/phase152-wal-multiblock-recovery-compatibility-qa-signoff.md` - `internal/docs/qa-assignments/phase153-wal-multiblock-release-boundary-qa-signoff.md` - `internal/docs/qa-assignments/phase154-durable-status-head-lsn-cleanup-qa-signoff.md` +- `internal/docs/qa-assignments/phase155-mounted-durable-status-head-lsn-confirmation-qa-signoff.md` ## Performance Baseline diff --git a/seaweed-block/docs/releases/wal-multiblock-opt-in.md b/seaweed-block/docs/releases/wal-multiblock-opt-in.md index e29051fa0f..82be48f393 100644 --- a/seaweed-block/docs/releases/wal-multiblock-opt-in.md +++ b/seaweed-block/docs/releases/wal-multiblock-opt-in.md @@ -58,6 +58,7 @@ restart/replay gate and are not a production or user-facing tuning knob. | 152 | mounted hostPath restart/recovery replays multi-block WAL records | PASS | | 153 | release-boundary documentation keeps the opt-in source-gated | PASS | | 154 | local durable-status `HeadLSN` diagnostic cleanup | PASS | +| 155 | mounted durable-status `HeadLSN` confirmation after restart/recovery | PASS | Phase 151 mounted profile evidence: @@ -92,6 +93,24 @@ ready_after_restart=true cleanup_status=ok ``` +Phase 155 mounted durable-status confirmation: + +```text +phase155_mounted_durable_status_head_lsn_confirmation_status=ok +runtime_opt_in_enabled=true +recovery_test_disable_flusher_enabled=true +restart_persistence_mode=hostpath +blockvolume_restart_mode=force_delete_pod +recovery_completed=true +recovered_lsn_after_restart=13511 +durable_status_durable_lsn_after_restart=13511 +durable_status_head_lsn_after_restart=13511 +durable_status_head_lsn_equals_recovered_lsn=true +reader_verified_after_restart=true +ready_after_restart=true +cleanup_status=ok +``` + ## Explicit Non-Claims - Not enabled by default. @@ -107,9 +126,8 @@ cleanup_status=ok - Phase 154 fixed the diagnostic durable status where post-recovery `HeadLSN` could display the persisted WAL byte offset instead of the recovered LSN - frontier. -- Rerun a mounted confirmation that live `/status/durable` reports bounded - `HeadLSN` after the Phase 152 restart/recovery shape. + frontier. Phase 155 confirmed that fix in the mounted K8s + restart/recovery path. - Decide whether this opt-in should stay source-gated or be included in a future published-image release smoke. - Keep the recovery-test flusher-disable hook out of user release guidance. diff --git a/seaweed-block/docs/roadmap.md b/seaweed-block/docs/roadmap.md index c976b95dea..2d3c1540bc 100644 --- a/seaweed-block/docs/roadmap.md +++ b/seaweed-block/docs/roadmap.md @@ -128,8 +128,11 @@ Seaweed Block can already demonstrate a narrow Kubernetes block-storage loop: Phase 153 documents the release boundary and lab-only opt-in shape without changing the default WAL format. Phase 154 fixes the local diagnostic `HeadLSN` bug where walstore's WAL byte-position metadata could leak into the - LSN boundary after recovery. The next narrow follow-up is mounted - confirmation of the same `/status/durable` boundary in the live K8s path. + LSN boundary after recovery. Phase 155 confirms that same `/status/durable` + boundary in the mounted K8s path: after force-delete restart/recovery, + `DurableLSN`, `HeadLSN`, and recovery evidence all match the recovered LSN. + The next decision is whether this opt-in stays source-gated or is included in + a future published-image release smoke. - Kubernetes NVMe/TCP mounted reconnect is source-gated through changed desired path-set evidence: CSI-node can connect a newly published desired NVMe path, prune the stale old host path for the same NQN, preserve pod diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 5f12eff6b9..f7426f253c 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,71 +1,71 @@ -# Current Plan: Phase 155 Mounted Durable Status HeadLSN Confirmation +# Current Plan: Phase 156 WAL Multi-Block Release Smoke Decision Status: planning. -Phase 154 closed the local durable-status `HeadLSN` diagnostic cleanup: - -```text -phase154_durable_status_head_lsn_cleanup_status=ok -phase152_followup=head_lsn_diagnostic_cleanup -runtime_opt_in_name=durable-wal-multiblock-records -runtime_opt_in_enabled=true -recovered_lsn_remains_correct=true -durable_status_head_lsn_semantics_documented=true -head_lsn_after_recovery_is_bounded=true -no_recovery_semantics_change_without_test=true -default_wal_format_unchanged=true -cleanup_status=ok -phase154_decision=fixed -next_recommendation=phase155_mounted_durable_status_head_lsn_confirmation -``` - -## Goal - -Confirm the Phase 154 local fix on the mounted Kubernetes path that originally -exposed the issue. Rerun the multi-block WAL restart/recovery shape and assert -that live `/status/durable` reports a bounded `HeadLSN` that agrees with the -recovered frontier after restart. - -## Required Evidence +Phase 155 closed the mounted durable-status confirmation: ```text phase155_mounted_durable_status_head_lsn_confirmation_status=ok -phase152_followup=head_lsn_diagnostic_cleanup -runtime_opt_in_name=durable-wal-multiblock-records runtime_opt_in_enabled=true recovery_test_disable_flusher_enabled=true restart_persistence_mode=hostpath blockvolume_restart_mode=force_delete_pod recovery_completed=true -recovered_lsn_remains_correct=true -durable_status_head_lsn_after_restart= +recovered_lsn_after_restart=13511 +durable_status_durable_lsn_after_restart=13511 +durable_status_head_lsn_after_restart=13511 durable_status_head_lsn_equals_recovered_lsn=true reader_verified_after_restart=true ready_after_restart=true -default_wal_format_unchanged=true cleanup_status=ok -phase155_decision= +phase155_decision=mounted_confirmed +next_recommendation=phase156_wal_multiblock_published_image_release_smoke_decision +``` + +## Goal + +Decide the release boundary for the disabled-by-default multi-block WAL record +opt-in after Phases 150-155. The decision should either keep it source-gated +with no published-image claim, or define a narrow published-image smoke that +proves the same opt-in, recovery, and durable-status evidence on release +artifacts. + +## Required Evidence + +```text +phase156_wal_multiblock_release_smoke_decision_status=ok +runtime_opt_in_name=durable-wal-multiblock-records +default_wal_format_unchanged=true +source_gated_status= +published_image_smoke_required= +published_image_smoke_scope= +recovery_test_disable_flusher_user_claim=false +performance_slo_claim_allowed=false +roce_claim_allowed=false +nvme_rdma_claim_allowed=false next_recommendation= ``` ## Boundaries - Do not enable multi-block records by default. -- Do not weaken the Phase 152 mounted recovery gate. -- Do not turn this into a performance phase. -- Do not claim RoCE, NVMe/RDMA, or performance/SLO. -- Keep the gate scoped to live status confirmation after recovery. +- Do not turn Phase155 evidence into a public image claim unless the matching + published artifacts are actually smoked. +- Do not claim performance, RoCE, NVMe/RDMA, broad compatibility, or production + HA. +- Keep the recovery-test flusher-disable hook out of user guidance. ## Candidate Work -1. Extend the Phase 152 runner/gate to capture `/status/durable` after restart. -2. Assert `DurableLSN`, `HeadLSN`, and recovery evidence agree after recovery. -3. Keep the mounted reader/Ready/cleanup checks from Phase 152. -4. Record whether this is sufficient to keep the opt-in source-gated or whether - another release-smoke artifact check is required. +1. Review whether upcoming development wants a release now or continued source + work. +2. If no release is being cut, document that the opt-in remains source-gated. +3. If a release is being cut, define the minimal published-image smoke: + explicit opt-in, mounted recovery, `HeadLSN == recovered LSN`, reader/Ready, + cleanup. +4. Update release docs with the chosen boundary. ## Exit Criteria -Phase 155 can close when the live mounted recovery path confirms the Phase 154 -status fix: no inflated `HeadLSN`, data still readable after restart, Ready -returns, and cleanup is clean. +Phase 156 can close when the release boundary is explicit enough that README and +release docs cannot accidentally over-claim Phase155 source-gated evidence. diff --git a/seaweed-block/internal/docs/finished-plans/phase154_finishedplan_durable_status_head_lsn_cleanup.md b/seaweed-block/internal/docs/finished-plans/phase154_finishedplan_durable_status_head_lsn_cleanup.md index f78ff561ff..10905dbd49 100644 --- a/seaweed-block/internal/docs/finished-plans/phase154_finishedplan_durable_status_head_lsn_cleanup.md +++ b/seaweed-block/internal/docs/finished-plans/phase154_finishedplan_durable_status_head_lsn_cleanup.md @@ -49,5 +49,5 @@ next_recommendation=phase155_mounted_durable_status_head_lsn_confirmation ## Conclusion The local diagnostic bug is fixed without changing the default WAL format or -the Phase 152 recovery contract. Phase 155 should be a mounted confirmation of -the same status boundary in the live K8s path. +the Phase 152 recovery contract. Phase 155 later confirmed the same status +boundary in the live mounted K8s path. diff --git a/seaweed-block/internal/docs/finished-plans/phase155_finishedplan_mounted_durable_status_head_lsn_confirmation.md b/seaweed-block/internal/docs/finished-plans/phase155_finishedplan_mounted_durable_status_head_lsn_confirmation.md new file mode 100644 index 0000000000..52d2efbd8f --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase155_finishedplan_mounted_durable_status_head_lsn_confirmation.md @@ -0,0 +1,51 @@ +# Phase 155 Finished Plan: Mounted Durable Status HeadLSN Confirmation + +Status: **closed 2026-07-12, QA PASS**. + +## Problem + +Phase 154 fixed a local durable-status diagnostic bug where `HeadLSN` could show +the walstore WAL byte-position metadata instead of the recovered LSN frontier. +The remaining question was whether the same fix held on the mounted Kubernetes +path that originally exposed the mismatch. + +## Work + +Phase 155 added a wrapper gate around the existing Phase 152 mounted +multi-block WAL recovery shape. The gate: + +- reruns the source-gated multi-block WAL opt-in with hostPath persistence; +- preserves the Phase 152 writer, force-delete restart, recovery, reader, Ready, + and cleanup checks; +- reads the live `/status/durable` JSON captured after `blockvolume` restart; +- asserts `DurableLSN`, `HeadLSN`, and recovery evidence all match the recovered + LSN. + +No WAL format, Helm default, or recovery semantics changed in this phase. + +## Evidence + +```text +phase155_mounted_durable_status_head_lsn_confirmation_status=ok +runtime_opt_in_enabled=true +recovery_test_disable_flusher_enabled=true +restart_persistence_mode=hostpath +blockvolume_restart_mode=force_delete_pod +recovery_completed=true +recovered_lsn_after_restart=13511 +durable_status_durable_lsn_after_restart=13511 +durable_status_head_lsn_after_restart=13511 +durable_status_head_lsn_equals_recovered_lsn=true +reader_verified_after_restart=true +ready_after_restart=true +default_wal_format_unchanged=true +cleanup_status=ok +phase155_decision=mounted_confirmed +``` + +## Conclusion + +The local Phase 154 status fix is confirmed in the live mounted K8s path. The +multi-block WAL record optimization remains disabled by default and source-gated; +the next decision is whether to keep it as a lab-only opt-in or include it in a +future published-image release smoke. diff --git a/seaweed-block/internal/docs/product-roadmap.md b/seaweed-block/internal/docs/product-roadmap.md index 2f389e51a7..86edb7ea8d 100644 --- a/seaweed-block/internal/docs/product-roadmap.md +++ b/seaweed-block/internal/docs/product-roadmap.md @@ -85,8 +85,8 @@ This is the short internal roadmap. Keep it current and readable. RoCE, or NVMe/RDMA claim. Phase 153 closed the release-boundary documentation gate for this source-gated opt-in. Phase 154 fixed the local diagnostic durable-status `HeadLSN` display by separating WAL byte-position metadata - from LSN boundaries; Phase 155 should confirm the same boundary in the mounted - K8s path. + from LSN boundaries; Phase 155 confirmed the same boundary in the mounted K8s + path with `DurableLSN == HeadLSN == recovered_lsn_after_restart=13511`. Do not skip from scripts directly to mutating operator lifecycle. Helm has stabilized the installation contract, and Phase 35 added read-only CRD status, diff --git a/seaweed-block/internal/docs/qa-assignments/phase154-durable-status-head-lsn-cleanup-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase154-durable-status-head-lsn-cleanup-qa-signoff.md index 0dab4f313b..2edaa98e10 100644 --- a/seaweed-block/internal/docs/qa-assignments/phase154-durable-status-head-lsn-cleanup-qa-signoff.md +++ b/seaweed-block/internal/docs/qa-assignments/phase154-durable-status-head-lsn-cleanup-qa-signoff.md @@ -46,6 +46,5 @@ next_recommendation=phase155_mounted_durable_status_head_lsn_confirmation ## Conclusion -Phase 154 closes the local diagnostic/status cleanup. The next useful gate is a -mounted confirmation that reruns the K8s recovery shape and asserts the live -`/status/durable` output has bounded `HeadLSN` after restart. +Phase 154 closes the local diagnostic/status cleanup. Phase 155 later confirmed +the same `HeadLSN` boundary in the mounted K8s restart/recovery path. diff --git a/seaweed-block/internal/docs/qa-assignments/phase155-mounted-durable-status-head-lsn-confirmation-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase155-mounted-durable-status-head-lsn-confirmation-qa-signoff.md new file mode 100644 index 0000000000..ecd02ae317 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase155-mounted-durable-status-head-lsn-confirmation-qa-signoff.md @@ -0,0 +1,102 @@ +# Phase 155 QA Sign-Off: Mounted Durable Status HeadLSN Confirmation + +Status: **PASS** on 2026-07-12. + +Run bundle: +`results/20260712-101758-5762`. + +Remote artifact: +`/mnt/smb/work/share/g15d-k8s/20260712-101758-5762-phase155-head-lsn`. + +## Verdict + +The Phase 154 durable-status fix is confirmed on the mounted Kubernetes +restart/recovery path. The gate reran the Phase 152 multi-block WAL opt-in +shape with hostPath persistence, force-deleted the `blockvolume` pod, verified +data after recovery, and then asserted live `/status/durable` reports +`HeadLSN == DurableLSN == recovered LSN`. + +This remains a source-gated opt-in confirmation. It does not enable multi-block +WAL records by default and does not create a performance, RoCE, or NVMe/RDMA +claim. + +## Evidence + +```text +phase155_mounted_durable_status_head_lsn_confirmation_status=ok +phase152_followup=head_lsn_diagnostic_cleanup +runtime_opt_in_name=durable-wal-multiblock-records +runtime_opt_in_enabled=true +recovery_test_disable_flusher_enabled=true +restart_persistence_mode=hostpath +blockvolume_restart_mode=force_delete_pod +recovery_completed=true +recovered_lsn_after_restart=13511 +recovered_lsn_remains_correct=true +wal_integrity_fault_observed=false +durable_status_volume_id=pvc-b0e723aa-c4b1-4639-a00e-580a56f52f16 +durable_status_durable_lsn_after_restart=13511 +durable_status_head_lsn_after_restart=13511 +durable_status_head_lsn_equals_recovered_lsn=true +durable_status_evidence_matches_recovered_lsn=true +durable_status_latched_after_restart=true +durable_status_operational_after_restart=true +durable_status_epoch_after_restart=1 +reader_verified_after_restart=true +ready_after_restart=true +default_wal_format_unchanged=true +cleanup_status=ok +phase155_decision=mounted_confirmed +next_recommendation=phase156_wal_multiblock_published_image_release_smoke_decision +``` + +The nested Phase 152 summary also remained green: + +```text +phase152_wal_multiblock_recovery_compatibility_status=ok +target_write_request_max_bytes=65536 +backend_write_request_max_bytes=65536 +wal_encode_ops=618 +backend_storage_write_calls=618 +backend_storage_write_blocks=9417 +multiblock_record_shape_observed=true +mounted_helm_renders_recovery_test_disable_flusher=true +writer_verified_before_restart=true +blockvolume_restart_mode=force_delete_pod +blockvolume_restarted=true +recovery_completed=true +recovered_lsn_after_restart=13511 +reader_verified_after_restart=true +ready_after_restart=true +cleanup_status=ok +``` + +## Runner Result + +```text +=== nvme-tcp-wal-multiblock-head-lsn-confirmation-chain === PASS (6m36.157s) +47 actions: 47 passed, 0 failed +``` + +## Cleanup + +The nested cleanup verifiers reported zero residue: + +```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 +``` + +Post-run lab checks showed no `sw-block` Helm release, no `sw-block` pods/PVCs, +no `swblock*` CRDs, and no Seaweed NVMe subsystem residue. + +## Conclusion + +Phase 155 closes the mounted follow-up from Phase 154. The live K8s status +surface now agrees with the recovered WAL frontier after mounted restart, while +the opt-in boundary remains unchanged. diff --git a/seaweed-block/scripts/run-phase155-mounted-durable-status-head-lsn-confirmation-gate.sh b/seaweed-block/scripts/run-phase155-mounted-durable-status-head-lsn-confirmation-gate.sh new file mode 100644 index 0000000000..5333188596 --- /dev/null +++ b/seaweed-block/scripts/run-phase155-mounted-durable-status-head-lsn-confirmation-gate.sh @@ -0,0 +1,221 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="${1:-$(pwd)}" +ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${ROOT}/results/phase155-mounted-durable-status-head-lsn-confirmation-gate}" +SUMMARY="${ARTIFACT_DIR}/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" +PHASE152_DIR="${ARTIFACT_DIR}/phase152-recovery" +CANDIDATE_MAX_H2C_BYTES="${SW_BLOCK_PHASE155_CANDIDATE_MAX_H2C_BYTES:-65536}" +SEQ_MIB="${SW_BLOCK_PHASE155_SEQ_MIB:-4}" +RESTART_VERIFY_MIB="${SW_BLOCK_PHASE155_RESTART_VERIFY_MIB:-4}" +STATE_HOSTPATH="${SW_BLOCK_PHASE155_STATE_HOSTPATH:-/tmp/sw-block-phase155-recovery}" + +mkdir -p "${ARTIFACT_DIR}" "${PHASE152_DIR}" +: >"${SUMMARY}" + +write_summary() { + echo "$*" | tee -a "${SUMMARY}" >/dev/null +} + +summary_value() { + local file="$1" + local key="$2" + awk -F= -v key="$key" '$1 == key {value = substr($0, length(key) + 2)} END {if (value != "") print value}' "$file" +} + +require_summary_value() { + local file="$1" + local key="$2" + local value + value="$(summary_value "$file" "$key")" + if [[ -z "${value}" ]]; then + echo "missing summary key ${key} in ${file}" >&2 + exit 1 + fi + printf '%s' "${value}" +} + +assert_value() { + local key="$1" + local actual="$2" + local want="$3" + if [[ "${actual}" != "${want}" ]]; then + echo "${key}=${actual}, want ${want}" >&2 + exit 1 + fi +} + +assert_int_ge() { + local actual="$1" + local want="$2" + local label="$3" + python3 - "$actual" "$want" "$label" <<'PY' +import sys +actual = int(sys.argv[1]) +want = int(sys.argv[2]) +label = sys.argv[3] +if actual < want: + raise SystemExit(f"{label}={actual}, want >= {want}") +PY +} + +write_summary "phase155_mounted_durable_status_head_lsn_confirmation_status=running" +write_summary "phase152_followup=head_lsn_diagnostic_cleanup" +write_summary "frontend_transport=tcp" +write_summary "roce_claim_allowed=false" +write_summary "nvme_rdma_claim_allowed=false" +write_summary "performance_slo_claim_allowed=false" +write_summary "default_wal_format_unchanged=true" +write_summary "feature_gate_default=false" +write_summary "runtime_opt_in_name=durable-wal-multiblock-records" +write_summary "runtime_opt_in_enabled=true" +write_summary "recovery_test_disable_flusher_enabled=true" +write_summary "restart_persistence_mode=hostpath" +write_summary "state_hostpath=${STATE_HOSTPATH}" + +SW_BLOCK_ARTIFACT_DIR="${PHASE152_DIR}" \ +SW_BLOCK_PHASE152_CANDIDATE_MAX_H2C_BYTES="${CANDIDATE_MAX_H2C_BYTES}" \ +SW_BLOCK_PHASE152_SEQ_MIB="${SEQ_MIB}" \ +SW_BLOCK_PHASE152_RESTART_VERIFY_MIB="${RESTART_VERIFY_MIB}" \ +SW_BLOCK_PHASE152_STATE_HOSTPATH="${STATE_HOSTPATH}" \ +SW_BLOCK_PHASE125_FRONTEND_IP_MAP="${SW_BLOCK_PHASE125_FRONTEND_IP_MAP:-}" \ +SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV="${SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV:-}" \ +SW_BLOCK_IMPORT_K3S_SSH_KEY="${SW_BLOCK_IMPORT_K3S_SSH_KEY:-}" \ + bash "${ROOT}/scripts/run-phase152-wal-multiblock-recovery-compatibility-gate.sh" "${ROOT}" \ + >"${ARTIFACT_DIR}/phase152-recovery.stdout.txt" \ + 2>"${ARTIFACT_DIR}/phase152-recovery.stderr.txt" + +PHASE152_SUMMARY="${PHASE152_DIR}/phase152-wal-multiblock-recovery-compatibility-summary.txt" +PHASE120_DIR="${PHASE152_DIR}/phase126-profile/phase125-profile/block-profile" +PHASE120_SUMMARY="${PHASE120_DIR}/phase120-nvme-tcp-performance-baseline-summary.txt" +DURABLE_STATUS_JSON="${PHASE120_DIR}/status/status-durable-after-blockvolume-restart.json" +WRITE_PROFILE_SUMMARY="${PHASE120_DIR}/status/write-profile-summary.txt" +DURABLE_CHECK_SUMMARY="${ARTIFACT_DIR}/durable-status-head-lsn-summary.txt" + +assert_value "phase152_wal_multiblock_recovery_compatibility_status" \ + "$(require_summary_value "${PHASE152_SUMMARY}" phase152_wal_multiblock_recovery_compatibility_status)" "ok" +assert_value "phase120_nvme_tcp_performance_baseline_status" \ + "$(require_summary_value "${PHASE120_SUMMARY}" phase120_nvme_tcp_performance_baseline_status)" "ok" + +RUNTIME_ENABLED="$(require_summary_value "${PHASE152_SUMMARY}" runtime_opt_in_enabled)" +RECOVERY_TEST_DISABLE_FLUSHER="$(require_summary_value "${PHASE152_SUMMARY}" recovery_test_disable_flusher_enabled)" +RESTART_MODE="$(require_summary_value "${PHASE152_SUMMARY}" blockvolume_restart_mode)" +RECOVERY_COMPLETED="$(require_summary_value "${PHASE152_SUMMARY}" recovery_completed)" +RECOVERED_LSN="$(require_summary_value "${PHASE152_SUMMARY}" recovered_lsn_after_restart)" +WAL_FAULT="$(require_summary_value "${PHASE152_SUMMARY}" wal_integrity_fault_observed)" +READER_AFTER="$(require_summary_value "${PHASE152_SUMMARY}" reader_verified_after_restart)" +READY_AFTER="$(require_summary_value "${PHASE152_SUMMARY}" ready_after_restart)" +CLEANUP_STATUS="$(require_summary_value "${PHASE152_SUMMARY}" cleanup_status)" +VOLUME_ID="$(require_summary_value "${WRITE_PROFILE_SUMMARY}" write_profile_volume_id)" + +assert_value "runtime_opt_in_enabled" "${RUNTIME_ENABLED}" "true" +assert_value "recovery_test_disable_flusher_enabled" "${RECOVERY_TEST_DISABLE_FLUSHER}" "true" +assert_value "blockvolume_restart_mode" "${RESTART_MODE}" "force_delete_pod" +assert_value "recovery_completed" "${RECOVERY_COMPLETED}" "true" +assert_int_ge "${RECOVERED_LSN}" 1 "recovered_lsn_after_restart" +assert_value "wal_integrity_fault_observed" "${WAL_FAULT}" "false" +assert_value "reader_verified_after_restart" "${READER_AFTER}" "true" +assert_value "ready_after_restart" "${READY_AFTER}" "true" +assert_value "cleanup_status" "${CLEANUP_STATUS}" "ok" + +python3 - \ + "${DURABLE_STATUS_JSON}" \ + "${VOLUME_ID}" \ + "${RECOVERED_LSN}" \ + "${DURABLE_CHECK_SUMMARY}" <<'PY' +import json +import sys + +status_path, volume_id, recovered_lsn_raw, out_path = sys.argv[1:5] +recovered_lsn = int(recovered_lsn_raw) +with open(status_path, "r", encoding="utf-8") as fh: + body = json.load(fh) + +volumes = body.get("Volumes") or body.get("volumes") or [] +matched = None +for vol in volumes: + got = vol.get("VolumeID") or vol.get("volumeID") or vol.get("volume_id") + if got == volume_id: + matched = vol + break +if matched is None: + if len(volumes) == 1: + matched = volumes[0] + else: + raise SystemExit(f"durable status volume {volume_id!r} not found in {status_path}") + +def pick_int(obj, *names): + for name in names: + if name in obj and obj[name] is not None: + return int(obj[name]) + return None + +def pick_bool(obj, *names): + for name in names: + if name in obj and obj[name] is not None: + return bool(obj[name]) + return None + +durable_lsn = pick_int(matched, "DurableLSN", "durableLSN", "durable_lsn") +head_lsn = pick_int(matched, "HeadLSN", "headLSN", "head_lsn") +epoch = pick_int(matched, "Epoch", "epoch") +latched = pick_bool(matched, "Latched", "latched") +operational = pick_bool(matched, "Operational", "operational") +evidence = matched.get("Evidence") or matched.get("evidence") or "" + +if durable_lsn != recovered_lsn: + raise SystemExit(f"durable_lsn={durable_lsn}, want recovered_lsn={recovered_lsn}") +if head_lsn != recovered_lsn: + raise SystemExit(f"head_lsn={head_lsn}, want recovered_lsn={recovered_lsn}") +if latched is not True: + raise SystemExit(f"latched={latched}, want true") +if operational is not True: + raise SystemExit(f"operational={operational}, want true") +if epoch is None or epoch < 1: + raise SystemExit(f"epoch={epoch}, want >= 1") +if f"recovered LSN={recovered_lsn}" not in evidence: + raise SystemExit(f"evidence={evidence!r}, want recovered LSN={recovered_lsn}") + +resolved_volume_id = matched.get("VolumeID") or matched.get("volumeID") or matched.get("volume_id") +with open(out_path, "w", encoding="utf-8") as out: + out.write(f"durable_status_volume_id={resolved_volume_id}\n") + out.write(f"durable_status_durable_lsn_after_restart={durable_lsn}\n") + out.write(f"durable_status_head_lsn_after_restart={head_lsn}\n") + out.write("durable_status_head_lsn_equals_recovered_lsn=true\n") + out.write("durable_status_evidence_matches_recovered_lsn=true\n") + out.write("durable_status_latched_after_restart=true\n") + out.write("durable_status_operational_after_restart=true\n") + out.write(f"durable_status_epoch_after_restart={epoch}\n") +PY + +DURABLE_STATUS_VOLUME_ID="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_volume_id)" +DURABLE_LSN_AFTER="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_durable_lsn_after_restart)" +HEAD_LSN_AFTER="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_head_lsn_after_restart)" +HEAD_EQUALS_RECOVERED="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_head_lsn_equals_recovered_lsn)" +EVIDENCE_MATCHES_RECOVERED="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_evidence_matches_recovered_lsn)" +LATCHED_AFTER="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_latched_after_restart)" +OPERATIONAL_AFTER="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_operational_after_restart)" +EPOCH_AFTER="$(require_summary_value "${DURABLE_CHECK_SUMMARY}" durable_status_epoch_after_restart)" + +write_summary "candidate_max_h2c_bytes=${CANDIDATE_MAX_H2C_BYTES}" +write_summary "seq_size_mib=${SEQ_MIB}" +write_summary "restart_verify_mib=${RESTART_VERIFY_MIB}" +write_summary "blockvolume_restart_mode=${RESTART_MODE}" +write_summary "recovery_completed=${RECOVERY_COMPLETED}" +write_summary "recovered_lsn_after_restart=${RECOVERED_LSN}" +write_summary "recovered_lsn_remains_correct=true" +write_summary "wal_integrity_fault_observed=${WAL_FAULT}" +write_summary "durable_status_volume_id=${DURABLE_STATUS_VOLUME_ID}" +write_summary "durable_status_durable_lsn_after_restart=${DURABLE_LSN_AFTER}" +write_summary "durable_status_head_lsn_after_restart=${HEAD_LSN_AFTER}" +write_summary "durable_status_head_lsn_equals_recovered_lsn=${HEAD_EQUALS_RECOVERED}" +write_summary "durable_status_evidence_matches_recovered_lsn=${EVIDENCE_MATCHES_RECOVERED}" +write_summary "durable_status_latched_after_restart=${LATCHED_AFTER}" +write_summary "durable_status_operational_after_restart=${OPERATIONAL_AFTER}" +write_summary "durable_status_epoch_after_restart=${EPOCH_AFTER}" +write_summary "reader_verified_after_restart=${READER_AFTER}" +write_summary "ready_after_restart=${READY_AFTER}" +write_summary "cleanup_status=${CLEANUP_STATUS}" +write_summary "phase155_decision=mounted_confirmed" +write_summary "next_recommendation=phase156_wal_multiblock_published_image_release_smoke_decision" +write_summary "phase155_mounted_durable_status_head_lsn_confirmation_status=ok" diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml new file mode 100644 index 0000000000..6594f0607d --- /dev/null +++ b/seaweed-block/testops/scenarios/nvme-tcp-wal-multiblock-head-lsn-confirmation-chain.yaml @@ -0,0 +1,225 @@ +name: nvme-tcp-wal-multiblock-head-lsn-confirmation-chain +timeout: 95m + +env: + product_root: "/tmp/seaweed_block" + ssh_key: "C:\\work\\dev_server\\testdev_key" + +topology: + nodes: + m01: + host: 192.168.1.181 + user: testdev + key: "{{ ssh_key }}" + 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 + timeout: 5m + cmd: "helm status sw-block --namespace kube-system >/dev/null 2>&1 && helm uninstall sw-block --namespace kube-system --wait --timeout 240s || true; kubectl -n default delete pod sw-block-phase126-block-perf sw-block-phase126-local-perf --ignore-not-found=true --wait=true --timeout=60s || true; kubectl -n default delete pvc sw-block-phase126-block-pvc sw-block-phase126-local-pvc --ignore-not-found=true --wait=true --timeout=60s || true; kubectl delete storageclass sw-block-phase126-block --ignore-not-found=true --wait=true --timeout=60s || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r -n1 kubectl patch pv --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl get pv --no-headers | awk '/sw-block-phase126/ {print $1}' | xargs -r kubectl delete pv --wait=false >/dev/null 2>&1 || true; kubectl -n kube-system get swblockvolumes.block.seaweedfs.com -o name 2>/dev/null | xargs -r -n1 kubectl -n kube-system patch --type=merge -p '{\"metadata\":{\"finalizers\":[]}}' >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockvolumes.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl -n kube-system delete swblockclusters.block.seaweedfs.com --all --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; kubectl delete validatingadmissionpolicy,validatingadmissionpolicybinding -l app.kubernetes.io/instance=sw-block --ignore-not-found=true >/dev/null 2>&1 || true; kubectl delete crd swblockclusters.block.seaweedfs.com swblockvolumes.block.seaweedfs.com swblockreplicaeligibilities.block.seaweedfs.com swblockreplicarebuilds.block.seaweedfs.com swblockreplicafailbacks.block.seaweedfs.com swblockfrontendpublications.block.seaweedfs.com --ignore-not-found=true --wait=true --timeout=60s >/dev/null 2>&1 || true; sudo -n nvme disconnect-all >/dev/null 2>&1 || true; sudo -n rm -rf /tmp/sw-block-phase155-recovery-*; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn" + env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" + - action: exec + node: m01 + timeout: 2m + cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-*" + + - name: run_gate + actions: + - action: exec + node: m02 + timeout: 87m + cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn SW_BLOCK_PHASE155_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE155_SEQ_MIB=4 SW_BLOCK_PHASE155_RESTART_VERIFY_MIB=4 SW_BLOCK_PHASE155_STATE_HOSTPATH=/tmp/sw-block-phase155-recovery-{{ run_id }} SW_BLOCK_PHASE125_FRONTEND_IP_MAP=m01=10.0.0.1,m02=10.0.0.3 SW_BLOCK_PHASE125_EXPECTED_ROUTE_DEV=enp1s0np0 SW_BLOCK_IMPORT_K3S_SSH_KEY=/opt/work/testdev_key bash scripts/run-phase155-mounted-durable-status-head-lsn-confirmation-gate.sh {{ product_root }}" + env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" + + - name: assert_summary + actions: + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^phase155_mounted_durable_status_head_lsn_confirmation_status=ok$" + save_as: phase155_status_ok + - action: assert_greater + actual: "{{ phase155_status_ok }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^phase152_followup=head_lsn_diagnostic_cleanup$" + save_as: phase152_followup + - action: assert_greater + actual: "{{ phase152_followup }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^runtime_opt_in_enabled=true$" + save_as: runtime_enabled + - action: assert_greater + actual: "{{ runtime_enabled }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^recovery_test_disable_flusher_enabled=true$" + save_as: recovery_test_flusher_disabled + - action: assert_greater + actual: "{{ recovery_test_flusher_disabled }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^restart_persistence_mode=hostpath$" + save_as: restart_persistence + - action: assert_greater + actual: "{{ restart_persistence }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^blockvolume_restart_mode=force_delete_pod$" + save_as: restart_mode + - action: assert_greater + actual: "{{ restart_mode }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^recovery_completed=true$" + save_as: recovery_completed + - action: assert_greater + actual: "{{ recovery_completed }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^recovered_lsn_after_restart=[1-9][0-9]*$" + save_as: recovered_lsn + - action: assert_greater + actual: "{{ recovered_lsn }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^recovered_lsn_remains_correct=true$" + save_as: recovered_lsn_correct + - action: assert_greater + actual: "{{ recovered_lsn_correct }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^durable_status_head_lsn_after_restart=[1-9][0-9]*$" + save_as: head_lsn_after + - action: assert_greater + actual: "{{ head_lsn_after }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^durable_status_head_lsn_equals_recovered_lsn=true$" + save_as: head_equals_recovered + - action: assert_greater + actual: "{{ head_equals_recovered }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^durable_status_evidence_matches_recovered_lsn=true$" + save_as: evidence_matches + - action: assert_greater + actual: "{{ evidence_matches }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^reader_verified_after_restart=true$" + save_as: reader_after + - action: assert_greater + actual: "{{ reader_after }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^ready_after_restart=true$" + save_as: ready_after + - action: assert_greater + actual: "{{ ready_after }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^default_wal_format_unchanged=true$" + save_as: default_unchanged + - action: assert_greater + actual: "{{ default_unchanged }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^roce_claim_allowed=false$" + save_as: no_roce_claim + - action: assert_greater + actual: "{{ no_roce_claim }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^nvme_rdma_claim_allowed=false$" + save_as: no_rdma_claim + - action: assert_greater + actual: "{{ no_rdma_claim }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^performance_slo_claim_allowed=false$" + save_as: no_slo_claim + - action: assert_greater + actual: "{{ no_slo_claim }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^cleanup_status=ok$" + save_as: cleanup_ok + - action: assert_greater + actual: "{{ cleanup_ok }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn/phase155-mounted-durable-status-head-lsn-confirmation-summary.txt" + pattern: "^phase155_decision=mounted_confirmed$" + save_as: decision_confirmed + - action: assert_greater + actual: "{{ decision_confirmed }}" + threshold: "0" + + - name: collect + always: true + actions: + - action: exec + node: m01 + timeout: 2m + cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-{{ run_id }}" + ignore_error: true + - action: exec + node: m02 + timeout: 2m + cmd: "sudo -n rm -rf /tmp/sw-block-phase155-recovery-{{ run_id }}" + ignore_error: true + - action: collect_path + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase155-head-lsn" + name: "remote-phases" + ignore_error: true