G5-5 round 12 part C: fix dd 0xab fill (tr lacks \xHH escape support)

QA round 12 self-test on m01: m01verify reported MISMATCH on
LBA 0 — but inspecting the bytes via xxd showed the primary's
on-disk file matched the replica's, both 0x78 (ASCII 'x') × 4096.
Replication chain is correct; the script wrote the wrong bytes.

Root cause: the script used 'tr "\0" "\xab"' which DOES
NOT produce 0xab. tr's escape grammar recognizes only octal
(\NNN) and a small set of letter escapes (\n, \t, ...);
\xHH is not understood — tr substitutes with the literal first
char of the replacement string, which is '\' parsed loosely
giving 'x' (0x78). Verified empirically on m01:

  $ dd if=/dev/zero bs=4096 count=1 2>/dev/null | tr "\0" "\xab" | xxd | head -1
  00000000: 7878 7878 7878 7878 7878 7878 7878 7878  xxxxxxxxxxxxxxxx

Fix: use python3 binary write — guaranteed byte-exact 0xab fill:
  python3 -c "...sys.stdout.buffer.write(b'\xab' * 4096)..."

Round 12 part C result on m01:
  ✓ verify_cluster_ready
  ✓ verify_byte_equal — m01verify reports 'OK 1 LBA(s) byte-equal'

This is the FIRST end-to-end PASS of acceptance criterion #2 on
real hardware. The replication chain (lineage latch + ship +
barrier + apply) is verified working. verify_network_catchup
still hits H-advance false-positive (engine state semantic is
probe-driven, not local-write-driven; same as fix in #2 but
applied per-step); will address next.

Refs: round 12 m01 self-test full progression
(rounds 1-11 surfaced 14 distinct bugs each isolated and fixed).
This commit is contained in:
pingqiu committed 2026-04-27 01:43:07 -07:00
1 parent 8d6c4a807b
commit 82e9018bae
1 file changed
+5 -2
@@ -384,8 +384,11 @@ sleep 2
DEV=$(ls -t /dev/disk/by-path/*'"${ISCSI_IQN}"'*-lun-0 2>/dev/null | head -1)
[ -n "$DEV" ] || { echo "ERROR: iSCSI device not visible after login"; exit 2; }
echo "DEV=$DEV"
# Fill 1 block with 0xab and write to LBA 0
sudo dd if=/dev/zero bs=4096 count=1 2>/dev/null | tr "\0" "\xab" | sudo dd of="$DEV" bs=4096 count=1 conv=fsync,nocreat
# Fill 1 block with 0xab and write to LBA 0.
# NOTE: do NOT use `tr "\0" "\xab"` — tr does not interpret \xHH
# escapes; it would substitute with the literal char "x" (0x78).
# Use python3 binary write for byte-exact 0xab.
python3 -c "import sys; sys.stdout.buffer.write(b\"\xab\" * 4096)" | sudo dd of="$DEV" bs=4096 count=1 conv=fsync,nocreat
sync
sudo iscsiadm -m node -T '"${ISCSI_IQN}"' -p 127.0.0.1:'"${M01_ISCSI_PORT}"' --logout >/dev/null
echo "WROTE-LBA-0-PATTERN-AB"