fix(internode): align msgpack benchmark gates (#5197)

Update the internode gRPC benchmark P2 env output to require both the msgpack-only request flag and the fleet-confirmed gate before measuring a true msgpack-only phase.

Document the dual-gate rollback semantics and add a dry-run script test so the benchmark driver cannot silently regress to the single-flag flow.

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-24 21:32:44 +08:00
committed by GitHub
parent fc43b149c5
commit d1c2c42c90
5 changed files with 62 additions and 13 deletions
+18 -5
View File
@@ -95,10 +95,15 @@ stage_env() {
;;
p2)
if [[ "${phase}" == "after" ]]; then
# Only enable after the msgpack json-fallback counter has read zero across a window.
printf '%s\n' 'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=true'
# Only enable after the msgpack json-fallback counter has read zero across a window and
# the fleet confirmation gate has passed.
printf '%s\n' \
'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=true' \
'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=true'
else
printf '%s\n' 'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=false'
printf '%s\n' \
'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=false' \
'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=false'
fi
;;
p3)
@@ -155,10 +160,18 @@ case "${STAGE}" in
p0|p1|p2)
echo "-- NOTE: (re)start rustfs on all nodes with the env above before this measurement is valid."
[[ -x "${TRANSPORT_BENCH}" ]] || { echo "ERROR: ${TRANSPORT_BENCH} not found/executable" >&2; exit 1; }
run "${TRANSPORT_BENCH}" --out-dir "${OUT_DIR}" "${PASSTHROUGH[@]}"
if ((${#PASSTHROUGH[@]} > 0)); then
run "${TRANSPORT_BENCH}" --out-dir "${OUT_DIR}" "${PASSTHROUGH[@]}"
else
run "${TRANSPORT_BENCH}" --out-dir "${OUT_DIR}"
fi
;;
p3)
[[ -x "${FAILOVER_BENCH}" ]] || { echo "ERROR: ${FAILOVER_BENCH} not found/executable" >&2; exit 1; }
OUT_DIR="${OUT_DIR}" run "${FAILOVER_BENCH}" "${PASSTHROUGH[@]}"
if ((${#PASSTHROUGH[@]} > 0)); then
OUT_DIR="${OUT_DIR}" run "${FAILOVER_BENCH}" "${PASSTHROUGH[@]}"
else
OUT_DIR="${OUT_DIR}" run "${FAILOVER_BENCH}"
fi
;;
esac
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RUNNER="${SCRIPT_DIR}/run_internode_grpc_ab_bench.sh"
TMP_DIR="$(mktemp -d)"
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
"$RUNNER" --stage p2 --phase before --out-root "$TMP_DIR" --dry-run >/dev/null
"$RUNNER" --stage p2 --phase after --out-root "$TMP_DIR" --dry-run >/dev/null
BEFORE_ENV="${TMP_DIR}/p2-before/server-env.sh"
AFTER_ENV="${TMP_DIR}/p2-after/server-env.sh"
rg -qx 'export RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=false' "$BEFORE_ENV"
rg -qx 'export RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=false' "$BEFORE_ENV"
rg -qx 'export RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=true' "$AFTER_ENV"
rg -qx 'export RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=true' "$AFTER_ENV"
if grep -q 'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY=true' "$BEFORE_ENV"; then
echo "p2 before must not request msgpack-only" >&2
exit 1
fi
if grep -q 'RUSTFS_INTERNODE_RPC_MSGPACK_ONLY_FLEET_CONFIRMED=true' "$BEFORE_ENV"; then
echo "p2 before must not confirm fleet msgpack-only" >&2
exit 1
fi
echo "internode grpc A/B bench env tests passed"