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:
parent
732e836868
commit
9cdeba5816
9 changed files with 582 additions and 19 deletions
|
|
@ -75,7 +75,8 @@ typedef struct {
|
|||
extern int cluster_init_phase2(cluster_t *c);
|
||||
extern void ha_send_ctrlhello_to_all_standbys(cluster_t *c);
|
||||
extern 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);
|
||||
#endif
|
||||
|
||||
static void on_vote_connected(endpoint_t *ep);
|
||||
|
|
@ -568,11 +569,12 @@ static void raft_cb_become_leader(void *ctx, uint64_t term)
|
|||
conf_read_raw(c->myconf->conffile, &cfg_bytes, &cfg_len) == 0) {
|
||||
push_config_to_standbys(c, cfg_bytes, cfg_len,
|
||||
c->myconf->config_sha256,
|
||||
c->myconf->config_version_tag);
|
||||
c->myconf->config_version_tag, NULL);
|
||||
free(cfg_bytes);
|
||||
} else {
|
||||
push_config_to_standbys(c, NULL, 0, NULL,
|
||||
c->myconf ? c->myconf->config_version_tag : 0);
|
||||
c->myconf ? c->myconf->config_version_tag : 0,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1407,11 +1409,12 @@ int ha_dispatch_repl_action_for_standby(ha_state_t *ha,
|
|||
conf_read_raw(c->myconf->conffile, &cfg_bytes, &cfg_len) == 0) {
|
||||
push_config_to_standbys(c, cfg_bytes, cfg_len,
|
||||
c->myconf->config_sha256,
|
||||
c->myconf->config_version_tag);
|
||||
c->myconf->config_version_tag, NULL);
|
||||
free(cfg_bytes);
|
||||
} else {
|
||||
push_config_to_standbys(c, NULL, 0, NULL,
|
||||
c->myconf ? c->myconf->config_version_tag : 0);
|
||||
c->myconf ? c->myconf->config_version_tag : 0,
|
||||
NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -2280,7 +2283,7 @@ apply_role:
|
|||
ha_push_config_hook(c);
|
||||
#else
|
||||
if (c != NULL)
|
||||
push_config_to_standbys(c, NULL, 0, NULL, 0);
|
||||
push_config_to_standbys(c, NULL, 0, NULL, 0, NULL);
|
||||
#endif
|
||||
|
||||
/* Send CtrlHelloRequest to all standbys to trigger WAL catch-up (Req 7.2) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue