test(ha-commit-engine): RED tests for write-admission quorum counting (task 4.1)

Tests 21-28: repl_active_standby_count contract (5 RED vs inert -1
stub) + 3 gate-level pins (n_peers<=1 always-true, zero-connected
reject, stateless re-accept) that 4.2 must preserve. Declaration in
repl.h; ha.c/ha.h untouched (4.2 boundary). 28 tests / 5 RED; suite
at the 3-failure baseline with unchanged signatures.
This commit is contained in:
Rongsong Shen 2026-06-11 16:15:21 +00:00
parent 631a08939b
commit b2598823c0
6 changed files with 322 additions and 3 deletions

View file

@ -545,3 +545,17 @@ int repl_needs_snapshot(replicator_t *r, uint64_t standby_lsn,
/* Standby LSN predates oldest surviving WAL segment — full snapshot required */
return (standby_lsn < oldest_wal_lsn) ? 1 : 0;
}
/* ============================================================
* Write-admission quorum accounting (ha-commit-engine task 4)
* ============================================================ */
/* RED scaffold for task 4.1: deliberately inert so the task-4.1 tests fail
* on assertions rather than at link time (-1 is never a valid count).
* The real counting — slots with ep != NULL && !in_catch_up under r->lock —
* is implemented in task 4.2. */
int repl_active_standby_count(replicator_t *r)
{
(void)r;
return -1;
}