diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 82db796176..f321538322 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -375,13 +375,16 @@ References: product claims. - Tasks: - - status: planned. + - status: first matrix script prepared; awaiting QA lab run. - walstore baseline fio, - smartwal fio behind explicit flag, - RoCE / 10.0.0.x lab path if available, - 1GbE vs 25GbE comparison, - pgbench scenario, - record CPU, memory, latency, bandwidth, and cleanup state. + - script: `scripts/run-iscsi-backend-fio-matrix.sh`. + - assignment: + `internal/docs/qa-assignments/iscsi-p7-backend-fio-matrix-validation.md`. - Close bar: - same test runner scenario can compare backends, @@ -389,8 +392,9 @@ References: - results are labelled experimental until SLOs exist. - QA/tooling: - - #QA needs TestOps scenario that records network, backend, block size, fio job, - and cleanup state. + - #QA run the backend matrix on M02 first. + - #QA if RoCE is available, rerun with explicit 10.0.0.x portal path and + record the network path in the report. - avoid manual benchmark notes without a repeatable scenario. ## Cross-Cutting Technical Rules diff --git a/seaweed-block/internal/docs/qa-assignments/iscsi-p7-backend-fio-matrix-validation.md b/seaweed-block/internal/docs/qa-assignments/iscsi-p7-backend-fio-matrix-validation.md new file mode 100644 index 0000000000..3f68da1ff3 --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/iscsi-p7-backend-fio-matrix-validation.md @@ -0,0 +1,68 @@ +# QA Assignment: iSCSI P7 Backend FIO Matrix + +Status: ready. +Branch: `iscsi/p7-performance-matrix`. +Scope: experimental Linux iSCSI fio comparison between `walstore` and +`smartwal`. + +## Preconditions + +- Linux host with: + - `open-iscsi`, + - `iscsi_tcp`, + - `mkfs.ext4`, + - `mount`, + - `fio`, + - sudo access. +- No active sw-block iSCSI sessions before the run. + +## Run + +```bash +RUN_ID="$(date -u +%Y%m%dT%H%M%SZ)-iscsi-p7-backend-fio" \ +SW_BLOCK_ARTIFACT_DIR="/mnt/smb/work/share/g15d-k8s/${RUN_ID}" \ +SW_BLOCK_BACKEND_FIO_RUNTIME=60 \ +SW_BLOCK_BACKEND_FIO_SIZE=128m \ +bash scripts/run-iscsi-backend-fio-matrix.sh "$PWD" +``` + +Optional network/backend controls: + +```bash +SW_BLOCK_BACKEND_MATRIX="walstore smartwal" +SW_BLOCK_BACKEND_BASE_ISCSI_PORT=3290 +``` + +## Expected + +- `walstore` run completes. +- `smartwal` run completes. +- each run produces: + - `run.log`, + - `blockmaster.log`, + - `blockvolume.log`, + - `fio.iter1.log`, + - `iscsi-sessions.final.txt`, + - `cleanup.log`. +- top-level `summary.md` contains one row per backend. +- final `iscsiadm -m session` is empty. + +## Evidence To Report + +- branch and commit SHA, +- host/kernel, +- exact command, +- artifact root, +- `summary.md`, +- fio read/write lines for both backends, +- any iSCSI session errors in daemon logs, +- cleanup state. + +## Non-Claims + +- This is not a product performance claim. +- This is not a benchmark publication. +- This is single-host Linux iSCSI only. +- This does not compare RoCE/25GbE unless the report explicitly states the + network path and portal addresses used. +- This does not prove Kubernetes performance. diff --git a/seaweed-block/internal/testops/registration_test.go b/seaweed-block/internal/testops/registration_test.go index d365c2cc1f..ba3bae2f35 100644 --- a/seaweed-block/internal/testops/registration_test.go +++ b/seaweed-block/internal/testops/registration_test.go @@ -328,6 +328,48 @@ func TestISCSIP5CSINodeRestartRegistrationBuildsShellDriver(t *testing.T) { } } +func TestISCSIP7BackendFioMatrixRegistrationBuildsShellDriver(t *testing.T) { + repoRoot := findRepoRoot(t) + raw, err := os.Open(registrationPath(repoRoot, "iscsi-p7-backend-fio-matrix.json")) + if err != nil { + t.Fatalf("open registration: %v", err) + } + defer raw.Close() + + registration, err := DecodeRegistration(raw) + if err != nil { + t.Fatalf("DecodeRegistration: %v", err) + } + if registration.Scenario != "iscsi-p7-backend-fio-matrix" || registration.Driver.Type != "shell" { + t.Fatalf("registration=%+v", registration) + } + driver, err := registration.NewDriver(repoRoot) + if err != nil { + t.Fatalf("NewDriver: %v", err) + } + shell, ok := driver.(ShellDriver) + if !ok { + t.Fatalf("driver type=%T want ShellDriver", driver) + } + if !filepath.IsAbs(shell.Path) || filepath.Base(shell.Path) != "run-iscsi-backend-fio-matrix.sh" { + t.Fatalf("shell path=%q", shell.Path) + } + if _, err := os.Stat(shell.Path); err != nil { + t.Fatalf("shell driver path missing: %v", err) + } + for _, want := range []string{"summary.md", "walstore/fio.iter*.log", "smartwal/fio.iter*.log"} { + if !containsString(registration.Artifacts, want) { + t.Fatalf("registration artifacts missing %q: %v", want, registration.Artifacts) + } + } + if got := registration.ScenarioDefaultParams["SW_BLOCK_BACKEND_MATRIX"]; got != "walstore smartwal" { + t.Fatalf("backend matrix default=%q want walstore smartwal", got) + } + if !containsString(registration.NonClaims, "No product performance claim.") { + t.Fatalf("registration must keep performance non-claim: %v", registration.NonClaims) + } +} + func containsString(values []string, want string) bool { for _, value := range values { if value == want { diff --git a/seaweed-block/internal/testops/registry/iscsi-p7-backend-fio-matrix.json b/seaweed-block/internal/testops/registry/iscsi-p7-backend-fio-matrix.json new file mode 100644 index 0000000000..91bca5615f --- /dev/null +++ b/seaweed-block/internal/testops/registry/iscsi-p7-backend-fio-matrix.json @@ -0,0 +1,51 @@ +{ + "schema_version": "1.0", + "scenario": "iscsi-p7-backend-fio-matrix", + "gate": "iSCSI-P7", + "layer": "L3-privileged-host", + "driver": { + "type": "shell", + "path": "scripts/run-iscsi-backend-fio-matrix.sh" + }, + "default_timeout_s": 1800, + "required_capabilities": [ + "bash", + "linux", + "sudo", + "iscsiadm", + "iscsi_tcp-loadable", + "mkfs.ext4", + "mount", + "fio" + ], + "scenario_default_params": { + "SW_BLOCK_BACKEND_FIO_RUNTIME": "60", + "SW_BLOCK_BACKEND_FIO_SIZE": "128m", + "SW_BLOCK_BACKEND_MATRIX": "walstore smartwal" + }, + "qa_instruction": "internal/docs/qa-assignments/iscsi-p7-backend-fio-matrix-validation.md", + "known_green_commit": "", + "artifacts": [ + "run.log", + "summary.md", + "walstore/run.log", + "walstore/blockmaster.log", + "walstore/blockvolume.log", + "walstore/fio.iter*.log", + "walstore/iscsi-sessions.final.txt", + "walstore/cleanup.log", + "smartwal/run.log", + "smartwal/blockmaster.log", + "smartwal/blockvolume.log", + "smartwal/fio.iter*.log", + "smartwal/iscsi-sessions.final.txt", + "smartwal/cleanup.log" + ], + "non_claims": [ + "Experimental comparison harness only.", + "No product performance claim.", + "Single-host Linux iSCSI only.", + "No Kubernetes performance claim.", + "No RoCE/25GbE claim unless the QA report explicitly records that path." + ] +} diff --git a/seaweed-block/scripts/overview.md b/seaweed-block/scripts/overview.md index e119ad3f75..9205fc0bdd 100644 --- a/seaweed-block/scripts/overview.md +++ b/seaweed-block/scripts/overview.md @@ -20,6 +20,7 @@ This directory contains developer and QA helper scripts. | `run-alpha-k8s-dynamic.sh` | Public dynamic PVC alpha smoke entry. | | `run-alpha-app-demo.sh` | App-demo implementation used by `run-k8s-demo.sh`. | | `run-iscsi-os-smoke.sh` | Privileged Linux OS-initiator smoke: `iscsiadm` -> `mkfs.ext4` -> mount -> checksum -> logout on a 256 MiB target. | +| `run-iscsi-backend-fio-matrix.sh` | Privileged Linux OS-initiator backend matrix: runs the same fio workload against `walstore` and `smartwal`, writing per-backend artifacts and an experimental summary. | | `run-iscsi-alua-os-smoke.sh` | Privileged Linux OS-initiator smoke for ALUA reporting: `iscsiadm` -> `sg_inq`/`sg_rtpg` -> mount -> checksum -> logout. | | `run-iscsi-alua-multipath-smoke.sh` | Privileged Linux OS-initiator smoke for two iSCSI paths: two portals -> ALUA active/standby evidence -> standby write reject -> `multipath -ll`. | | `run-iscsi-alua-mounted-failover-smoke.sh` | Privileged Linux OS-initiator smoke for mounted multipath failover: mount `/dev/mapper/*`, kill active path, wait r2 primary, verify checksum read/write. | diff --git a/seaweed-block/scripts/run-iscsi-backend-fio-matrix.sh b/seaweed-block/scripts/run-iscsi-backend-fio-matrix.sh new file mode 100755 index 0000000000..08b4d21235 --- /dev/null +++ b/seaweed-block/scripts/run-iscsi-backend-fio-matrix.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="${1:-$(pwd)}" +RUN_ID="${RUN_ID:-$(date -u +%Y%m%dT%H%M%SZ)}" +WORK_DIR="${SW_BLOCK_BACKEND_MATRIX_WORK_DIR:-/tmp/sw-block-backend-matrix}" +ARTIFACT_ROOT="${SW_BLOCK_ARTIFACT_DIR:-${WORK_DIR}/runs/${RUN_ID}}" +BIN_DIR="${SW_BLOCK_BIN_DIR:-${WORK_DIR}/bin}" +BACKENDS="${SW_BLOCK_BACKEND_MATRIX:-walstore smartwal}" +FIO_RUNTIME="${SW_BLOCK_BACKEND_FIO_RUNTIME:-60}" +FIO_SIZE="${SW_BLOCK_BACKEND_FIO_SIZE:-128m}" +BASE_ISCSI_PORT="${SW_BLOCK_BACKEND_BASE_ISCSI_PORT:-3290}" +BASE_MASTER_PORT="${SW_BLOCK_BACKEND_BASE_MASTER_PORT:-19730}" +BASE_DATA_PORT="${SW_BLOCK_BACKEND_BASE_DATA_PORT:-19740}" + +mkdir -p "$ARTIFACT_ROOT" "$BIN_DIR" + +log() { + printf '[backend-matrix] %s\n' "$*" | tee -a "$ARTIFACT_ROOT/run.log" +} + +require_cmd() { + if ! command -v "$1" >/dev/null 2>&1; then + echo "missing required command: $1" >&2 + exit 2 + fi +} + +require_cmd bash +require_cmd awk +require_cmd grep +require_cmd tee + +log "run_id=$RUN_ID" +log "root=$ROOT" +log "artifact_root=$ARTIFACT_ROOT" +log "backends=$BACKENDS" +log "fio_runtime=${FIO_RUNTIME}s fio_size=$FIO_SIZE" + +summary="$ARTIFACT_ROOT/summary.md" +cat >"$summary" <&2 + exit 2 + ;; + esac + + idx=$((idx + 1)) + iscsi_port=$((BASE_ISCSI_PORT + idx - 1)) + master_port=$((BASE_MASTER_PORT + idx - 1)) + data_port=$((BASE_DATA_PORT + (idx - 1) * 10)) + child_art="$ARTIFACT_ROOT/${backend}" + child_work="$WORK_DIR/work-${backend}" + mkdir -p "$child_art" "$child_work" + + log "run backend=${backend} iscsi_port=${iscsi_port}" + if RUN_ID="${RUN_ID}-${backend}" \ + SW_BLOCK_ARTIFACT_DIR="$child_art" \ + SW_BLOCK_ISCSI_WORK_DIR="$child_work" \ + SW_BLOCK_BIN_DIR="$BIN_DIR" \ + SW_BLOCK_DURABLE_IMPL="$backend" \ + SW_BLOCK_ISCSI_STRESS=fio \ + SW_BLOCK_ISCSI_FIO_RUNTIME="$FIO_RUNTIME" \ + SW_BLOCK_ISCSI_FIO_SIZE="$FIO_SIZE" \ + SW_BLOCK_ISCSI_IQN="iqn.2026-05.io.seaweedfs:p7-${backend}" \ + SW_BLOCK_ISCSI_PORT="$iscsi_port" \ + SW_BLOCK_MASTER_ADDR="127.0.0.1:${master_port}" \ + SW_BLOCK_DATA_ADDR="127.0.0.1:${data_port}" \ + SW_BLOCK_CTRL_ADDR="127.0.0.1:$((data_port + 1))" \ + SW_BLOCK_STATUS_ADDR="127.0.0.1:$((data_port + 2))" \ + bash "$ROOT/scripts/run-iscsi-os-smoke.sh" "$ROOT" >"$child_art/matrix-child.stdout" 2>"$child_art/matrix-child.stderr"; then + result="PASS" + else + result="FAIL" + overall=1 + fi + + fio_log="$(ls "$child_art"/fio.iter*.log 2>/dev/null | head -n1 || true)" + if [[ -n "$fio_log" ]]; then + fio_summary="$(grep -E "^[[:space:]]*(READ:|WRITE:|read:|write:)" "$fio_log" 2>/dev/null | tr '\n' ';' | sed 's/|/\\|/g' || true)" + if [[ -z "$fio_summary" ]]; then + fio_summary="see fio log" + fi + else + fio_summary="missing fio log" + fi + printf '| `%s` | `%s` | `%s` | %s |\n' "$backend" "$result" "$child_art" "$fio_summary" >>"$summary" +done + +log "summary=$summary" +if [[ "$overall" -ne 0 ]]; then + log "FAIL: at least one backend run failed" + exit "$overall" +fi + +log "PASS: backend fio matrix completed" diff --git a/seaweed-block/scripts/run-iscsi-os-smoke.sh b/seaweed-block/scripts/run-iscsi-os-smoke.sh index 15ecdd956b..f65625f9da 100755 --- a/seaweed-block/scripts/run-iscsi-os-smoke.sh +++ b/seaweed-block/scripts/run-iscsi-os-smoke.sh @@ -19,6 +19,7 @@ CTRL_ADDR="${SW_BLOCK_CTRL_ADDR:-127.0.0.1:19102}" STATUS_ADDR="${SW_BLOCK_STATUS_ADDR:-127.0.0.1:19103}" BLOCKS="${SW_BLOCK_DURABLE_BLOCKS:-65536}" # 256 MiB at 4 KiB. BLOCK_SIZE="${SW_BLOCK_DURABLE_BLOCKSIZE:-4096}" +DURABLE_IMPL="${SW_BLOCK_DURABLE_IMPL:-smartwal}" ITERATIONS="${SW_BLOCK_ISCSI_ITERATIONS:-1}" STRESS="${SW_BLOCK_ISCSI_STRESS:-none}" # none | fio | dd FIO_SIZE="${SW_BLOCK_ISCSI_FIO_SIZE:-32m}" @@ -88,6 +89,7 @@ if [[ -n "$CHAP_USERNAME" || -n "$CHAP_SECRET" ]]; then fi fi log "size_blocks=${BLOCKS} block_size=${BLOCK_SIZE}" +log "durable_impl=${DURABLE_IMPL}" log "iterations=${ITERATIONS}" log "stress=${STRESS}" @@ -156,7 +158,7 @@ setsid -f "${BIN_DIR}/blockvolume" \ --heartbeat-interval 200ms \ --t1-readiness \ --durable-root "${RUN_DIR}/volume-store" \ - --durable-impl smartwal \ + --durable-impl "$DURABLE_IMPL" \ --durable-blocks "$BLOCKS" \ --durable-blocksize "$BLOCK_SIZE" \ "${blockvolume_iscsi_args[@]}" \