feat(raft-adapter-conformance): send explicit reply on every config-push outcome

handle_repl_config_push now sends a ReplConfigPushReply{accepted,term}
from every exit path instead of silently dropping on the four reject
conditions (malformed request, missing bytes/sha256, sha256 mismatch,
conf_save_config failure). Term is sourced live from c->ha.term.
-EAGAIN activation-defer still replies accepted=1, unchanged.

Adds an XCE_TESTING-only send-hook mirroring ha_wal_ack_send_hook so
tests can observe the reply payload without a live endpoint.
This commit is contained in:
Rongsong Shen 2026-07-29 09:43:35 +00:00
parent ee7ede03c2
commit b7828eed4a
4 changed files with 148 additions and 13 deletions

View file

@ -463,6 +463,19 @@ int load_primary_config_for_test(cluster_t *c);
*/
extern void (*load_primary_config_race_hook)(void);
/*
* config_push_reply_send_hook: test-only injection point for the outbound
* ReplConfigPushReply built by send_config_push_reply() (config_repl.c).
* When non-NULL, called with (term, version_tag, accepted) INSTEAD of
* building/sending the real reply over ep -- lets a unit test observe a
* config-push accept OR reject reply without a live endpoint
* (raft-adapter-conformance task 2.1, mirrors ha_wal_ack_send_hook /
* bug-1479). NULL in production. Set by test infrastructure
* (test_config_repl.c) before the relevant tests run.
*/
extern void (*config_push_reply_send_hook)(uint64_t term, uint64_t version_tag,
int accepted);
/*
* push_ctx_t: exposed under XCE_TESTING so unit tests can construct
* synthetic push contexts to drive wait_all_with_timeout_for_test().