feat(component-failover-adoption): fix worker startup ordering, add rejoin retry-on-failure

Thread cluster_cfg by value through xcecd_config_t -> xcecd_context_t ->
cc_ctx so it's populated before controller_connector_start() fires the
first join, instead of after xcecd_start() returns. checking_connection()
now retries a failed post-reconnect xcecli_join() on the next liveness
probe instead of leaving needs_rejoin cleared on mere attempt.
This commit is contained in:
Rongsong Shen 2026-08-11 06:21:36 +00:00
parent ce9f734a38
commit 331fa02423
Signed by: rshen
SSH key fingerprint: SHA256:8Vf2pZ3h6rJa7EhGK+WaAQ9Mta/apZvteW6g9U/WKKk
8 changed files with 663 additions and 12 deletions

View file

@ -56,6 +56,13 @@ typedef struct {
int update_interval;
int domain_sock;
int debug_level;
/* HA candidate list parsed from --peers (component-failover-adoption,
* task 2.2, Req 1.4). Threaded through xcecd_init() -> xcecd_context_t
* -> controller_connector_init() so cc_ctx->cluster_cfg is populated
* before the first join, instead of main.c assigning it after
* xcecd_start() already ran. candidates_count == 0 means no --peers was
* given (single-host default). */
xce_cluster_config_t cluster_cfg;
} xcecd_config_t;
typedef struct {
@ -81,6 +88,11 @@ typedef struct {
char* log_dir;
char* db_path;
char* virtual_name;
/* Copied from xcecd_config_t by xcecd_init(); consumed by
* controller_connector_init() (xcecd_start()) to populate
* cc_ctx->cluster_cfg BEFORE controller_connector_start() fires the
* first join (component-failover-adoption, task 2.2, Req 1.4). */
xce_cluster_config_t cluster_cfg;
} xcecd_context_t;
extern xcecd_context_t xcecd_ctx;