mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
test: add iscsi backend fio matrix
This commit is contained in:
1 parent
d581f9d49d
commit
fdaceeea04
7 files changed
+288
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -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 {
|
||||
|
||||
@@ -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."
|
||||
]
|
||||
}
|
||||
@@ -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. |
|
||||
|
||||
+116
@@ -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" <<EOF
|
||||
# iSCSI Backend FIO Matrix
|
||||
|
||||
Run ID: \`$RUN_ID\`
|
||||
Root: \`$ROOT\`
|
||||
FIO runtime: \`${FIO_RUNTIME}s\`
|
||||
FIO size: \`$FIO_SIZE\`
|
||||
|
||||
This is an experimental comparison harness. It records comparable evidence; it
|
||||
does not make a product performance claim.
|
||||
|
||||
| Backend | Result | Artifact | FIO summary |
|
||||
|---|---|---|---|
|
||||
EOF
|
||||
|
||||
idx=0
|
||||
overall=0
|
||||
for backend in $BACKENDS; do
|
||||
case "$backend" in
|
||||
walstore|smartwal)
|
||||
;;
|
||||
*)
|
||||
echo "unsupported backend ${backend}; want walstore or smartwal" >&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"
|
||||
@@ -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[@]}" \
|
||||
|
||||
Reference in new issue
Block a user