myxce/src/controller/testsuite
Rongsong Shen 7b39650229 refactor(ha): passive standby model — primary connects outbound to all peers
Remove fetch_config_from_primary, ha_find_and_connect_to_primary, and the
tier-1/2/3 discovery path. Standbys never initiate outbound connections to
the primary; the primary owns all inter-controller channels.

Key changes:
- ha.c: add primary heartbeat loop (ha_start_primary_heartbeat) that sends
  OPCode_nop to connected standbys every heartbeat_interval_ms; loop
  self-cancels on demotion via role check before re-arm.
- ha.c: add outbound reconnect in primary_heartbeat_fn — for peers absent
  from standby_endpoints, open fresh outbound TLS connection (on_standby_connected
  sends ctrlhello; standby_ep_ctx_t mirrors vote_ep_ctx_t layout).
- ha.c: remove ha_find_and_connect_to_primary + helpers (ha_raw_tcp_connect,
  ha_tcp_connect_hook); remove election_timeout_fn (superseded by
  raft_election_timeout_fn); remove fetch_config_from_primary call from
  ha_elect_evaluate_and_signal STANDBY branch.
- cluster.c: OPCode_requestVote denial no longer reuses inbound connection;
  late joiners are bootstrapped via primary heartbeat outbound connect.
- config_repl.c: remove connect_ssl_raw, do_one_config_fetch,
  fetch_config_from_primary (~250 LOC).
- myapp.c: remove my_tag > 0 fetch branch; all standbys wait passively.
- ha.h: remove ha_find_and_connect_to_primary declaration + macros +
  ha_tcp_connect_hook seam; add ha_start_primary_heartbeat declaration.
- meson.build: remove test_ha_connect.c (tests deleted function).
- controller_test.c: remove test_ha_connect registration.
- CLAUDE.md, src/controller/CLAUDE.md: document passive standby model,
  inbound-vs-outbound connection ownership, async I/O constraint,
  heartbeat model.
