fix(ha-config-bootstrap): start iomgr and vtaskmgr before election so vote RPCs are accepted

This commit is contained in:
Rongsong Shen 2026-05-29 12:11:12 +00:00
parent 96df7285da
commit 4e9924e95c
2 changed files with 14 additions and 2 deletions

View file

@ -1081,8 +1081,13 @@ int cluster_start(cluster_t* c)
return rc;
}
iomgr_start(&(c->iomgr));
vtaskmgr_start(&(c->vtaskmgr));
/* Guard: myapp_run() starts iomgr and vtaskmgr before election so that
* incoming OP_requestVote RPCs are accepted during the election phase.
* Only start here if they were not already started (legacy cluster_init path). */
if (c->iomgr.worker == 0)
iomgr_start(&(c->iomgr));
if (c->vtaskmgr.dispatcher == 0)
vtaskmgr_start(&(c->vtaskmgr));
delaymgr_start(&(c->delaymgr));
/* Start persistence fsync thread and register WAL hooks */