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);