myxce/.kiro/specs
Rongsong Shen aa7fc65a36
fix(controller): cold start elects in ~1.7 s, not ~10 s; ctrlstatus appliedLsn on the primary (bug-1879, bug-1878)
bug-1879: on a fresh HA cluster the config-holding ctrl-1 started its
term-1 election before its peers ran; connect failures count as "no"
votes (bug-1423), so it lost at once and became a follower with no
leader. ctrl-2/ctrl-3 hold no config and are voters only (by design),
so nothing retried until ctrl-1's 10 s standby liveness timeout: every
cold start had no primary for ~10 s.
- ha_note_leaderless() marks a config-holding node that becomes a
  follower with no leader known; the liveness poll then retries the
  election (PreVote) after HA_LEADERLESS_RETRY_MS = 1 s, doubling up to
  heartbeat_timeout_ms. Primary contact or becoming leader clears it.
- ha_heartbeat_is_fresh() answers "no" while leaderless: last_activity
  then only holds the watchdog's arm time, and the failover gates took
  it for a live primary.
Live cold start: primary 1.7 s after the first node started (was ~10 s).

bug-1878: ctrlstatus_fill() reported ha->applied_lsn for every role, a
standby-only counter a primary never advances, so every primary showed
"appliedLsn: 0". A primary now reports persist->last_applied_lsn. The
controller-status design doc's "already correct in every role" note is
corrected.

Tests: 5 new in test_ha_failover_prevote.c, 1 new in test_ctrlstatus.c
(RED: expected 4900, was 0); controller suite 1256/0. HA soaks:
sequential 6 rounds PASS, chaotic 6 rounds PASS (zero divergence, zero
job loss).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 07:35:45 +00:00
..
admin-config-tool test(admin-config-tool): update standby-redirect E2E for bug-1700/1701 2026-08-29 12:10:28 +00:00
build-time-versioning chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
clusterconfig-schema-split chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
commit-batch-window chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
component-failover-adoption chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
component-rejoin-resync chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
config-upgrade-snapshot chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
controller-peers-env-fallback chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
controller-status fix(controller): cold start elects in ~1.7 s, not ~10 s; ctrlstatus appliedLsn on the primary (bug-1879, bug-1878) 2026-09-28 07:35:45 +00:00
dirty-content-fingerprint chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
election-iomgr-refactor chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
eliminate-frontend-makefile chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-commit-barrier-rollout chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-commit-durability chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-commit-engine chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-config-bootstrap chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-consistency-invariants chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-convergence-recovery chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-elect-ctx-lifecycle chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-entity-snapshots chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-heartbeat-committed-propagation chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-heartbeat-liveness chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-peer-connection-reuse chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-prevote chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-repl-hardening chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-single-leader-role chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-term-safety chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
ha-wal-replication chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
job-array-single-wal-record chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
libxce-alloc-preason-equality chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
libxce-failover chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-adapter-conformance chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-apply-decoupling chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-commit-safety chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-drive-async chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-ha-core-safety chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-library chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-log-replication chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
raft-sim-conformance chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
resource-distribution-mapping chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
resource-value-verification chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
resreq-maxtasks-wiring chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
resval-id-decoupling chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-allocation chore(buglog): point fix references at the re-signed commit hashes 2026-09-25 13:15:43 +00:00
scheduler-config-version-tag chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-controller-msg-gap chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-core chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-dispatch-commit chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-framework chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-preemption chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-primary-lifecycle chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-decision-parity chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-diagnostics chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-eager-reconciliation chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-live-allocation chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-reconcile-terminal-guard chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-repl-verbosity chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-sim-step-verbosity chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
scheduler-snapshot-job-allocation chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
worker-join-refactor chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
worker-rejoin-resync chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
xce-harness-component chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
xce-node-manager chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
xce-test-cli-ux chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
xce-test-e2e-primitives chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
xce-test-rc-file chore(gitea-sync): record first status-driven Gitea sync 2026-09-24 10:22:05 +00:00
.gitignore chore: baseline snapshot — prior-session work + ha-consistency-invariants spec family 2026-06-11 13:21:50 +00:00