Merge pull request #28113 from taosdata/fix/TD-31891-remove-void-sync2-fix-case

fix/TD-31891-remove-void-sync2-fix-case
This commit is contained in:
Hongze Cheng 2024-09-26 08:59:09 +08:00 committed by GitHub
commit 0a413d09c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -1139,10 +1139,15 @@ int32_t syncLogReplProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncApp
pMgr->peerStartTime = pMsg->startTime; pMgr->peerStartTime = pMsg->startTime;
} }
int32_t code = 0;
if (pMgr->restored) { if (pMgr->restored) {
TAOS_CHECK_RETURN(syncLogReplContinue(pMgr, pNode, pMsg)); if ((code = syncLogReplContinue(pMgr, pNode, pMsg)) != 0) {
sError("vgId:%d, failed to continue sync log repl since %s", pNode->vgId, tstrerror(code));
}
} else { } else {
TAOS_CHECK_RETURN(syncLogReplRecover(pMgr, pNode, pMsg)); if ((code = syncLogReplRecover(pMgr, pNode, pMsg)) != 0) {
sError("vgId:%d, failed to recover sync log repl since %s", pNode->vgId, tstrerror(code));
}
} }
(void)taosThreadMutexUnlock(&pBuf->mutex); (void)taosThreadMutexUnlock(&pBuf->mutex);
return 0; return 0;
@ -1439,7 +1444,10 @@ int32_t syncLogBufferReset(SSyncLogBuffer* pBuf, SSyncNode* pNode) {
if (lastVer != pBuf->matchIndex) return TSDB_CODE_SYN_INTERNAL_ERROR; if (lastVer != pBuf->matchIndex) return TSDB_CODE_SYN_INTERNAL_ERROR;
SyncIndex index = pBuf->endIndex - 1; SyncIndex index = pBuf->endIndex - 1;
TAOS_CHECK_RETURN(syncLogBufferRollback(pBuf, pNode, pBuf->matchIndex + 1)); int32_t code = 0;
if ((code = syncLogBufferRollback(pBuf, pNode, pBuf->matchIndex + 1)) != 0) {
sError("vgId:%d, failed to rollback sync log buffer since %s", pNode->vgId, tstrerror(code));
}
sInfo("vgId:%d, reset sync log buffer. buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", pNode->vgId, sInfo("vgId:%d, reset sync log buffer. buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", pNode->vgId,
pBuf->startIndex, pBuf->commitIndex, pBuf->matchIndex, pBuf->endIndex); pBuf->startIndex, pBuf->commitIndex, pBuf->matchIndex, pBuf->endIndex);