test(ha-commit-engine): RED integration tests for ACK feed and sync-append (task 5.1)
Tests 30-34: wired repl_on_ack feeds engine, membership mutators trigger re-evaluation, per-entry sync-append contract (stale-ACK rejection, committed_lsn unmoved on timeout, n_peers=1 replaces -ENODEV). test_repl_majority walAck cases rewired to per-LSN semantics (configAck byte-identical). Sanctioned scaffolding: entry_lsn param on repl_wait_majority_ack (legacy body byte-identical, callers pass 0), inert repl_set_commit_engine stub. 9 RED failures; baseline signatures unchanged. LSN-0 edge documented for 5.2/5.3.
This commit is contained in:
parent
c9154bd5cc
commit
d1353360cc
9 changed files with 512 additions and 79 deletions
|
|
@ -390,7 +390,7 @@ static void test_wal_ack_reply_updates_acked_lsn_and_signals(void)
|
|||
|
||||
/* repl_wait_majority_ack: 1 active standby, quorum=(1+2)/2=1,
|
||||
* acked_total = 1(self) + 1(standby) = 2 >= 1 → returns 0. */
|
||||
int rc = repl_wait_majority_ack(&r, 200, (uint8_t)OPCode_walAck);
|
||||
int rc = repl_wait_majority_ack(&r, 0, 200, (uint8_t)OPCode_walAck);
|
||||
pthread_join(th, NULL);
|
||||
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(0, rc,
|
||||
|
|
@ -453,7 +453,7 @@ static void test_wal_nack_does_not_update_acked_lsn(void)
|
|||
* quorum (1), so repl_wait_majority_ack returns 0, not -ETIMEDOUT.
|
||||
* A timeout would only occur if quorum required at least one standby ACK,
|
||||
* which only happens when n_active >= 2 (e.g. 2+ standbys registered). */
|
||||
int rc = repl_wait_majority_ack(&r, 50, (uint8_t)OPCode_walAck);
|
||||
int rc = repl_wait_majority_ack(&r, 0, 50, (uint8_t)OPCode_walAck);
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(0, rc,
|
||||
"repl_wait_majority_ack must return 0 with 1 standby: "
|
||||
"self-count(1) >= quorum(1) even without standby ACK (Req 4.3)");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue