test(ha-commit-barrier-rollout): RED tests for persist_commit_barrier (task 2.1)

7 cases: two covered short-circuits, timeout with committed_lsn
unmoved, covering-ACK release, sync_timeout_ms fallback (bounded both
directions), n_peers=1 standalone, NOT_READY passthrough via cap
saturation. Watermark resolved to current_lsn - 1 (design's literal
phrasing unsatisfiable per persist.h:71 invariant) with off-by-one
killing power both ways. 15 tests / 7 RED; suite baseline zero.
This commit is contained in:
Rongsong Shen 2026-06-12 05:09:11 +00:00
parent e8ecc87551
commit 611fbc8d7b
6 changed files with 405 additions and 2 deletions

View file

@ -1171,6 +1171,21 @@ wal_commit_mode_t wal_classify(uint32_t wal_type, int detail)
}
}
/* Commit barrier helper — INERT RED stub (ha-commit-barrier-rollout task
* 2.1; implemented in task 2.2). Returns a wrong sentinel so the task-2.1
* tests fail on assertions, not linking. Task-2.2 contract (design.md
* §Commit Barrier Helper): snapshot the appended watermark (current_lsn - 1
* under p->lock), return 0 when committed_lsn already covers it (or nothing
* appended), else commit_submit(WAIT, timeout_ms ? timeout_ms :
* p->config.sync_timeout_ms) with the engine code passed through
* unmodified. */
int persist_commit_barrier(persist_t* p, uint32_t timeout_ms)
{
(void)p;
(void)timeout_ms;
return -ENOSYS;
}
/* Classified append at the hook seam (barrier-rollout task 1.2).
*
* WAIT (queue/worker control): the append stays async here — the handler