feat(ha-heartbeat-liveness): replace hb_timeout_thread with liveness_poll_fn (task 2.1)

Remove hb_vtask_t, hb_timeout_thread, s_hb_vtask from ha.c. Replace with
liveness_poll_ctx_t + delaymgr liveness_poll_fn: checks cancelled flag and
role==CTRL_STANDBY before acting; re-arms at heartbeat_interval_ms/2.
ha_on_primary_ctrl_fd_rdhup calls ha_disarm_heartbeat_timeout_vtask first
to prevent duplicate failover (Req 5.4). ha_on_heartbeat_received writes
last_activity via clock_gettime. Add test_ha_liveness.c with 7 unit tests.
This commit is contained in:
Rongsong Shen 2026-06-01 14:34:14 +00:00
parent 9f9a6b3c0f
commit 738859fb4e
6 changed files with 465 additions and 90 deletions

View file

@ -117,6 +117,8 @@ controller_unit_test_src = [
'testsuite/test_ha_repl_push.c',
'testsuite/test_ha_repl_ack.c',
'testsuite/test_ha_connection_reuse.c',
'testsuite/test_ha_rdhup_integration.c',
'testsuite/test_ha_liveness.c',
'startup_validation.c',
'worker.c',
'persist.c',