enh: resend end msg on timeout in snapshotReSend

This commit is contained in:
Benguang Zhao 2023-11-02 18:54:06 +08:00
parent 995a1e1f8e
commit ce4fb52926
1 changed files with 7 additions and 1 deletions

View File

@ -240,7 +240,7 @@ int32_t syncSnapSendMsg(SSyncSnapshotSender *pSender, int32_t seq, void *pBlock,
// send msg
if (syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg) != 0) {
sSError(pSender, "failed to send snap replication msg since %s", terrstr());
sSError(pSender, "failed to send snap replication msg since %s. seq:%d", terrstr(), seq);
goto _OUT;
}
@ -335,6 +335,12 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) {
}
pBlk->sendTimeMs = nowMs;
}
if (pSender->seq == SYNC_SNAPSHOT_SEQ_END && pSndBuf->end <= pSndBuf->start) {
if (syncSnapSendMsg(pSender, pSender->seq, NULL, 0, 0) != 0) {
goto _out;
}
}
code = 0;
_out:;
taosThreadMutexUnlock(&pSndBuf->mutex);