code wiki / _hdl_build / nx_ha_failover.nx

nx_ha_failover.nx

buildroot/runtime/_hdl_build/nx_ha_failover.nx

1789 B32 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic ha
docsdependenciesstructsconstsfunctions

about

nx_ha_failover.nx -- CAP-HA-FAILOVER: multi-node failover to KILL THE SPOF (the single NAS the stability census flagged as our AWS-gap). Deterministic failover state machine over two nodes' health: primary down + standby up -> promote standby; both down -> DEGRADED (honest, never a false "up"); recover to the primary when it returns. Conservative (fail back only when the current active is down) -> no flapping. Pure integer, gateable offline; composes the true-health verdict (mc_verdict UP/DOWN). The DATA-PLANE replication + a real standby host are the infra rungs this logic drives. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_ha_failover.nx nx_ha_chaos_gate.nx nx_ha_failover_gate.nx

imports: nx_syscalls.nx

imported by: nx_ha_chaos_gate.nxnx_ha_failover_gate.nx

structs

none

consts

9const HA_PRIMARY: i64 = 0
10const HA_STANDBY: i64 = 1
11const HA_DEGRADED: i64 = 2
12const HA_DOWN: i64 = 0
13const HA_UP: i64 = 1

functions

17func fo_step(st: *i64, primary_health: i64, standby_health: i64) -> i64
called by 2: mainmain