refactor(sync): do not heartbeat when 1 replica
This commit is contained in:
parent
13eaf5fc73
commit
dcd65e6dea
|
@ -1808,6 +1808,7 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) {
|
|||
|
||||
static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
|
||||
SSyncNode* pSyncNode = (SSyncNode*)param;
|
||||
if (pSyncNode->replicaNum > 1) {
|
||||
if (atomic_load_64(&pSyncNode->heartbeatTimerLogicClockUser) <=
|
||||
atomic_load_64(&pSyncNode->heartbeatTimerLogicClock)) {
|
||||
SyncTimeout* pSyncMsg =
|
||||
|
@ -1841,6 +1842,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
|
|||
pSyncNode->heartbeatTimerLogicClock, pSyncNode->heartbeatTimerLogicClockUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t syncNodeEqNoop(SSyncNode* ths) {
|
||||
int32_t ret = 0;
|
||||
|
@ -2184,7 +2186,7 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex,
|
|||
ths->pFsm->FpRestoreFinishCb(ths->pFsm);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue