Merge pull request #29322 from taosdata/fix/main/TD-32549

Fix(wal):delete wal while part dnodes offline.
This commit is contained in:
Shengliang Guan 2024-12-26 09:53:15 +08:00 committed by GitHub
commit 3494d0d065
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -422,13 +422,11 @@ int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) {
SyncIndex syncMinMatchIndex(SSyncNode* pSyncNode) {
SyncIndex minMatchIndex = SYNC_INDEX_INVALID;
if (pSyncNode->peersNum > 0) {
minMatchIndex = syncIndexMgrGetIndex(pSyncNode->pMatchIndex, &(pSyncNode->peersId[0]));
}
for (int32_t i = 1; i < pSyncNode->peersNum; ++i) {
for (int32_t i = 0; i < pSyncNode->peersNum; ++i) {
SyncIndex matchIndex = syncIndexMgrGetIndex(pSyncNode->pMatchIndex, &(pSyncNode->peersId[i]));
if (matchIndex < minMatchIndex) {
if (minMatchIndex == SYNC_INDEX_INVALID) {
minMatchIndex = matchIndex;
} else if (matchIndex > 0 && matchIndex < minMatchIndex) {
minMatchIndex = matchIndex;
}
}