pingqiu b3f90387e3 G5-5 round 13: rewrite #3/#4 to byte-equal pattern + helpers
Per architect ratification round 13 + QA planning input:
  - Add wait_until_byte_equal(lba, pattern, deadline_s) helper —
    cycles kill→m01verify→restart per poll until match or timeout.
    Caller-side honest about OpenReadOnly's no-concurrent-writer
    assumption.
  - Add iscsi_write_pattern(lba, count, pattern) helper using
    python3 binary write (byte-exact pattern; tr does not grok
    \xHH escapes per round-12 finding).
  - Rewrite verify_network_catchup with iptables OUTPUT drop on
    m01 toward M02_IP:M02_REPLICA_DATA_PORT. trap RETURN ensures
    iptables -D runs on any exit path. Pass condition is direct
    byte-equal at LBA[1]=0xcd, not engine-state H/R polling.
  - Rewrite verify_restart_catchup with replica killall+restart
    pattern. Run NAIVELY first per architect ruling — if catch-up
    doesn't converge with BestEffort durability, that is a real
    recovery-path finding to surface, not a test flaw.
  - Diagnostic snapshots from /status/recovery kept as supporting
    evidence only, not pass/fail oracle.

KNOWN ISSUE — round 13 self-test on m01: even verify_byte_equal
(which worked on round 12 part C) now fails before reaching
m01verify. Replica daemon on M02 dies silently after recording
supersede; subsequent SSH_M02 pkill matches nothing → set -e
exit. Replica's primary log ends at 'recording supersede, not
applying to adapter'; no exit/panic/SIGSEGV trace in journalctl
or dmesg. Needs further investigation:
  - Is replica daemon exiting cleanly via some path I'm not aware of?
  - Is there an unbuffered panic going to /dev/null because of
    setsid+nohup+</dev/null?
  - Was round-12-part-C's success actually flaky?

Pausing self-iteration here. Round 13 rewrite is complete in
script; #2 byte-equal already proven on hardware in round 12
part C (committed at 82e9018). #3/#4 need additional debug
either (a) on the daemon's lifecycle, or (b) on the script's
sequencing of the replica daemon during multi-step scenarios.

Refs: architect ruling round 13; QA planning input.
2026-04-27 02:01:03 -07:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%