refactor(sync): add rtt trace log

This commit is contained in:
Minghao Li 2022-11-16 10:10:02 +08:00
parent 7d63efd2af
commit 475919dd77
1 changed files with 5 additions and 1 deletions

View File

@ -83,6 +83,10 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
ASSERT(pState != NULL);
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);
}
}