myxce/src/controller
Rongsong Shen e50afd02f6 feat(election-iomgr-refactor): implement ha_start_election_async — task 2.4
Non-blocking election initiator that returns immediately after registering
vote endpoints with iomgr and scheduling the election timeout watchdog.

- Single-node shortcircuit (n_peers==1): allocates self-only ha_elect_ctx_t,
  calls ha_elect_evaluate_and_signal directly, frees ctx inline — no iomgr
  or delaymgr involvement; returns in < 1ms
- Multi-node: allocates ha_elect_ctx_t, per-peer vote_ep_ctx_t, calls
  endpoint_connect + iomgr_monitor for each peer; schedules election timeout
  via delay_task_ms; skips peer on connect failure (counted as denied)
- election_timeout_fn: delaymgr callback that fires ha_elect_evaluate_and_signal
  after election_timeout_ms, unless cancelled flag is set (lock-free cancellation)
- vote_ep_err_handler: counts unreachable peers as denied votes
- Declares ha_start_election_async in ha.h with full doc comment
- 5 Unity tests in test_ha_start_election_async.c: returns < 5ms, stores
  n_peers, shortcircuit fires immediately, n_peers stored for multi-peer,
  term incremented — all GREEN with ASAN enabled
2026-05-30 08:57:59 +00:00
..
include fix(ha-bootstrap): register listener with iomgr epoll before election 2026-05-30 00:10:23 +00:00
testsuite feat(election-iomgr-refactor): implement ha_start_election_async — task 2.4 2026-05-30 08:57:59 +00:00
apiserver.c add kiro skills 2026-05-21 03:41:57 +00:00
CLAUDE.md enhance xce-build skill 2026-05-30 08:13:59 +08:00
cluster.c feat(election-iomgr-refactor): add ha_state_t fields and CTRL_PRIMARY_COMMITTING 2026-05-30 07:52:40 +00:00
config_repl.c fix(ha-bootstrap): increase config fetch retries to 60, downgrade no-config log, suppress false SSL perror 2026-05-29 14:56:48 +00:00
config_repl.h feat(ha-config-bootstrap): implement OP_ctrlHello state sync handler (task 9.3) 2026-05-29 05:22:17 +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 feat(election-iomgr-refactor): implement ha_start_election_async — task 2.4 2026-05-30 08:57:59 +00:00
ha.h feat(election-iomgr-refactor): implement ha_start_election_async — task 2.4 2026-05-30 08:57:59 +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 add kiro skills 2026-05-21 03:41:57 +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 feat(election-iomgr-refactor): implement ha_start_election_async — task 2.4 2026-05-30 08:57:59 +00:00
misc.c save works 2026-03-05 16:03:37 +08:00
myapp.c fix(ha-bootstrap): priority staggering and candidate_id in election 2026-05-30 02:48:59 +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