Merge pull request #18695 from taosdata/feature/3.0_sync_pipeline

refactor(sync): modify/use default config value
This commit is contained in:
Shengliang Guan 2022-12-05 17:19:13 +08:00 committed by GitHub
commit c1b8d1b2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 11 deletions

View File

@ -26,8 +26,6 @@ extern "C" {
#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 ELECT_TIMER_MS_RANGE (ELECT_TIMER_MS_MAX - ELECT_TIMER_MS_MIN)
#define HEARTBEAT_TIMER_MS 1000 #define HEARTBEAT_TIMER_MS 1000
#define HEARTBEAT_TICK_NUM 20 #define HEARTBEAT_TICK_NUM 20

View File

@ -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++;
} }
} }