fix(ha-repl-hardening): ASAN bugs found in snapshot integration test (task 6.6)

- ha_connect_to_peer: set ep->data=NULL before endpoint_fini to prevent
  double-free of sctx (FREEUP in endpoint_fini + explicit free)
- ha_arm_heartbeat_timeout_vtask: defer free to liveness_poll_fn
  (set cancelled=1 only) to prevent UAF race with delaymgr task
- ha_disarm_heartbeat_timeout_vtask: remove free(ctx), matching
  deferred-free contract from ha_arm fix
- Integration test: snapshot transfer trigger confirmed (standby
  lsn=0 < oldest_wal_lsn=1 → SEND_SNAPSHOT on primary)
This commit is contained in:
Rongsong Shen 2026-06-05 08:06:24 +00:00
parent e10cf9a6fc
commit 361397ac02
2 changed files with 23 additions and 6 deletions

View file

@ -241,7 +241,7 @@
- Verify no degraded-mode WARN in logs
- _Requirements: 6.1, 6.3, 6.5, 7.4_
- [ ] 6.6 Integration test: snapshot transfer for lagging standby
- [x] 6.6 Integration test: snapshot transfer for lagging standby
- Start cluster, let WAL accumulate, kill one standby
- Trim WAL on primary so `oldest_wal_lsn > standby's last applied_lsn`
- Restart standby; verify snapshot transfer triggered (INFO log: checkpoint_lsn, size) and completes