From ce4fb52926fc30902dd731ad14ce52be512ca182 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Thu, 2 Nov 2023 18:54:06 +0800 Subject: [PATCH] enh: resend end msg on timeout in snapshotReSend --- source/libs/sync/src/syncSnapshot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index 709e2549ee..cbdcbef3a6 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -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);