myxce/.kiro/specs
Rongsong Shen 1da26b043e feat(config-upgrade-snapshot): materialize upgrade snapshot on config-marker apply
Adds an explicit case WAL_CONFIG_MARKER to apply_committed_entry,
replacing its no-op treatment, that forces a checkpoint at exactly the
marker's own (term, lsn) via two new helpers:

  persist_checkpoint_write_locked(p, checkpoint_lsn) -- the checkpoint
  core (pin lsn, scan config ref, write_snapshot, trim, rotate) taking
  an explicit LSN and never acquiring apply_pump_lock itself
  persist_checkpoint_marker_triggered(p, lsn) -- shares the existing
  checkpoint_in_progress CAS guard, calls the above with the marker's
  own lsn

This fixes two hazards design.md's "call persist_checkpoint() directly"
text didn't account for: (1) apply_committed_entry's live-pump caller
(persist_apply_pump_run, used by both primary and standby online-apply)
already holds apply_pump_lock across the dispatch call -- a direct
persist_checkpoint() call would self-deadlock on that mutex; (2)
last_applied_lsn/replay position only advance AFTER apply_committed_entry
returns at both call sites, so pinning checkpoint_lsn from
last_applied_lsn inside the marker case would label the checkpoint with
the previous entry's LSN, not the marker's own -- fixed by threading the
marker's own lsn parameter through explicitly. A -EBUSY outcome (a
concurrent periodic checkpoint mid-flight) is logged at TRACE and treated
as expected/self-resolving, never retried. The new case has no effect on
entity interpretation/re-homing (Req 1.8).

New test_upgrade_snapshot_apply.c drives WAL_CONFIG_MARKER through the
REAL production call paths (persist_apply_pump_run and boot replay via
persist_recover), not a bare apply_committed_entry() call, so the fix is
actually proven against the lock-holding context rather than assumed.

Also fixes a genuine regression in test_config_repl.c surfaced by
WAL_CONFIG_MARKER apply having a real side effect for the first time
(bug-1466): an fsync-worker-thread race (t42_wait_applied polling helper,
mirrors test_apply_pump.c's tap_wait_applied) and one test call site
trusting an unreliable raft-derived LSN. Surfaces (but does not fix, out
of this spec's boundary) a pre-existing ha-term-safety/raft-log-replication
gap: persist_write_checkpoint_marker bypasses ha_primary_log_append,
breaking its documented current_lsn==log_len+1 invariant once a
checkpoint interleaves with primary appends -- log_len feeds real
RequestVote freshness comparisons, not advisory-only as first assumed;
severity corrected in bug-1466. Task 5 of 19.

Requirements: 1.1, 1.5, 1.8, 4.4, 5.2, 5.3
2026-07-24 16:28:57 +00:00
..
admin-config-tool feat(admin-config-tool): drop ha/data/ entirely, match real client TLS 2026-07-22 14:50:51 +00:00
clusterconfig-schema-split chore(controller): clusterconfig-schema-split — mark implementation-complete 2026-07-21 08:07:36 +00:00
component-failover-adoption save status 2026-07-21 08:24:44 +00:00
config-upgrade-snapshot feat(config-upgrade-snapshot): materialize upgrade snapshot on config-marker apply 2026-07-24 16:28:57 +00:00
controller-status docs(controller-status): record first /kiro-validate-impl pass -- GO 2026-07-17 11:01:48 +00:00
election-iomgr-refactor checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-commit-barrier-rollout checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-commit-durability docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
ha-commit-engine docs: fix unchecked group-header checkboxes across 8 fully-implemented specs 2026-07-07 08:45:41 +00:00
ha-config-bootstrap checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-consistency-invariants docs(spec): ha-consistency-invariants — Criterion 2.9 now satisfied 2026-07-13 08:08:41 +00:00
ha-convergence-recovery fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
ha-elect-ctx-lifecycle docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
ha-entity-snapshots docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
ha-heartbeat-committed-propagation docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
ha-heartbeat-liveness checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-peer-connection-reuse checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-prevote docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
ha-repl-hardening docs(specs): gap re-validation 2026-06-24 (5 HA/raft specs) 2026-06-24 10:04:06 +00:00
ha-single-leader-role docs: fix unchecked group-header checkboxes across 8 fully-implemented specs 2026-07-07 08:45:41 +00:00
ha-term-safety docs(ha-term-safety): record first /kiro-validate-impl pass -- GO 2026-07-17 10:53:06 +00:00
ha-wal-replication docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
job-array-single-wal-record fix: bug-1445 -- first-boot promotion check races its own first replay 2026-07-17 10:42:13 +00:00
libxce-failover docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
raft-apply-decoupling fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
raft-commit-safety docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
raft-drive-async fix(netio): bug-1447 same-batch endpoint use-after-free in io_worker dispatch 2026-07-18 13:28:04 +00:00
raft-ha-core-safety fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
raft-library checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
raft-log-replication docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
raft-sim-conformance docs(specs): kiro-validate-impl GO closure for 8 HA/raft specs 2026-07-18 13:27:36 +00:00
resource-distribution-mapping add resource distribution map project 2026-07-23 09:20:26 +00:00
resval-id-decoupling checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
scheduler-controller-msg-gap checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
scheduler-framework spec(scheduler-framework): finalize 4-level job-picker design 2026-07-12 04:25:49 +00:00
worker-join-refactor checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
xce-test-e2e-primitives fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
.gitignore chore: baseline snapshot — prior-session work + ha-consistency-invariants spec family 2026-06-11 13:21:50 +00:00