未验证 提交 bf4d3a9e 编写于 作者: L Li Minghao 提交者: GitHub

Merge pull request #13863 from taosdata/feature/3.0_mhli

refactor(sync): do not heartbeat when 1 replica
...@@ -1808,6 +1808,7 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) { ...@@ -1808,6 +1808,7 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) {
static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) { static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
SSyncNode* pSyncNode = (SSyncNode*)param; SSyncNode* pSyncNode = (SSyncNode*)param;
if (pSyncNode->replicaNum > 1) {
if (atomic_load_64(&pSyncNode->heartbeatTimerLogicClockUser) <= if (atomic_load_64(&pSyncNode->heartbeatTimerLogicClockUser) <=
atomic_load_64(&pSyncNode->heartbeatTimerLogicClock)) { atomic_load_64(&pSyncNode->heartbeatTimerLogicClock)) {
SyncTimeout* pSyncMsg = SyncTimeout* pSyncMsg =
...@@ -1840,6 +1841,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) { ...@@ -1840,6 +1841,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
"", "",
pSyncNode->heartbeatTimerLogicClock, pSyncNode->heartbeatTimerLogicClockUser); pSyncNode->heartbeatTimerLogicClock, pSyncNode->heartbeatTimerLogicClockUser);
} }
}
} }
static int32_t syncNodeEqNoop(SSyncNode* ths) { static int32_t syncNodeEqNoop(SSyncNode* ths) {
...@@ -2184,7 +2186,7 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex, ...@@ -2184,7 +2186,7 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex,
ths->pFsm->FpRestoreFinishCb(ths->pFsm); ths->pFsm->FpRestoreFinishCb(ths->pFsm);
} }
ths->restoreFinish = true; ths->restoreFinish = true;
sDebug("vgId:%d sync event restore finish", ths->vgId); sDebug("vgId:%d sync event restore finish, index:%ld", ths->vgId, pEntry->index);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册