forked from lei.chen/myxce
push_config_transport_only spawns one thread per standby then joins them with a CONF_PUSH_TIMEOUT_MS bounded wait — blocking the caller. On the requester-less drive-thread paths (promotion + heartbeat convergence) that wait stalls the io_worker. Route those through ha_config_push_offloadable, gated by g_drive_async_configpush_offload (default OFF → inline, byte-for-byte legacy; ON → slow lane, non-blocking). Flag ON deep-copies the config bytes + sha into a lane ctx (caller keeps owning and freeing its own buffer); a single cluster-wide single-flight guard (ha_state_t.configpush_inflight scalar CAS + lane key=1) bounds it to one config-push fan-out in flight; the in-flight flag is cleared on every terminal path (two alloc failures, -EEXIST, hard submit error, lane completion). Send body factored into ha_config_push_do_send. Three requester-less drive-thread call sites converted: raft_cb_become_leader (promotion), the HA_REPL_PUSH_CONFIG heartbeat case, and the direct-CTRL_PRIMARY FSM promotion branch. The admin-upgrade barrier (push_config_to_standbys, has a waiting requester) and join.c are untouched. Lands DORMANT like tasks 3.1/3.2: the lane reads c->ha.standby_endpoints and writes those borrowed standby endpoints, racing io_worker RDHUP teardown if run off-thread (bug-1197 family). Flag OFF keeps push+teardown serialized on the io_worker. Task 3.4 flips this ON together with the snapshot and peerctrl flags after establishing endpoint-lifetime discipline. Tests (controller suite EXIT=0): test_configpush_offload_runs_on_lane, test_configpush_inline_when_flag_off, test_configpush_offload_dedups. Adversarial cpp-review: no CRITICAL/HIGH/MEDIUM findings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S6fDCtXkkEgupu7rUah1y2 |
||
|---|---|---|
| .. | ||
| include | ||
| testsuite | ||
| apiserver.c | ||
| CLAUDE.md | ||
| cluster.c | ||
| commit.c | ||
| config_repl.c | ||
| config_repl.h | ||
| ctrl_metrics.c | ||
| ctrlstatus.c | ||
| dataex.c | ||
| egress.c | ||
| ha.c | ||
| ha.h | ||
| ha_convergence.c | ||
| job.c | ||
| join.c | ||
| main.c | ||
| meson.build | ||
| misc.c | ||
| myapp.c | ||
| myconf.c | ||
| opget.c | ||
| opupd.c | ||
| persist.c | ||
| queue.c | ||
| repl.c | ||
| reply.c | ||
| resources.c | ||
| sched.c | ||
| slowlane.c | ||
| startup_validation.c | ||
| task.c | ||
| worker.c | ||