未验证 提交 c1b8d1b2 编写于 作者: S Shengliang Guan 提交者: GitHub

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

refactor(sync): modify/use default config value
...@@ -22,14 +22,12 @@ extern "C" { ...@@ -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) { ...@@ -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) { ...@@ -2384,7 +2384,7 @@ bool syncNodeHeartbeatReplyTimeout(SSyncNode* pSyncNode) {
continue; continue;
} }
if (tsNow - recvTime > SYNC_HEART_TIMEOUT_MS) { if (tsNow - recvTime > tsHeartbeatTimeout) {
toCount++; toCount++;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册