code wiki / _hdl_build / nx_ha_replication.nx
nx_ha_replication.nx
buildroot/runtime/_hdl_build/nx_ha_replication.nx
about
nx_ha_replication.nx -- CAP-HA-REPLICATION: append-only log-shipping replication (WAL-style) to kill the DATA
SPOF (the single NAS). The primary appends records; rep_ship copies new bytes to a standby/backup so it holds a
BYTE-EXACT prefix of the primary. Usable TODAY as backup/DR (single-node), and the sync target when a standby host
exists. Append-only = history sacred (never rewrites). Deterministic; rep_in_sync proves byte-identity, rep_lag
measures how far behind the replica is. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_ha_chaos_gate.nxnx_ha_replication_gate.nx
structs
| none |
consts
| 7 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 10 | func rep_position(path: *u8) -> i64 |
| 17 | func rep_append(path: *u8, record: *u8, n: i64) -> i64 |
| 22 | func rep_read_all(path: *u8, out: *u8, cap: i64) -> i64 |
| 29 | func rep_ship(primary: *u8, standby: *u8, from_pos: i64) -> i64 |
| 40 | func rep_lag(primary: *u8, standby: *u8) -> i64 { return rep_position(primary) - rep_position(standby) } |
| 42 | func rep_in_sync(primary: *u8, standby: *u8) -> i64 |