Merge pull request #18695 from taosdata/feature/3.0_sync_pipeline
refactor(sync): modify/use default config value
This commit is contained in:
commit
c1b8d1b2b2
|
@ -22,14 +22,12 @@ extern "C" {
|
||||||
|
|
||||||
#include "syncInt.h"
|
#include "syncInt.h"
|
||||||
|
|
||||||
#define TIMER_MAX_MS 0x7FFFFFFF
|
#define TIMER_MAX_MS 0x7FFFFFFF
|
||||||
#define ENV_TICK_TIMER_MS 1000
|
#define ENV_TICK_TIMER_MS 1000
|
||||||
#define PING_TIMER_MS 5000
|
#define PING_TIMER_MS 5000
|
||||||
#define ELECT_TIMER_MS_MIN 2500
|
#define ELECT_TIMER_MS_MIN 2500
|
||||||
#define ELECT_TIMER_MS_MAX (ELECT_TIMER_MS_MIN * 2)
|
#define HEARTBEAT_TIMER_MS 1000
|
||||||
#define ELECT_TIMER_MS_RANGE (ELECT_TIMER_MS_MAX - ELECT_TIMER_MS_MIN)
|
#define HEARTBEAT_TICK_NUM 20
|
||||||
#define HEARTBEAT_TIMER_MS 1000
|
|
||||||
#define HEARTBEAT_TICK_NUM 20
|
|
||||||
|
|
||||||
typedef struct SSyncEnv {
|
typedef struct SSyncEnv {
|
||||||
uint8_t isStart;
|
uint8_t isStart;
|
||||||
|
|
|
@ -1025,8 +1025,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) {
|
||||||
}
|
}
|
||||||
// timer ms init
|
// timer ms init
|
||||||
pSyncNode->pingBaseLine = PING_TIMER_MS;
|
pSyncNode->pingBaseLine = PING_TIMER_MS;
|
||||||
pSyncNode->electBaseLine = ELECT_TIMER_MS_MIN;
|
pSyncNode->electBaseLine = tsElectInterval;
|
||||||
pSyncNode->hbBaseLine = HEARTBEAT_TIMER_MS;
|
pSyncNode->hbBaseLine = tsHeartbeatInterval;
|
||||||
|
|
||||||
// init ping timer
|
// init ping timer
|
||||||
pSyncNode->pPingTimer = NULL;
|
pSyncNode->pPingTimer = NULL;
|
||||||
|
@ -2384,7 +2384,7 @@ bool syncNodeHeartbeatReplyTimeout(SSyncNode* pSyncNode) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsNow - recvTime > SYNC_HEART_TIMEOUT_MS) {
|
if (tsNow - recvTime > tsHeartbeatTimeout) {
|
||||||
toCount++;
|
toCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue