forked from lei.chen/myxce
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). |
||
|---|---|---|
| .. | ||
| include | ||
| testsuite | ||
| apiserver.c | ||
| CLAUDE.md | ||
| cluster.c | ||
| config_repl.c | ||
| config_repl.h | ||
| ctrl_metrics.c | ||
| dataex.c | ||
| ha.c | ||
| ha.h | ||
| job.c | ||
| join.c | ||
| main.c | ||
| meson.build | ||
| misc.c | ||
| myapp.c | ||
| myconf.c | ||
| opget.c | ||
| opupd.c | ||
| persist.c | ||
| queue.c | ||
| repl.c | ||
| reply.c | ||
| resources.c | ||
| sched.c | ||
| startup_validation.c | ||
| task.c | ||
| worker.c | ||