myxce/src
Rongsong Shen 102e263cce fix(ha): close permanent catch-up wedge from duplicated replication-target formula (bug-1478)
Two independent call sites duplicated target = max(committed_lsn,
last_written): ha.c's heartbeat/stateReport dispatch (repl_ack_decode_and_
dispatch) and config_repl.c's catchup_derive_target (used by the ACK-driven
catch-up continuation path). Once config-upgrade-snapshot's marker-triggered
checkpoint advances last_written one LSN past an already-committed
committed_lsn (the checkpoint's own consumed, never-replicated LSN slot),
the unconditional max() permanently wedges every standby's catch-up target
at an unreachable value -- the primary re-streams an empty range every
heartbeat forever.

Extracted the shared, pure ha_compute_repl_target_lsn(committed_lsn,
last_written) (ha.h/ha.c), which only falls back to last_written on genuine
committed_lsn==0 bootstrap, and pointed both call sites at it so they can
never disagree again.

Fixing the second call site exposed three pre-existing tests in
test_convergence_verification.c that hardcoded the old buggy formula's
output as their expected target; updated their fixture values (committed_lsn
4->9, matching appended_lsn) to decouple them from the now-fixed edge case,
which already has dedicated pure-function coverage in test_ha_role.c.

GREEN: full controller_unit_test suite = 1040 tests, 0 failures, clean
across multiple runs. Live-verified via run-ha-soak.sh
--config-upgrade-wal-trim (18 jobs, zero job loss, ctrl-1 reconverged 3-of-3
using the preserved floor segment) -- unblocks config-upgrade-snapshot
task 8.9.
2026-07-28 09:53:20 +00:00
..
autoscaler support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
configs fix(admin-config-tool): resolve xceadmin config build warnings 2026-07-23 09:10:14 +00:00
controller fix(ha): close permanent catch-up wedge from duplicated replication-target formula (bug-1478) 2026-07-28 09:53:20 +00:00
docs Merge branch 'working' into job_peek_lchen 2026-07-22 13:57:25 +08:00
frontend fix(xcecli): restore dangling CA-cert cleanup misses, enable https support 2026-07-23 07:28:01 +00:00
include fix(config): serialize load_primary_config against concurrent invocations (bug-1476) 2026-07-28 08:13:54 +00:00
lib feat(config-upgrade-snapshot): live config-upgrade soak infra + fix bug-1468/bug-1469 (task 8.6) 2026-07-25 15:48:20 +00:00
nixSupport fix(nix): pin capnpc source to immutable commit, not mutable main ref 2026-07-24 08:25:38 +00:00
scheduler merge 2026-07-23 12:35:10 +08:00
schema feat(config-upgrade-snapshot): define HostAdminState/QueueAdminState capnp structs, bump snapshot format version 2026-07-24 08:26:49 +00:00
tools feat(admin-config-tool): drop ha/data/ entirely, match real client TLS 2026-07-22 14:50:51 +00:00
worker merge 2026-07-23 12:35:10 +08:00
xceadmin fix(admin-config-tool): resolve xceadmin config build warnings 2026-07-23 09:10:14 +00:00
flake.lock fix librtti package leak issue 2026-07-27 15:31:50 +08:00
flake.nix save works 2026-03-04 18:18:53 +08:00
meson.build feat(admin-config-tool): wire xceadmin into meson + nix build 2026-07-22 10:46:45 +00:00
meson.options Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00