fix/TD-32583-remove-useless-timer-execution
This commit is contained in:
parent
b318f12a2a
commit
e893547c14
|
@ -24,7 +24,6 @@ extern "C" {
|
||||||
|
|
||||||
#define TIMER_MAX_MS 0x7FFFFFFF
|
#define TIMER_MAX_MS 0x7FFFFFFF
|
||||||
#define PING_TIMER_MS 5000
|
#define PING_TIMER_MS 5000
|
||||||
#define HEARTBEAT_TICK_NUM 20
|
|
||||||
|
|
||||||
typedef struct SSyncEnv {
|
typedef struct SSyncEnv {
|
||||||
uint8_t isStart;
|
uint8_t isStart;
|
||||||
|
|
|
@ -977,9 +977,10 @@ static int32_t syncHbTimerStart(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer) {
|
||||||
pData->logicClock = pSyncTimer->logicClock;
|
pData->logicClock = pSyncTimer->logicClock;
|
||||||
pData->execTime = tsNow + pSyncTimer->timerMS;
|
pData->execTime = tsNow + pSyncTimer->timerMS;
|
||||||
|
|
||||||
sTrace("vgId:%d, start hb timer, rid:%" PRId64 " addr:%" PRId64, pSyncNode->vgId, pData->rid, pData->destId.addr);
|
sTrace("vgId:%d, start hb timer, rid:%" PRId64 " addr:%" PRId64 " at %d", pSyncNode->vgId, pData->rid,
|
||||||
|
pData->destId.addr, pSyncTimer->timerMS);
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(taosTmrReset(pSyncTimer->timerCb, pSyncTimer->timerMS / HEARTBEAT_TICK_NUM, (void*)(pData->rid),
|
TAOS_CHECK_RETURN(taosTmrReset(pSyncTimer->timerCb, pSyncTimer->timerMS, (void*)(pData->rid),
|
||||||
syncEnv()->pTimerManager, &pSyncTimer->pTimer));
|
syncEnv()->pTimerManager, &pSyncTimer->pTimer));
|
||||||
} else {
|
} else {
|
||||||
code = TSDB_CODE_SYN_INTERNAL_ERROR;
|
code = TSDB_CODE_SYN_INTERNAL_ERROR;
|
||||||
|
@ -2711,7 +2712,8 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sTrace("vgId:%d, eq peer hb timer, rid:%" PRId64 " addr:%" PRId64, pSyncNode->vgId, hbDataRid, pData->destId.addr);
|
sTrace("vgId:%d, peer hb timer execution, rid:%" PRId64 " addr:%" PRId64, pSyncNode->vgId, hbDataRid,
|
||||||
|
pData->destId.addr);
|
||||||
|
|
||||||
if (pSyncNode->totalReplicaNum > 1) {
|
if (pSyncNode->totalReplicaNum > 1) {
|
||||||
int64_t timerLogicClock = atomic_load_64(&pSyncTimer->logicClock);
|
int64_t timerLogicClock = atomic_load_64(&pSyncTimer->logicClock);
|
||||||
|
@ -2753,13 +2755,12 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) {
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
sError("vgId:%d, failed to send heartbeat since %s", pSyncNode->vgId, tstrerror(ret));
|
sError("vgId:%d, failed to send heartbeat since %s", pSyncNode->vgId, tstrerror(ret));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (syncIsInit()) {
|
if (syncIsInit()) {
|
||||||
// sTrace("vgId:%d, reset peer hb timer", pSyncNode->vgId);
|
sTrace("vgId:%d, reset peer hb timer at %d", pSyncNode->vgId, pSyncTimer->timerMS);
|
||||||
if ((code = taosTmrReset(syncNodeEqPeerHeartbeatTimer, pSyncTimer->timerMS / HEARTBEAT_TICK_NUM,
|
if ((code = taosTmrReset(syncNodeEqPeerHeartbeatTimer, pSyncTimer->timerMS, (void*)hbDataRid,
|
||||||
(void*)hbDataRid, syncEnv()->pTimerManager, &pSyncTimer->pTimer)) != 0) {
|
syncEnv()->pTimerManager, &pSyncTimer->pTimer)) != 0) {
|
||||||
sError("vgId:%d, reset peer hb timer error, %s", pSyncNode->vgId, tstrerror(code));
|
sError("vgId:%d, reset peer hb timer error, %s", pSyncNode->vgId, tstrerror(code));
|
||||||
syncNodeRelease(pSyncNode);
|
syncNodeRelease(pSyncNode);
|
||||||
syncHbTimerDataRelease(pData);
|
syncHbTimerDataRelease(pData);
|
||||||
|
|
Loading…
Reference in New Issue