feat(ha-commit-engine): per-LSN majority commit engine core (task 1.2)

commit_on_ack: active-standby (non-catch-up, connected) watermark scan,
descending sort, candidate arr[n_peers/2-1], clamped to appended log,
monotonic single-site committed_lsn store, condvar broadcast, never
blocks beyond engine mutex. RETAIN returns immediately. Self-quorum for
n_peers<=1; zero-fill makes zero-standby commit impossible. 7/7 task-1.1
tests green unmodified; full suite at known 3-failure baseline.
This commit is contained in:
Rongsong Shen 2026-06-11 14:37:01 +00:00
parent d5a0f9c64d
commit eae4767d7d
4 changed files with 203 additions and 23 deletions

View file

@ -1,6 +1,6 @@
# anatomy.md
> Auto-maintained by OpenWolf. Last scanned: 2026-06-11T14:16:52.677Z
> Auto-maintained by OpenWolf. Last scanned: 2026-06-11T14:36:56.598Z
> Files: 511 tracked | Anatomy hits: 0 | Misses: 0
## ./
@ -706,7 +706,7 @@
## src/controller/
- `commit.c` — STUB commit engine (ha-commit-engine task 1.1 RED): init/fini real, commit_submit -ENOSYS, commit_on_ack no-op; real impl in task 1.2 (~474 tok)
- `commit.c` — Commit engine core (ha-commit-engine 1.2): per-LSN majority evaluation (descending watermark median arr[n_peers/2-1], catch-up excluded), monotonic clamped committed_lsn advancement, RETAIN submit immediate; WAIT = -ENOSYS until task 2.2 (~2600 tok)
- `meson.build` (~1094 tok)
## src/controller/include/