Merge pull request #21073 from taosdata/fix/filter-votor-when-agree-upon

filter voter when agree upon
This commit is contained in:
Xiaoyu Wang 2023-04-25 16:42:31 +08:00 committed by GitHub
commit d3a53f1704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -75,10 +75,12 @@ bool syncNodeAgreedUpon(SSyncNode* pNode, SyncIndex index) {
SSyncIndexMgr* pMatches = pNode->pMatchIndex;
ASSERT(pNode->replicaNum == pMatches->replicaNum);
for (int i = 0; i < pNode->replicaNum; i++) {
SyncIndex matchIndex = pMatches->index[i];
if (matchIndex >= index) {
count++;
for (int i = 0; i < pNode->totalReplicaNum; i++) {
if(pNode->raftCfg.cfg.nodeInfo[i].nodeRole == TAOS_SYNC_ROLE_VOTER){
SyncIndex matchIndex = pMatches->index[i];
if (matchIndex >= index) {
count++;
}
}
}