Repository navigation
Expand file tree
/
Copy pathrustfs_performance_testing.sh
More file actions
executable file
·456 lines (427 loc) · 20.1 KB
/
Copy pathrustfs_performance_testing.sh
File metadata and controls
executable file
·456 lines (427 loc) · 20.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
#!/usr/bin/env bash
#
# rustfs-performance-testing.sh
# RustFS object storage benchmark script (fixed): methodology + execution + result parsing
#
# Methodology
# 1) Methods: GET / PUT / MIXED (warp default mix 45% GET + 55% PUT)
# 2) Object sizes: 1KiB 4KiB 16KiB 128KiB 1MiB 4MiB 8MiB 16MiB 32MiB 64MiB
# 3) Concurrency: 64; duration per round: 5m; sleep between rounds: 60s; GET objects: 2500
# 4) Order: GET all sizes -> PUT all sizes -> MIXED all sizes
# 5) Result parsing: after each round, parse the warp output into
# summary.tsv (machine-readable) and summary.md (Markdown tables)
#
# Requirements: warp >= v1.6 (MinIO warp), bash, Python 3 + boto3, awk/sed/grep
# Note: warp v1.6.1's put does not support --objects; handled automatically
# (the flag is only passed for get/mixed)
#
# Env overrides (fixed defaults are used when unset):
# WARP_HOST WARP_ACCESS_KEY WARP_SECRET_KEY WARP_BUCKET
# WARP_CONCURRENCY WARP_DURATION WARP_GET_OBJECTS WARP_SLEEP_BETWEEN_ROUNDS
# WARP_RESULT_DIR
# WARP_METHODS WARP_SIZES # restrict methods/sizes (comma/space separated); empty = full run
# WARP_ROUND_TIMEOUT WARP_MAX_CONSECUTIVE_FAILURES
# WARP_CLEANUP_TIMEOUT WARP_CLEANUP_ATTEMPTS
set -u -o pipefail
HOST="${WARP_HOST:-rustfs-node1:9000,rustfs-node2:9000,rustfs-node3:9000,rustfs-node4:9000}"
ACCESS_KEY="${WARP_ACCESS_KEY:-rustfs@test}"
SECRET_KEY="${WARP_SECRET_KEY:-rustfs@test}"
BUCKET="${WARP_BUCKET:-warp-benchmark-bucket}"
CONCURRENCY="${WARP_CONCURRENCY:-64}"
DURATION="${WARP_DURATION:-5m}"
GET_OBJECTS="${WARP_GET_OBJECTS:-2500}"
SLEEP_BETWEEN_ROUNDS="${WARP_SLEEP_BETWEEN_ROUNDS:-60}"
ROUND_TIMEOUT="${WARP_ROUND_TIMEOUT:-900}"
MAX_CONSECUTIVE_FAILURES="${WARP_MAX_CONSECUTIVE_FAILURES:-0}"
CLEANUP_TIMEOUT="${WARP_CLEANUP_TIMEOUT:-180}"
CLEANUP_ATTEMPTS="${WARP_CLEANUP_ATTEMPTS:-3}"
RESULT_DIR="${WARP_RESULT_DIR:-$(pwd)/warp-bench-results-$(date +%Y%m%d-%H%M%S)}"
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
S3_HELPER="${SCRIPT_DIR}/scripts/performance_s3.py"
S3_ENDPOINT="${HOST%%,*}"
[[ "${S3_ENDPOINT}" == *://* ]] || S3_ENDPOINT="http://${S3_ENDPOINT}"
export WARP_ACCESS_KEY="${ACCESS_KEY}" WARP_SECRET_KEY="${SECRET_KEY}"
umask 077
if [ -n "${WARP_SIZES:-}" ] && [ "${WARP_SIZES}" != "all" ] && [ "${WARP_SIZES}" != "ALL" ]; then
read -r -a SIZES <<<"${WARP_SIZES//,/ }"
else
SIZES=(1KiB 4KiB 16KiB 128KiB 1MiB 4MiB 8MiB 16MiB 32MiB 64MiB)
fi
if [ -n "${WARP_METHODS:-}" ] && [ "${WARP_METHODS}" != "all" ] && [ "${WARP_METHODS}" != "ALL" ]; then
read -r -a METHODS <<<"${WARP_METHODS//,/ }"
else
METHODS=(get put mixed)
fi
TOTAL_ROUNDS=$(( ${#METHODS[@]} * ${#SIZES[@]} ))
ROUND=0
PARSED_ROUNDS=0
FAILED_ROUNDS=0
CONSECUTIVE_FAILURES=0
ABORT_REASON=aborted
# --parse-only <result-dir>: parse an existing result dir (${method}_${size}.txt) without running
# Only round files with a successful terminal execution status can be certified.
OUTPUT_TAG=""
if [[ "${1:-}" == "--parse-only" && -n "${2:-}" ]]; then
RESULT_DIR="$2"
fi
if [[ "${1:-}" == "--parse-only" ]]; then
# Reanalysis must not rewrite the execution's abort states, timings or reports.
OUTPUT_TAG=".reparsed"
fi
LOG_FILE="${RESULT_DIR}/master${OUTPUT_TAG}.log"
SUMMARY_TSV="${RESULT_DIR}/summary${OUTPUT_TAG}.tsv"
SUMMARY_MD="${RESULT_DIR}/summary${OUTPUT_TAG}.md"
ROUNDS_TSV="${RESULT_DIR}/rounds${OUTPUT_TAG}.tsv"
PARSE_FAILURE_REASON=""
if [[ "${1:-}" != "--parse-only" ]] && ! command -v warp >/dev/null 2>&1; then
echo "error: warp command not found; install MinIO warp first" >&2
exit 1
fi
if [[ "${1:-}" != "--parse-only" ]]; then
if ! python3 -c 'import boto3; from botocore.config import Config' >/dev/null 2>&1; then
echo "error: Python 3 with boto3 is required for verified benchmark cleanup" >&2
exit 1
fi
if ! command -v timeout >/dev/null 2>&1; then
echo "error: GNU timeout is required for bounded benchmark and cleanup phases" >&2
exit 1
fi
if [[ ! "${CLEANUP_TIMEOUT}" =~ ^[1-9][0-9]*$ || ! "${CLEANUP_ATTEMPTS}" =~ ^[1-9][0-9]*$ ]]; then
echo "error: cleanup timeout and attempts must be positive integers" >&2
exit 1
fi
if [[ -f "${LOG_FILE}" ]]; then
echo "error: result directory already contains an execution; use a fresh directory or --parse-only" >&2
exit 1
fi
fi
log() {
echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') $*" | tee -a "${LOG_FILE}"
}
# ---- Result parsing ----
round_error_lines() {
awk '
{ line = tolower($0)
if (line ~ /<error>|serviceunavailable|the service is unavailable|errors:[[:space:]]*[1-9][0-9]*/) count++ }
END { print count + 0 }
' "$1"
}
record_round() {
local method="$1" size="$2" file="$3" verdict="$4" reason="$5" warp_rc="$6" capture_rc="$7" elapsed="$8"
local reported=0 errors=0
if [[ "${verdict}" != NOT_RUN && -f "${file}" ]]; then
grep -q '^Report: ' "${file}" && reported=1
errors=$(round_error_lines "${file}")
fi
if [[ "${warp_rc}" == 124 ]]; then
reason=timeout_before_report
[[ "${reported}" == 0 ]] || reason=timeout_after_report
elif [[ "${warp_rc}" == 137 ]]; then
reason=killed_before_report
[[ "${reported}" == 0 ]] || reason=killed_after_report
fi
local lifecycle=$'unknown\tunknown\tunknown\tunknown\tunknown\tunknown\tunknown\tunknown'
if [[ -f "${RESULT_DIR}/${method}_${size}.s3.json" ]]; then
lifecycle=$(python3 "${S3_HELPER}" fields --state "${RESULT_DIR}/${method}_${size}.s3.json" 2>/dev/null) || lifecycle=$'unknown\tunknown\tFAIL\tunknown\tunknown\tunknown\tunknown\tunknown'
fi
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
"${method}" "${size}" "${verdict}" "${reason}" "${warp_rc}" "${capture_rc}" "${elapsed}" "${reported}" "${errors}" "${lifecycle}" >> "${ROUNDS_TSV}"
}
# Extract the raw Average / Reqs / TTFB lines of a section (GET/PUT/Total etc.)
section_lines() {
awk -v sec="$2" '
/^Report: / { cur = $2; sub(/\.$/, "", cur) }
cur == sec && /^ *\* Average:/ { avg = $0 }
cur == sec && /^ *\* Reqs:/ { reqs = $0 }
cur == sec && /^ *\* TTFB:/ { ttfb = $0 }
END {
if (avg != "") print avg
if (reqs != "") print reqs
if (ttfb != "") print ttfb
}
' "$1"
}
# Extract fields from a stats block: tp objs avg p50 p90 p99 ttfb_avg ttfb_p99 ttfb_worst
field() {
case "$2" in
tp) echo "$1" | sed -n 's/^ *\* Average: \(.*\), \([0-9.]*\) obj\/s.*/\1/p' ;;
objs) echo "$1" | sed -n 's/^ *\* Average: .*, \([0-9.]*\) obj\/s.*/\1/p' ;;
avg) echo "$1" | sed -n 's/^ *\* Reqs: Avg: \([^,]*\),.*/\1/p' ;;
p50) echo "$1" | sed -n 's/^ *\* Reqs: Avg: [^,]*, 50%: \([^,]*\),.*/\1/p' ;;
p90) echo "$1" | sed -n 's/^ *\* Reqs: Avg: [^,]*, 50%: [^,]*, 90%: \([^,]*\),.*/\1/p' ;;
p99) echo "$1" | sed -n 's/^ *\* Reqs: Avg: [^,]*, 50%: [^,]*, 90%: [^,]*, 99%: \([^,]*\),.*/\1/p' ;;
ttfb_avg) echo "$1" | sed -n 's/^ *\* TTFB: Avg: \([^,]*\),.*/\1/p' ;;
ttfb_p99) echo "$1" | sed -n 's/^ *\* TTFB: .*99th: \([^,]*\),.*/\1/p' ;;
ttfb_worst) echo "$1" | sed -n 's/^ *\* TTFB: .*Worst: \([^ ]*\).*/\1/p' ;;
*) echo "" ;;
esac
}
# Parse one round's output and append a row to summary.tsv
parse_round() {
local method="$1" size="$2" file="$3"
PARSE_FAILURE_REASON=""
if [[ "$(tail -n 1 "$file")" != "RustFS round status: warp=0 capture=0" ]]; then
PARSE_FAILURE_REASON=missing_or_failed_round_status
log "PARSE_FAILED method=${method} size=${size} reason=missing_or_failed_round_status file=${file}"
return 1
fi
if [[ "$(round_error_lines "$file")" -gt 0 ]]; then
PARSE_FAILURE_REASON=logged_errors
log "PARSE_FAILED method=${method} size=${size} reason=logged_errors file=${file} (metrics retained in raw output)"
return 1
fi
if grep -q '^RustFS lifecycle schema: 1$' "$file"; then
local lifecycle bucket prepare cleanup cleanup_errors remaining http_503 request_failures had_cleanup_errors
lifecycle=$(python3 "${S3_HELPER}" fields --state "${RESULT_DIR}/${method}_${size}.s3.json" 2>/dev/null) || lifecycle=""
IFS=$'\t' read -r bucket prepare cleanup cleanup_errors remaining http_503 request_failures had_cleanup_errors <<< "${lifecycle}"
if [[ "${prepare}" != PASS || "${cleanup}" != PASS || "${remaining}" != 0 ]]; then
PARSE_FAILURE_REASON=cleanup_unverified
return 1
fi
if [[ "${cleanup_errors}" != 0 || "${http_503}" != 0 || "${request_failures}" != 0 || "${had_cleanup_errors}" != False ]]; then
PARSE_FAILURE_REASON=cleanup_errors
return 1
fi
fi
local line
if [[ "${method}" == "mixed" ]]; then
local total get put
total=$(section_lines "$file" Total)
get=$(section_lines "$file" GET)
put=$(section_lines "$file" PUT)
line=$(printf 'mixed\t%s\t%s\t%s\t%s\t%s' \
"$size" \
"$(field "${total}" tp)" \
"$(field "${total}" objs)" \
"$(field "${get}" avg)" \
"$(field "${put}" avg)")
else
local sec
sec=$(printf '%s' "${method}" | tr '[:lower:]' '[:upper:]')
local stats
stats=$(section_lines "$file" "${sec}")
line=$(printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s' \
"${method}" "${size}" \
"$(field "${stats}" tp)" \
"$(field "${stats}" objs)" \
"$(field "${stats}" avg)" \
"$(field "${stats}" p50)" \
"$(field "${stats}" p90)" \
"$(field "${stats}" p99)" \
"$(field "${stats}" ttfb_avg)" \
"$(field "${stats}" ttfb_p99)" \
"$(field "${stats}" ttfb_worst)")
fi
# TTFB is optional in warp; throughput and request statistics define a result.
if ! printf '%s\n' "${line}" | awk -F '\t' '
{ last = $1 == "mixed" ? 6 : 8
for (i = 3; i <= last; i++) if ($i !~ /[^[:space:]]/) exit 1 }
'; then
PARSE_FAILURE_REASON=missing_required_metrics
log "PARSE_FAILED method=${method} size=${size} reason=missing_required_metrics file=${file}"
return 1
fi
printf '%s\n' "${line}" >> "${SUMMARY_TSV}"
}
# Build summary.md (Markdown tables) from summary.tsv
gen_summary_md() {
{
echo "# RustFS Performance Test Results"
echo ""
echo "- Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "- Target: ${HOST}"
echo "- Concurrency: ${CONCURRENCY}; duration: ${DURATION}; sleep: ${SLEEP_BETWEEN_ROUNDS}s; GET objects: ${GET_OBJECTS}"
echo "- Methods: ${METHODS[*]-}; sizes: ${SIZES[*]-}"
echo "- Rounds: selected=${TOTAL_ROUNDS}; parsed=${PARSED_ROUNDS}; failed=${FAILED_ROUNDS}"
if [[ -n "${OUTPUT_TAG}" ]]; then
echo "- Reparsed raw outputs: elapsed time is unknown; configuration above is from this parser invocation. See the original rounds.tsv, master.log and summary files for execution evidence."
fi
echo "- Each round owns a fresh bucket. The Warp phase includes its fixture preparation and workload; native benchdata records the measured workload. Setup and verified cleanup have separate logs."
echo "- Warp timeout: ${ROUND_TIMEOUT}s; cleanup has a separate ${CLEANUP_TIMEOUT}s recovery budget. Report presence alone does not identify the internal Warp phase."
echo "- Any cleanup error keeps the round failed even when retries remove the residue. An incomplete cleanup aborts the remaining matrix. Legacy results without a lifecycle receipt have unknown cleanup status."
echo ""
echo "## Every selected round"
echo ""
echo "| Method | Size | Verdict | Reason | Warp exit | Capture exit | Elapsed seconds | Report present | Warp error lines | Bucket | Setup | Cleanup | Delete key failure entries | Remaining objects | Cleanup HTTP 503 attempts | Cleanup request failures | Cleanup had errors |"
echo "|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|"
awk -F '\t' 'NR > 1 { printf "| %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s |\n", $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 }' "${ROUNDS_TSV}"
echo ""
} > "${SUMMARY_MD}"
for m in get put; do
{
echo "## $(printf '%s' "$m" | tr '[:lower:]' '[:upper:]') Results"
echo ""
echo "| Object Size | Avg Throughput | Avg obj/s | Avg Latency | P50 | P90 | P99 | TTFB Avg | TTFB P99 | TTFB Worst |"
echo "|-------------|----------------|-----------|-------------|-----|-----|-----|----------|----------|------------|"
} >> "${SUMMARY_MD}"
while IFS=$'\t' read -r method size tp objs avg p50 p90 p99 ttfb_avg ttfb_p99 ttfb_worst; do
[[ "${method}" == "${m}" ]] && \
echo "| ${size} | ${tp} | ${objs} | ${avg} | ${p50} | ${p90} | ${p99} | ${ttfb_avg} | ${ttfb_p99} | ${ttfb_worst} |" >> "${SUMMARY_MD}"
done < "${SUMMARY_TSV}"
echo "" >> "${SUMMARY_MD}"
done
{
echo "## MIXED Results (Total)"
echo ""
echo "| Object Size | Total Avg Throughput | Total Avg obj/s | MIXED GET Avg | MIXED PUT Avg |"
echo "|-------------|----------------------|-----------------|---------------|---------------|"
} >> "${SUMMARY_MD}"
while IFS=$'\t' read -r method size tp objs gavg pavg rest; do
[[ "${method}" == "mixed" ]] && \
echo "| ${size} | ${tp} | ${objs} | ${gavg} | ${pavg} |" >> "${SUMMARY_MD}"
done < "${SUMMARY_TSV}"
echo "" >> "${SUMMARY_MD}"
}
# ---- Main flow ----
mkdir -p "${RESULT_DIR}" || exit 1
log "CONFIG host=${HOST} bucket=${BUCKET} concurrency=${CONCURRENCY} duration=${DURATION} get_objects=${GET_OBJECTS} sleep_between_rounds=${SLEEP_BETWEEN_ROUNDS}s" || exit 1
printf 'method\tsize\tthroughput\tobj_per_s\treq_avg\treq_p50\treq_p90\treq_p99\tttfb_avg\tttfb_p99\tttfb_worst\n' > "${SUMMARY_TSV}" || exit 1
printf 'method\tsize\tverdict\treason\twarp_exit\tcapture_exit\telapsed_seconds\treport_present\terror_lines\tbucket\tprepare\tcleanup\tcleanup_error_entries\tremaining_objects\tcleanup_http_503_attempts\tcleanup_request_failures\tcleanup_had_errors\n' > "${ROUNDS_TSV}" || exit 1
if [[ ${TOTAL_ROUNDS} -eq 0 ]]; then
log "NO_ROUNDS_SELECTED"
gen_summary_md
exit 1
fi
if [[ "${1:-}" == "--parse-only" ]]; then
for method in "${METHODS[@]}"; do
for size in "${SIZES[@]}"; do
outfile="${RESULT_DIR}/${method}_${size}.txt"
PARSE_FAILURE_REASON=missing_output
warp_rc=unknown; capture_rc=unknown
if [[ -s "${outfile}" ]]; then
terminal=$(tail -n 1 "${outfile}")
if [[ "${terminal}" =~ ^RustFS\ round\ status:\ warp=([0-9]+)\ capture=([0-9]+)$ ]]; then
warp_rc=${BASH_REMATCH[1]}; capture_rc=${BASH_REMATCH[2]}
fi
fi
if [[ -s "${outfile}" ]] && parse_round "${method}" "${size}" "${outfile}"; then
PARSED_ROUNDS=$((PARSED_ROUNDS + 1))
record_round "${method}" "${size}" "${outfile}" PASS clean "${warp_rc}" "${capture_rc}" unknown
else
FAILED_ROUNDS=$((FAILED_ROUNDS + 1))
log "PARSE_FAILED method=${method} size=${size} file=${outfile}"
record_round "${method}" "${size}" "${outfile}" FAIL "${PARSE_FAILURE_REASON}" "${warp_rc}" "${capture_rc}" unknown
fi
done
done
gen_summary_md || exit 1
echo "parsed from ${RESULT_DIR}"
echo ""
cat "${SUMMARY_MD}" || exit 1
[[ ${FAILED_ROUNDS} -eq 0 && ${PARSED_ROUNDS} -eq ${TOTAL_ROUNDS} ]]
exit $?
fi
active_state=""
active_events=""
run_cleanup() {
timeout --signal=TERM --kill-after=5 "${CLEANUP_TIMEOUT}" python3 "${S3_HELPER}" cleanup --endpoint "${S3_ENDPOINT}" \
--state "${active_state}" --events "${active_events}" --budget "${CLEANUP_TIMEOUT}" \
--attempts "${CLEANUP_ATTEMPTS}" > "${active_state%.s3.json}.cleanup.log" 2>&1
}
cleanup_on_exit() {
local exit_status=$?
trap - EXIT INT TERM
if [[ -n "${active_state}" ]]; then
log "RECOVERY cleanup_on_exit receipt=${active_state}"
run_cleanup || log "RECOVERY_FAILED receipt=${active_state}"
fi
exit "${exit_status}"
}
trap cleanup_on_exit EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
for method in "${METHODS[@]}"; do
for size in "${SIZES[@]}"; do
ROUND=$((ROUND + 1))
outfile="${RESULT_DIR}/${method}_${size}.txt"
state_file="${RESULT_DIR}/${method}_${size}.s3.json"
events_file="${RESULT_DIR}/${method}_${size}.s3-events.jsonl"
log "START round=${ROUND}/${TOTAL_ROUNDS} method=${method} size=${size} concurrency=${CONCURRENCY} duration=${DURATION}"
extra_args=()
if [[ "${method}" != "put" ]]; then
extra_args=(--objects "${GET_OBJECTS}")
fi
start_epoch=$(date +%s)
log "PHASE round=${ROUND} stage=setup"
active_state="${state_file}"
active_events="${events_file}"
if ! timeout --signal=TERM --kill-after=5 30 python3 "${S3_HELPER}" prepare --endpoint "${S3_ENDPOINT}" --prefix "${BUCKET}" \
--state "${state_file}" --events "${events_file}" --budget 30 > "${RESULT_DIR}/${method}_${size}.prepare.log" 2>&1; then
FAILED_ROUNDS=$((FAILED_ROUNDS + 1))
record_round "${method}" "${size}" "" FAIL setup_failed 125 0 "$(( $(date +%s) - start_epoch ))"
ABORT_REASON=setup_failed
log "ABORT round=${ROUND} reason=setup_failed"
break 2
fi
round_bucket=$(python3 "${S3_HELPER}" bucket --state "${state_file}") || exit 1
warp_args=("${method}" \
--host "${HOST}" \
--bucket "${round_bucket}" \
--noclear \
--benchdata "${RESULT_DIR}/${method}_${size}.benchdata" \
--concurrent "${CONCURRENCY}" \
--duration "${DURATION}" \
--obj.size "${size}" \
${extra_args[@]+"${extra_args[@]}"} \
--no-color)
log "PHASE round=${ROUND} stage=warp bucket=${round_bucket}"
if [[ "${ROUND_TIMEOUT}" =~ ^[1-9][0-9]*$ ]]; then
timeout --signal=TERM --kill-after=30 "${ROUND_TIMEOUT}" \
bash -c 'warp "$@"' bash "${warp_args[@]}" 2>&1 | tee "${outfile}"
else
warp "${warp_args[@]}" 2>&1 | tee "${outfile}"
fi
round_status=("${PIPESTATUS[@]}")
rc=${round_status[0]}
capture_rc=${round_status[1]}
log "PHASE round=${ROUND} stage=cleanup bucket=${round_bucket}"
cleanup_rc=0
run_cleanup || cleanup_rc=$?
active_state=""
end_epoch=$(date +%s)
printf '\nRustFS lifecycle schema: 1\nRustFS round status: warp=%s capture=%s\n' "${rc}" "${capture_rc}" >> "${outfile}" || capture_rc=1
PARSE_FAILURE_REASON=warp_exit
[[ ${capture_rc} -eq 0 ]] || PARSE_FAILURE_REASON=output_capture
[[ ${cleanup_rc} -eq 0 ]] || PARSE_FAILURE_REASON=cleanup_unverified
if [[ ${rc} -eq 0 && ${capture_rc} -eq 0 && ${cleanup_rc} -eq 0 ]] && parse_round "${method}" "${size}" "${outfile}"; then
PARSED_ROUNDS=$((PARSED_ROUNDS + 1))
CONSECUTIVE_FAILURES=0
log "END round=${ROUND}/${TOTAL_ROUNDS} method=${method} size=${size} rc=${rc} elapsed=$((end_epoch - start_epoch))s parsed=ok"
record_round "${method}" "${size}" "${outfile}" PASS clean "${rc}" "${capture_rc}" "$((end_epoch - start_epoch))"
else
FAILED_ROUNDS=$((FAILED_ROUNDS + 1))
CONSECUTIVE_FAILURES=$((CONSECUTIVE_FAILURES + 1))
log "END round=${ROUND}/${TOTAL_ROUNDS} method=${method} size=${size} rc=${rc} capture_rc=${capture_rc} elapsed=$((end_epoch - start_epoch))s parsed=failed"
record_round "${method}" "${size}" "${outfile}" FAIL "${PARSE_FAILURE_REASON}" "${rc}" "${capture_rc}" "$((end_epoch - start_epoch))"
if [[ ${cleanup_rc} -ne 0 ]]; then
log "ABORT round=${ROUND} reason=cleanup_incomplete receipt=${state_file}"
ABORT_REASON=cleanup_incomplete
break 2
fi
if [[ "${MAX_CONSECUTIVE_FAILURES}" =~ ^[1-9][0-9]*$ ]] \
&& (( CONSECUTIVE_FAILURES >= MAX_CONSECUTIVE_FAILURES )); then
log "ABORT consecutive_failures=${CONSECUTIVE_FAILURES} limit=${MAX_CONSECUTIVE_FAILURES}"
break 2
fi
fi
if [[ ${ROUND} -lt ${TOTAL_ROUNDS} ]]; then
log "SLEEP ${SLEEP_BETWEEN_ROUNDS}s before next round"
sleep "${SLEEP_BETWEEN_ROUNDS}"
fi
done
done
# An early abort leaves explicit unexecuted rows rather than shortening the
# selected matrix silently. Raw metrics from failed rounds remain diagnostic.
for method in "${METHODS[@]}"; do
for size in "${SIZES[@]}"; do
if ! awk -F '\t' -v m="${method}" -v s="${size}" 'NR>1 && $1==m && $2==s {found=1} END {exit !found}' "${ROUNDS_TSV}"; then
record_round "${method}" "${size}" "" NOT_RUN "${ABORT_REASON}" unknown unknown 0
fi
done
done
gen_summary_md || exit 1
log "ALL_ROUNDS_COMPLETE selected=${TOTAL_ROUNDS} parsed=${PARSED_ROUNDS} failed=${FAILED_ROUNDS} summary_tsv=${SUMMARY_TSV} summary_md=${SUMMARY_MD}" || exit 1
echo ""
echo "==== Results summary ===="
cat "${SUMMARY_MD}" || exit 1
[[ ${FAILED_ROUNDS} -eq 0 && ${PARSED_ROUNDS} -eq ${TOTAL_ROUNDS} ]]