myxce/src/controller
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
..
include fix(ha-bootstrap): register listener with iomgr epoll before election 2026-05-30 00:10:23 +00:00
testsuite refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
apiserver.c add kiro skills 2026-05-21 03:41:57 +00:00
CLAUDE.md refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
cluster.c refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
config_repl.c refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
config_repl.h fix(election-iomgr-refactor): Raft election, config decode, and RDHUP chain 2026-05-31 03:54:30 +00:00
ctrl_metrics.c feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
dataex.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
ha.c refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
ha.h refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
job.c feat: implement job state, queue state, and worker recovery in WAL replay 2026-05-08 08:19:20 +00:00
join.c fix(election-iomgr-refactor): config replication and RDHUP failover chain 2026-05-31 02:08:48 +00:00
main.c feat(ha-config-bootstrap): add peer count and cert pre-flight validation (task 2.3) 2026-05-28 04:29:31 +00:00
meson.build refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
misc.c save works 2026-03-05 16:03:37 +08:00
myapp.c refactor(ha): passive standby model — primary connects outbound to all peers 2026-06-01 04:17:05 +00:00
myconf.c feat(ha-config-bootstrap): implement --vcpus CLI, wire validation, remove vcpus from config (task 2.2) 2026-05-28 04:17:06 +00:00
opget.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
opupd.c save works 2026-03-03 16:49:26 +08:00
persist.c feat(ha-config-bootstrap): wire repl_wait_majority_ack into persist_wal_sync_append (task 7.6) 2026-05-28 14:28:38 +00:00
queue.c feat: implement job state, queue state, and worker recovery in WAL replay 2026-05-08 08:19:20 +00:00
repl.c feat(ha-config-bootstrap): implement repl_wait_majority_ack with quorum formula and ack_op discrimination (task 7.3) 2026-05-28 13:57:24 +00:00
reply.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
resources.c update controller code 2025-11-05 16:58:57 +08:00
sched.c add kiro skills 2026-05-21 03:41:57 +00:00
startup_validation.c feat(ha-config-bootstrap): implement --vcpus CLI, wire validation, remove vcpus from config (task 2.2) 2026-05-28 04:17:06 +00:00
task.c save works 2026-03-04 18:18:53 +08:00
worker.c feat(worker-join-refactor): implement apply_join_state, init_worker, rejoin_worker 2026-05-20 08:24:26 +00:00