From 01b04e03d9927568df3ab640e642fc861523b23d Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 6 Jun 2022 11:46:59 +0800 Subject: [PATCH] enh(sync): forbid elect for this round --- source/libs/sync/src/syncRequestVote.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/sync/src/syncRequestVote.c b/source/libs/sync/src/syncRequestVote.c index 4d1e259575..3eef2e7b1e 100644 --- a/source/libs/sync/src/syncRequestVote.c +++ b/source/libs/sync/src/syncRequestVote.c @@ -105,6 +105,9 @@ int32_t syncNodeOnRequestVoteSnapshotCb(SSyncNode* ths, SyncRequestVote* pMsg) { // maybe has already voted for pMsg->srcId // vote again, no harm raftStoreVote(ths->pRaftStore, &(pMsg->srcId)); + + // forbid elect for this round + syncNodeResetElectTimer(ths); } SyncRequestVoteReply* pReply = syncRequestVoteReplyBuild(ths->vgId);