- request.h: add xce_request declaration (removes scattered local externs).
2026-06-01 04:17:05 +00:00
..
controller_test.c refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
test.c feat: rename delaymgr precision→precision_ms, replace sleep() with nanosleep() (P0-2b) 2026-05-07 09:08:03 +00:00
test_cluster_persist.c feat: wire persist_init/recover/start/stop into cluster lifecycle (P0-F) 2026-05-07 13:07:47 +00:00
test_config_repl.c feat(config-repl): add raw capnp shims for OP_replConfig wire protocol 2026-05-21 13:02:49 +00:00
test_ctrl_metrics.c feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
test_e2e_capnp.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_checkpoint.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_gc.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_e2e_hooks.c add kiro skills 2026-05-21 03:41:57 +00:00
test_e2e_wal.c test: P0-G end-to-end smoke tests — WAL, checkpoint, hooks, GC, Cap'n Proto (P0-15a-e) 2026-05-07 13:25:17 +00:00
test_gc_retention.c feat: JOB_STAT_TRANSIENT, job_should_retain, worker_should_retain, dead_since (P0-5a, P0-8, P0-13) 2026-05-07 12:52:07 +00:00
test_ha_bootstrap.c fix(ha-bootstrap): skip pre-election config probe; unconfigured nodes defer to post-election fetch 2026-05-29 13:15:46 +00:00
test_ha_bootstrap_support.c feat(election-iomgr-refactor): remove old blocking election code (am_i_primary_quorum, vote_request_thread, bootstrap_config_if_needed) — task 5.3 2026-05-30 13:04:19 +00:00
test_ha_cluster.c feat: wire ha_state_t into cluster_t + HA startup/shutdown lifecycle (P1-5) 2026-05-07 14:55:48 +00:00
test_ha_ctrlhello.c feat(ha-config-bootstrap): implement OP_ctrlHello state sync handler (task 9.3) 2026-05-29 05:22:17 +00:00
test_ha_durability.c test(ha-config-bootstrap): RED-phase tests for ha-term.bin durability (task 6.1) 2026-05-28 10:11:56 +00:00
test_ha_election.c fix(ha-bootstrap): priority staggering and candidate_id in election 2026-05-30 02:48:59 +00:00
test_ha_evaluate_committing.c test(election-iomgr-refactor): add committing_timeout_fn watchdog unit tests — task 6.1 2026-05-30 13:19:31 +00:00
test_ha_failover.c fix(election-iomgr-refactor): Raft election, config decode, and RDHUP chain 2026-05-31 03:54:30 +00:00
test_ha_redirect.c feat: ha_should_redirect + join.c HA redirect/nomaster guard (P1-6) 2026-05-07 15:11:53 +00:00
test_ha_repl_ack.c test(election-iomgr-refactor): add ha_repl_ack_received quorum/promotion unit tests — task 6.2 2026-05-30 13:42:41 +00:00
test_ha_repl_push.c feat(election-iomgr-refactor): config/WAL replication push to standbys in COMMITTING path — task 4.2 2026-05-30 11:56:31 +00:00
test_ha_role.c feat(ha): add phase2_done, repl_ack_count, n_peers, client_ssl_ctx fields and CTRL_PRIMARY_COMMITTING enum 2026-05-30 07:40:38 +00:00
test_ha_start_election_async.c fix(election-iomgr-refactor): correct task 2.4 review findings 2026-05-30 09:27:48 +00:00
test_ha_startup.c feat(election-iomgr-refactor): restructure myapp_run to fully non-blocking async startup — task 5.1 2026-05-30 12:26:56 +00:00
test_ha_vote_gate.c feat(election-iomgr-refactor): extend handle_request_vote with role-based deny gate — task 3.2 2026-05-30 11:03:35 +00:00
test_ha_vote_send.c feat(election-iomgr-refactor): implement vote_reply_msg_handler 2026-05-30 08:45:43 +00:00
test_hooks.c feat: add HOOK_DETAIL_JOB_STOP/RESUME; fix xce_reply ordering after AFTER_EVENT hooks (P0-4a) 2026-05-07 12:08:52 +00:00
test_p1_integration.c test: P1-7 HA foundation integration tests — election, term fencing, watchdog, redirect (P1-7) 2026-05-07 15:22:50 +00:00
test_p2_integration.c test: P2-6 replication integration tests — trim, degraded mode, catch-up lifecycle (P2 gate) 2026-05-07 18:41:10 +00:00
test_p3_hardening.c test: P3-1..P3-5 hardening tests — failover, redirect, WAL, GC, throughput baseline 2026-05-07 23:39:11 +00:00
test_p3_manual_failover.c feat: P3-6 ha_trigger_manual_failover_for_test() shim + 3 failover cycle tests 2026-05-07 23:55:00 +00:00
test_persist_checkpoint.c feat: implement persist_checkpoint with WAL marker, snapshot, trim, rotation (P0-3) 2026-05-07 11:19:08 +00:00
test_persist_hooks.c add kiro skills 2026-05-21 03:41:57 +00:00
test_persist_recovery.c feat: implement persist_recover with snapshot load and WAL replay (P0-4) 2026-05-07 11:41:33 +00:00
test_persist_repl.c feat: P2-4 wire repl_broadcast into persist_wal_async/sync_append; last_replicated_crc 2026-05-07 17:54:48 +00:00
test_persist_schema.c feat: add PersistConfig, SnapshotHeader, ReplEnvelope Cap'n Proto schemas (P0-9) 2026-05-07 10:19:33 +00:00
test_persist_truncate.c test(ha-config-bootstrap): add RED-phase tests for persist_truncate_wal_above (task 7.4) 2026-05-28 14:00:54 +00:00
test_persist_types.c feat: add persist.h — WAL types, persist_config_t, slot_key_t (P0-B) 2026-05-07 09:21:36 +00:00
test_persist_wal.c feat: add schedule_checkpoint() with WAL record-count trigger and idempotency CAS guard 2026-05-13 17:56:46 +00:00
test_repl_apply.c feat: implement job state, queue state, and worker recovery in WAL replay 2026-05-08 08:19:20 +00:00
test_repl_catchup.c feat: P2-5 repl_start/complete_catchup, repl_needs_snapshot — standby catch-up state 2026-05-07 18:14:12 +00:00
test_repl_majority.c feat(ha-config-bootstrap): implement repl_broadcast eviction and pending_ack_count (task 7.2) 2026-05-28 13:44:11 +00:00
test_repl_unit.c feat: P2-3 repl_wait_ack() with pthread_cond_timedwait + ACK deadlock prevention 2026-05-07 17:23:50 +00:00
test_worker_join.c add kiro skills 2026-05-21 03:41:57 +00:00