test(ha-commit-barrier-rollout): RED tests for config barrier (task 5.1)

6 RED carriers pinning the three configAck defects (previous-tag acks
count, n_active==0 success shortcut, no-self-count denominator) and the
push/upgrade failure path (logged-only result, unconditional success
ACK + restart). 2 sanctioned pins (single-member, success-unchanged).
Behavior-preserving signature change: push_config_to_standbys gains
acked_out (return still legacy push count; 7 call sites NULL'd,
body-diff verified). 29/6 in group; no collateral failures.
This commit is contained in:
Rongsong Shen 2026-06-12 16:31:42 +00:00
parent 732e836868
commit 9cdeba5816
9 changed files with 582 additions and 19 deletions

View file

@ -864,8 +864,15 @@ int wait_all_with_timeout_for_test(pthread_t *threads, push_ctx_t *ctxs,
#endif
int push_config_to_standbys(cluster_t *c, const uint8_t *bytes, size_t blen,
const uint8_t sha256[32], uint64_t new_tag)
const uint8_t sha256[32], uint64_t new_tag,
int *acked_out)
{
/* acked_out: per-standby transport push count (task 5.1 signature;
* behavior-preserving — the return value keeps the legacy push-count
* semantics until task 5.2 re-plumbs it to the barrier result). */
if (acked_out)
*acked_out = 0;
if (!c->ha.standby_endpoints)
return 0;
@ -911,6 +918,9 @@ int push_config_to_standbys(cluster_t *c, const uint8_t *bytes, size_t blen,
free(ctxs);
free(threads);
if (acked_out)
*acked_out = acked;
/* Req 8.1–8.3: wait for majority-quorum OP_upgradeConfigAck.
* On quorum: advance committed_config_tag atomically (Req 8.5). */
/* entry_lsn = 0: the configAck branch ignores it (walAck-only adapter
@ -1057,7 +1067,7 @@ static int do_upgrade_config_with_bytes(cluster_t *c, endpoint_t *ep,
/* 7. Push to standbys (best-effort; see push_config_to_standbys comment) */
int acked = push_config_to_standbys(c, out_bytes, out_len, computed,
c->myconf->config_version_tag);
c->myconf->config_version_tag, NULL);
free(out_bytes);
/* 8. ACK the admin tool */