Merge pull request #18190 from taosdata/fix/TD-20437
fix(sync): fix asan error, TD-20437
This commit is contained in:
commit
9099f5cd10
|
@ -83,6 +83,10 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
|
||||||
ASSERT(pState != NULL);
|
ASSERT(pState != NULL);
|
||||||
|
|
||||||
if (pMsg->lastSendIndex == pState->lastSendIndex) {
|
if (pMsg->lastSendIndex == pState->lastSendIndex) {
|
||||||
|
int64_t timeNow = taosGetTimestampMs();
|
||||||
|
int64_t elapsed = timeNow - pState->lastSendTime;
|
||||||
|
sNTrace(ths, "sync-append-entries rtt elapsed:%" PRId64 ", index:%" PRId64, elapsed, pState->lastSendIndex);
|
||||||
|
|
||||||
syncNodeReplicateOne(ths, &(pMsg->srcId), true);
|
syncNodeReplicateOne(ths, &(pMsg->srcId), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,9 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) {
|
||||||
|
|
||||||
// pMsg->privateTerm = pSender->privateTerm;
|
// pMsg->privateTerm = pSender->privateTerm;
|
||||||
|
|
||||||
|
if (pSender->pCurrentBlock != NULL) {
|
||||||
memcpy(pMsg->data, pSender->pCurrentBlock, pSender->blockLen);
|
memcpy(pMsg->data, pSender->pCurrentBlock, pSender->blockLen);
|
||||||
|
}
|
||||||
|
|
||||||
// send msg
|
// send msg
|
||||||
syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg);
|
syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg);
|
||||||
|
|
Loading…
Reference in New Issue