refactor(sync): make leader life longer
This commit is contained in:
parent
3cbaaa5a8c
commit
7d50c26207
|
@ -73,7 +73,7 @@ void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) {
|
||||||
ASSERT(pEntry != NULL);
|
ASSERT(pEntry != NULL);
|
||||||
|
|
||||||
// cannot commit, even if quorum agree. need check term!
|
// cannot commit, even if quorum agree. need check term!
|
||||||
if (pEntry->term == pSyncNode->pRaftStore->currentTerm) {
|
if (pEntry->term <= pSyncNode->pRaftStore->currentTerm) {
|
||||||
// update commit index
|
// update commit index
|
||||||
newCommitIndex = index;
|
newCommitIndex = index;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue