From fa77e110a5d798ead144e5e537e8e895665dbd90 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 6 Jul 2026 15:49:11 -0700 Subject: [PATCH] phase146: profile wal materialization effectiveness --- .../docs/releases/nvme-tcp-supported-lab.md | 25 +++ seaweed-block/docs/roadmap.md | 5 +- seaweed-block/internal/docs/current-plan.md | 72 +++---- ...al_record_materialization_effectiveness.md | 57 ++++++ .../internal/docs/product-roadmap.md | 7 +- ...aterialization-effectiveness-qa-signoff.md | 97 +++++++++ ...cord-materialization-effectiveness-gate.sh | 190 ++++++++++++++++++ ...d-materialization-effectiveness-chain.yaml | 167 +++++++++++++++ 8 files changed, 583 insertions(+), 37 deletions(-) create mode 100644 seaweed-block/internal/docs/finished-plans/phase146_finishedplan_wal_record_materialization_effectiveness.md create mode 100644 seaweed-block/internal/docs/qa-assignments/phase146-wal-record-materialization-effectiveness-qa-signoff.md create mode 100644 seaweed-block/scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh create mode 100644 seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml diff --git a/seaweed-block/docs/releases/nvme-tcp-supported-lab.md b/seaweed-block/docs/releases/nvme-tcp-supported-lab.md index b102d268bc..6bd95936df 100644 --- a/seaweed-block/docs/releases/nvme-tcp-supported-lab.md +++ b/seaweed-block/docs/releases/nvme-tcp-supported-lab.md @@ -87,6 +87,7 @@ The supported-lab claim is intentionally narrow: | 143 | 64KiB NVMe/TCP WAL append shape profile | PASS | | 144 | 64KiB NVMe/TCP WAL encode/append pair profile | PASS | | 145 | WAL record materialization allocation reduction | PASS | +| 146 | WAL materialization effectiveness profile | PASS | Key QA sign-offs: @@ -116,6 +117,7 @@ Key QA sign-offs: - `internal/docs/qa-assignments/phase143-wal-append-large-h2c-profile-qa-signoff.md` - `internal/docs/qa-assignments/phase144-wal-encode-append-pair-profile-qa-signoff.md` - `internal/docs/qa-assignments/phase145-wal-record-materialization-reduction-qa-signoff.md` +- `internal/docs/qa-assignments/phase146-wal-record-materialization-effectiveness-qa-signoff.md` ## Performance Baseline @@ -493,6 +495,29 @@ cleanup_status=ok The change removes per-record pointer allocation in `WALStore.WriteBatch`. It preserves WAL format/recovery semantics and is not yet a performance claim. +Phase 146 measured that local change against the Phase 144 encode+append +baseline: + +```text +phase146_wal_record_materialization_effectiveness_status=ok +candidate_max_h2c_bytes=65536 +target_write_request_max_bytes=65536 +backend_write_request_max_bytes=65536 +wal_encode_duration_ms=281 +wal_append_duration_ms=280 +phase146_baseline_pair_ms=592 +phase146_current_pair_ms=561 +phase146_pair_improvement_pct=5.24 +phase146_effectiveness=visible +phase146_decision=keep_change +next_recommendation=phase147_wal_multiblock_record_design_gate +cleanup_status=ok +``` + +This keeps the Phase 145 allocation reduction, but it remains lab evidence and +not a throughput/SLO claim. The next backend gate should select a deeper WAL +design path, such as multi-block WAL records or vectored write-at. + Phase 127 closes the source/component side of the ANA Change Notice gap: ```text diff --git a/seaweed-block/docs/roadmap.md b/seaweed-block/docs/roadmap.md index 007c7fd4b5..e604ecbc6c 100644 --- a/seaweed-block/docs/roadmap.md +++ b/seaweed-block/docs/roadmap.md @@ -111,7 +111,10 @@ Seaweed Block can already demonstrate a narrow Kubernetes block-storage loop: paired with near-equal WAL encode cost; Phase 144 names `wal_record_materialization_reduction` as the next narrow backend target. Phase 145 removes one local batch-allocation seam without changing WAL format - or recovery semantics. This is still not a default or performance/SLO claim. + or recovery semantics. Phase 146 measured that change as visible in the lab + profile, but it is still not a default or performance/SLO claim. The next + backend step is a WAL multi-block-record or vectored-write design gate, not a + public performance claim. - 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 31a8eae6d6..3d95c1b512 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,69 +1,73 @@ -# Current Plan: Phase 146 WAL Record Materialization Effectiveness Profile +# Current Plan: Phase 147 WAL Multi-Block Record Design Gate Status: planning. -Phase 145 closed a narrow WAL record materialization reduction: +Phase 146 closed the WAL materialization effectiveness profile: ```text -phase145_wal_record_materialization_reduction_status=ok +phase146_wal_record_materialization_effectiveness_status=ok wal_record_materialization_change=writebatch_value_entries -unit_record_compatibility=pass candidate_max_h2c_bytes=65536 target_write_request_max_bytes=65536 backend_write_request_max_bytes=65536 -wal_encode_duration_ms=285 -wal_append_duration_ms=293 -writer_verified=true -reader_verified=true -phase145_decision=keep_change -next_recommendation=phase146_wal_record_materialization_effectiveness_profile +wal_encode_duration_ms=281 +wal_append_duration_ms=280 +phase146_pair_improvement_pct=5.24 +phase146_effectiveness=visible +phase146_decision=keep_change +next_recommendation=phase147_wal_multiblock_record_design_gate cleanup_status=ok ``` ## Goal -Measure whether the Phase 145 allocation reduction is visible enough to keep as -a meaningful backend optimization, or whether the next work must move to deeper -WAL format/vectored-I/O design. +Decide the next deeper WAL optimization path without changing durability +semantics by accident. The candidate designs are: + +- multi-block WAL records: encode multiple contiguous block writes into one WAL + record; +- vectored write-at: keep the current record format but reduce materialization + or syscall/copy shape with a platform-gated write path. ## Required Evidence ```text -phase146_wal_record_materialization_effectiveness_status=ok +phase147_wal_multiblock_record_design_status=ok frontend_transport=tcp roce_claim_allowed=false nvme_rdma_claim_allowed=false performance_slo_claim_allowed=false -candidate_max_h2c_bytes=65536 -target_write_request_max_bytes=65536 -backend_write_request_max_bytes=65536 -wal_record_materialization_change=writebatch_value_entries -unit_record_compatibility=pass -wal_encode_duration_ms= -wal_append_duration_ms= -phase146_effectiveness= -phase146_decision= +current_wal_format_unchanged=true +current_recovery_compatibility=pass +candidate_design= +candidate_reduces_record_count= +candidate_reduces_write_calls= +durability_invariant_documented=true +recovery_invariant_documented=true +phase147_decision= next_recommendation= cleanup_status=ok ``` ## Boundaries -- Do not claim throughput/SLO from one noisy lab profile. -- Do not change WAL on-disk format or use platform-specific vectored I/O in - this phase. +- Do not change the WAL on-disk format in Phase 147. +- Do not add Linux-specific writev/pwritev behavior without an explicit + fallback contract. - Do not raise the default H2C size. -- Keep the 64KiB H2C path as explicit opt-in lab evidence. +- Do not claim throughput/SLO from this design gate. ## Candidate Work -1. Re-run the large-H2C profile and compare against Phase 144/145 evidence. -2. Classify the change as visible, not visible, or inconclusive. -3. If not visible/inconclusive, name the next design gate explicitly: - multi-block WAL records or vectored pwrite. +1. Document the current WAL record/recovery invariants and the exact point where + contiguous writes could be grouped safely. +2. Add a local design gate that proves current WAL format/recovery tests still + pass unchanged. +3. Produce an explicit prototype recommendation: + `multi_block_record`, `vectored_writeat`, or `defer`. ## Exit Criteria -Phase 146 can close when it either justifies keeping the local allocation -reduction as visible, or redirects future work to a deeper WAL design gate -without making a performance claim. +Phase 147 can close when the next WAL optimization is selected with durability +and recovery invariants written down, or when the work is explicitly deferred as +too risky for the current NVMe/TCP supported-lab track. diff --git a/seaweed-block/internal/docs/finished-plans/phase146_finishedplan_wal_record_materialization_effectiveness.md b/seaweed-block/internal/docs/finished-plans/phase146_finishedplan_wal_record_materialization_effectiveness.md new file mode 100644 index 0000000000..df4530425e --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase146_finishedplan_wal_record_materialization_effectiveness.md @@ -0,0 +1,57 @@ +# Phase 146 Finished Plan: WAL Record Materialization Effectiveness Profile + +Status: **closed 2026-07-06, live gate PASS**. + +## Problem + +Phase 145 removed one safe local allocation seam in `WALStore.WriteBatch`, but +that did not automatically prove a meaningful backend improvement. The next +step was to measure whether the change was visible enough to keep or whether +future work must move to deeper WAL format/write-path design. + +## Work + +Phase 146 added: + +- `scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh`; +- `testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml`. + +The gate reuses the product-owned Phase 126/120 NVMe/TCP profile path under the +64KiB H2C opt-in and compares encode+append time against the Phase 144 baseline +(`297ms + 295ms`). + +## Evidence + +```text +phase146_wal_record_materialization_effectiveness_status=ok +wal_record_materialization_change=writebatch_value_entries +candidate_max_h2c_bytes=65536 +target_write_request_max_bytes=65536 +backend_write_request_max_bytes=65536 +wal_encode_duration_ms=281 +wal_append_duration_ms=280 +phase146_baseline_pair_ms=592 +phase146_current_pair_ms=561 +phase146_pair_improvement_pct=5.24 +phase146_effectiveness=visible +phase146_decision=keep_change +next_recommendation=phase147_wal_multiblock_record_design_gate +cleanup_status=ok +``` + +Run bundle: + +```text +results\20260706-154244-4e69 +34 actions: 34 passed, 0 failed +``` + +## Conclusion + +The Phase 145 change can stay. It is a visible local reduction in this lab +profile, but it is not a throughput/SLO claim and does not change the public +NVMe/TCP supported-lab boundary. + +The next backend work should stop doing small local materialization tweaks and +open a deeper design gate for fewer WAL records or fewer write calls: +multi-block WAL records and/or vectored write-at. diff --git a/seaweed-block/internal/docs/product-roadmap.md b/seaweed-block/internal/docs/product-roadmap.md index 8ea86c9a17..c149a07905 100644 --- a/seaweed-block/internal/docs/product-roadmap.md +++ b/seaweed-block/internal/docs/product-roadmap.md @@ -473,8 +473,11 @@ rebuild, delete safety, or cleanup must start as a separate gated phase. - Phase 145 is closed for the first WAL materialization reduction. The batch path now uses `[]walEntry` values instead of allocating one `*walEntry` per block, preserving WAL bytes/recovery while removing a local allocation seam. - The next phase should measure whether this is visible or whether deeper WAL - format/vectored-I/O work is required. + Phase 146 measured that change as visible in the lab profile + (`phase146_pair_improvement_pct=5.24`) and kept it, while preserving the + non-claim that this is not a throughput/SLO release statement. The next + backend gate should select a deeper WAL path: multi-block WAL records or + vectored write-at, with durability/recovery invariants documented first. - Later protocol candidates: complete a real NVMe/RDMA target, characterize NVMe/TCP performance, or bridge to object/NIXL acceleration where the product surface is object/storage rather than block PVC. Keep these separate so diff --git a/seaweed-block/internal/docs/qa-assignments/phase146-wal-record-materialization-effectiveness-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase146-wal-record-materialization-effectiveness-qa-signoff.md new file mode 100644 index 0000000000..5938faed15 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase146-wal-record-materialization-effectiveness-qa-signoff.md @@ -0,0 +1,97 @@ +# Phase 146 QA Sign-off: WAL Record Materialization Effectiveness Profile + +Status: **PASS**. + +Branch: `phase146-wal-record-materialization-effectiveness-profile`. + +## Scope + +Phase 146 re-runs the 64KiB NVMe/TCP H2C write-path profile after the Phase 145 +`WALStore.WriteBatch` allocation reduction. The gate classifies whether the +change is visible enough to keep as a meaningful local optimization, or whether +the next work must move to a deeper WAL design gate. + +This is still source-gated lab evidence. It is not a throughput, latency, or +production SLO claim. + +## Local Checks + +```text +bash -n scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh +C:\work\swblock.exe validate testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml +go test ./core/storage ./core/frontend/durable -count=1 +``` + +Result: **PASS**. + +## Live Gate + +Scenario: + +```text +testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml +``` + +Bundle: + +```text +results\20260706-154244-4e69 +34 actions: 34 passed, 0 failed +``` + +Summary: + +```text +phase146_wal_record_materialization_effectiveness_status=ok +frontend_transport=tcp +roce_claim_allowed=false +nvme_rdma_claim_allowed=false +performance_slo_claim_allowed=false +candidate_max_h2c_bytes=65536 +wal_record_materialization_change=writebatch_value_entries +phase146_baseline_encode_ms=297 +phase146_baseline_append_ms=295 +phase146_visible_threshold_pct=5 +unit_record_compatibility=pass +helm_candidate_max_h2c_data_length=65536 +target_write_request_max_bytes=65536 +backend_write_request_max_bytes=65536 +wal_encode_duration_ms=281 +wal_append_duration_ms=280 +writer_verified=true +reader_verified=true +phase146_baseline_pair_ms=592 +phase146_current_pair_ms=561 +phase146_pair_improvement_pct=5.24 +phase146_effectiveness=visible +phase146_decision=keep_change +next_recommendation=phase147_wal_multiblock_record_design_gate +cleanup_status=ok +``` + +Cleanup spot-check: + +```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 +``` + +## Notes + +The first live run produced a valid product summary but failed a scenario +assertion because the runner did not match an alternation-style enum regex. +The scenario assertion was changed to verify stable `key=value` shape while the +gate script remains the owner of enum classification. + +## Verdict + +Phase 146 passes. The Phase 145 allocation reduction is visible in this lab +profile and can stay, but the result is not a public performance claim. The next +meaningful backend gate is a deeper WAL design gate: multi-block WAL records or +vectored write-at, with durability/recovery compatibility proven before any +format change. diff --git a/seaweed-block/scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh b/seaweed-block/scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh new file mode 100644 index 0000000000..d0995590a4 --- /dev/null +++ b/seaweed-block/scripts/run-phase146-wal-record-materialization-effectiveness-gate.sh @@ -0,0 +1,190 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="${1:-$(pwd)}" +ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${ROOT}/results/phase146-wal-record-materialization-effectiveness-gate}" +SUMMARY="${ARTIFACT_DIR}/phase146-wal-record-materialization-effectiveness-summary.txt" +PHASE126_DIR="${ARTIFACT_DIR}/phase126-profile" +CANDIDATE_MAX_H2C_BYTES="${SW_BLOCK_PHASE146_CANDIDATE_MAX_H2C_BYTES:-65536}" +SEQ_MIB="${SW_BLOCK_PHASE146_SEQ_MIB:-512}" +MATERIALIZATION_CHANGE="${SW_BLOCK_PHASE146_MATERIALIZATION_CHANGE:-writebatch_value_entries}" +BASELINE_ENCODE_MS="${SW_BLOCK_PHASE146_BASELINE_ENCODE_MS:-297}" +BASELINE_APPEND_MS="${SW_BLOCK_PHASE146_BASELINE_APPEND_MS:-295}" +VISIBLE_THRESHOLD_PCT="${SW_BLOCK_PHASE146_VISIBLE_THRESHOLD_PCT:-5}" + +mkdir -p "${ARTIFACT_DIR}" "${PHASE126_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_int_eq() { + 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 +} + +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 +} + +float_gt_zero() { + python3 - "$1" <<'PY' +import sys +try: + v = float(sys.argv[1]) +except ValueError: + v = 0 +print(str(v > 0).lower()) +PY +} + +classify_effectiveness() { + python3 - "$BASELINE_ENCODE_MS" "$BASELINE_APPEND_MS" "$1" "$2" "$VISIBLE_THRESHOLD_PCT" <<'PY' +import sys + +baseline_encode = int(sys.argv[1]) +baseline_append = int(sys.argv[2]) +current_encode = int(sys.argv[3]) +current_append = int(sys.argv[4]) +threshold_pct = float(sys.argv[5]) + +baseline_pair = baseline_encode + baseline_append +current_pair = current_encode + current_append +improvement_pct = ((baseline_pair - current_pair) * 100.0) / baseline_pair + +if improvement_pct >= threshold_pct: + effectiveness = "visible" + decision = "keep_change" + next_recommendation = "phase147_wal_multiblock_record_design_gate" +elif improvement_pct <= -threshold_pct: + effectiveness = "inconclusive" + decision = "needs_deeper_design" + next_recommendation = "phase147_wal_multiblock_record_design_gate" +else: + effectiveness = "not_visible" + decision = "needs_deeper_design" + next_recommendation = "phase147_wal_multiblock_record_design_gate" + +print(f"phase146_baseline_pair_ms={baseline_pair}") +print(f"phase146_current_pair_ms={current_pair}") +print(f"phase146_pair_improvement_pct={improvement_pct:.2f}") +print(f"phase146_effectiveness={effectiveness}") +print(f"phase146_decision={decision}") +print(f"next_recommendation={next_recommendation}") +PY +} + +write_summary "phase146_wal_record_materialization_effectiveness_status=running" +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 "candidate_max_h2c_bytes=${CANDIDATE_MAX_H2C_BYTES}" +write_summary "wal_record_materialization_change=${MATERIALIZATION_CHANGE}" +write_summary "phase146_baseline_encode_ms=${BASELINE_ENCODE_MS}" +write_summary "phase146_baseline_append_ms=${BASELINE_APPEND_MS}" +write_summary "phase146_visible_threshold_pct=${VISIBLE_THRESHOLD_PCT}" + +cd "${ROOT}" +go test ./core/storage ./core/frontend/durable \ + >"${ARTIFACT_DIR}/go-test-record-compatibility.log" \ + 2>&1 +write_summary "unit_record_compatibility=pass" + +SW_BLOCK_ARTIFACT_DIR="${PHASE126_DIR}" \ +SW_BLOCK_PHASE126_SEQ_MIB="${SEQ_MIB}" \ +SW_BLOCK_NVME_MAX_H2C_DATA_LENGTH="${CANDIDATE_MAX_H2C_BYTES}" \ + bash "${ROOT}/scripts/run-phase126-block-nvme-tcp-backend-write-instrumentation-gate.sh" "${ROOT}" \ + >"${ARTIFACT_DIR}/phase126-profile.stdout.txt" \ + 2>"${ARTIFACT_DIR}/phase126-profile.stderr.txt" + +PHASE126_SUMMARY="${PHASE126_DIR}/phase126-block-nvme-tcp-backend-write-instrumentation-summary.txt" +PHASE120_SUMMARY="${PHASE126_DIR}/phase125-profile/block-profile/phase120-nvme-tcp-performance-baseline-summary.txt" +if [[ "$(require_summary_value "${PHASE126_SUMMARY}" phase126_block_nvme_tcp_backend_write_instrumentation_status)" != "ok" ]]; then + echo "phase126 profile dependency did not finish ok" >&2 + exit 1 +fi +if [[ "$(require_summary_value "${PHASE120_SUMMARY}" phase120_nvme_tcp_performance_baseline_status)" != "ok" ]]; then + echo "phase120 candidate profile did not finish ok" >&2 + exit 1 +fi + +HELM_H2C="$(require_summary_value "${PHASE120_SUMMARY}" nvme_max_h2c_data_length)" +SEQ_WRITE_MIBPS="$(require_summary_value "${PHASE120_SUMMARY}" seq_write_mibps)" +SEQ_READ_MIBPS="$(require_summary_value "${PHASE120_SUMMARY}" seq_read_mibps)" +WRITER_VERIFIED="$(float_gt_zero "${SEQ_WRITE_MIBPS}")" +READER_VERIFIED="$(float_gt_zero "${SEQ_READ_MIBPS}")" +TARGET_WRITE_REQUEST_MAX_BYTES="$(require_summary_value "${PHASE126_SUMMARY}" target_write_request_max_bytes)" +BACKEND_WRITE_REQUEST_MAX_BYTES="$(require_summary_value "${PHASE126_SUMMARY}" backend_write_request_max_bytes)" +WAL_ENCODE_MS="$(require_summary_value "${PHASE126_SUMMARY}" wal_encode_duration_ms)" +WAL_APPEND_MS="$(require_summary_value "${PHASE126_SUMMARY}" wal_append_duration_ms)" +CLEANUP_STATUS="$(require_summary_value "${PHASE126_SUMMARY}" cleanup_status)" + +assert_int_eq "${HELM_H2C}" "${CANDIDATE_MAX_H2C_BYTES}" "helm_candidate_max_h2c_data_length" +assert_int_eq "${TARGET_WRITE_REQUEST_MAX_BYTES}" "${CANDIDATE_MAX_H2C_BYTES}" "target_write_request_max_bytes" +assert_int_eq "${BACKEND_WRITE_REQUEST_MAX_BYTES}" "${CANDIDATE_MAX_H2C_BYTES}" "backend_write_request_max_bytes" +assert_int_ge "${WAL_ENCODE_MS}" 1 "wal_encode_duration_ms" +assert_int_ge "${WAL_APPEND_MS}" 1 "wal_append_duration_ms" +if [[ "${WRITER_VERIFIED}" != "true" ]]; then + echo "writer_verified=${WRITER_VERIFIED}, want true" >&2 + exit 1 +fi +if [[ "${READER_VERIFIED}" != "true" ]]; then + echo "reader_verified=${READER_VERIFIED}, want true" >&2 + exit 1 +fi +if [[ "${CLEANUP_STATUS}" != "ok" ]]; then + echo "cleanup_status=${CLEANUP_STATUS}, want ok" >&2 + exit 1 +fi + +write_summary "helm_candidate_max_h2c_data_length=${HELM_H2C}" +write_summary "target_write_request_max_bytes=${TARGET_WRITE_REQUEST_MAX_BYTES}" +write_summary "backend_write_request_max_bytes=${BACKEND_WRITE_REQUEST_MAX_BYTES}" +write_summary "wal_encode_duration_ms=${WAL_ENCODE_MS}" +write_summary "wal_append_duration_ms=${WAL_APPEND_MS}" +write_summary "writer_verified=${WRITER_VERIFIED}" +write_summary "reader_verified=${READER_VERIFIED}" +while IFS= read -r line; do + write_summary "${line}" +done < <(classify_effectiveness "${WAL_ENCODE_MS}" "${WAL_APPEND_MS}") +write_summary "cleanup_status=${CLEANUP_STATUS}" +write_summary "phase146_wal_record_materialization_effectiveness_status=ok" diff --git a/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml b/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml new file mode 100644 index 0000000000..273e4fcd42 --- /dev/null +++ b/seaweed-block/testops/scenarios/nvme-tcp-wal-record-materialization-effectiveness-chain.yaml @@ -0,0 +1,167 @@ +name: nvme-tcp-wal-record-materialization-effectiveness-chain +timeout: 90m + +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 + 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; rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness" + env.KUBECONFIG: "/etc/rancher/k3s/k3s.yaml" + + - name: run_gate + actions: + - action: exec + node: m02 + timeout: 82m + cmd: "cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness SW_BLOCK_PHASE146_CANDIDATE_MAX_H2C_BYTES=65536 SW_BLOCK_PHASE146_SEQ_MIB=512 SW_BLOCK_PHASE146_BASELINE_ENCODE_MS=297 SW_BLOCK_PHASE146_BASELINE_APPEND_MS=295 SW_BLOCK_PHASE146_VISIBLE_THRESHOLD_PCT=5 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-phase146-wal-record-materialization-effectiveness-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 }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^phase146_wal_record_materialization_effectiveness_status=ok$" + save_as: phase146_status_ok + - action: assert_greater + actual: "{{ phase146_status_ok }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^wal_record_materialization_change=writebatch_value_entries$" + save_as: materialization_change + - action: assert_greater + actual: "{{ materialization_change }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^unit_record_compatibility=pass$" + save_as: unit_compat + - action: assert_greater + actual: "{{ unit_compat }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-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 }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-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 }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-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 }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^candidate_max_h2c_bytes=65536$" + save_as: candidate_64k + - action: assert_greater + actual: "{{ candidate_64k }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^target_write_request_max_bytes=65536$" + save_as: target_h2c + - action: assert_greater + actual: "{{ target_h2c }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^backend_write_request_max_bytes=65536$" + save_as: backend_h2c + - action: assert_greater + actual: "{{ backend_h2c }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^wal_encode_duration_ms=[1-9][0-9]*$" + save_as: encode_ms + - action: assert_greater + actual: "{{ encode_ms }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^wal_append_duration_ms=[1-9][0-9]*$" + save_as: append_ms + - action: assert_greater + actual: "{{ append_ms }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^phase146_effectiveness=[a-z_][a-z_]*$" + save_as: effectiveness + - action: assert_greater + actual: "{{ effectiveness }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^phase146_decision=[a-z_][a-z_]*$" + save_as: decision + - action: assert_greater + actual: "{{ decision }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^next_recommendation=phase147_.*$" + save_as: next_named + - action: assert_greater + actual: "{{ next_named }}" + threshold: "0" + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness/phase146-wal-record-materialization-effectiveness-summary.txt" + pattern: "^cleanup_status=ok$" + save_as: cleanup_ok + - action: assert_greater + actual: "{{ cleanup_ok }}" + threshold: "0" + + - name: collect + always: true + actions: + - action: collect_path + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase146-effectiveness" + name: "remote-phases" + ignore_error: true