Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4940080a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4940080a
编写于
11月 13, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact: adjust sync log prints
上级
f1a41f5a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
243 addition
and
241 deletion
+243
-241
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+1
-37
source/libs/sync/inc/syncUtil.h
source/libs/sync/inc/syncUtil.h
+33
-0
source/libs/sync/src/syncAppendEntries.c
source/libs/sync/src/syncAppendEntries.c
+0
-12
source/libs/sync/src/syncAppendEntriesReply.c
source/libs/sync/src/syncAppendEntriesReply.c
+2
-1
source/libs/sync/src/syncElection.c
source/libs/sync/src/syncElection.c
+0
-8
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+0
-146
source/libs/sync/src/syncRaftLog.c
source/libs/sync/src/syncRaftLog.c
+1
-0
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+0
-11
source/libs/sync/src/syncRequestVote.c
source/libs/sync/src/syncRequestVote.c
+0
-17
source/libs/sync/src/syncRequestVoteReply.c
source/libs/sync/src/syncRequestVoteReply.c
+0
-8
source/libs/sync/src/syncRespMgr.c
source/libs/sync/src/syncRespMgr.c
+1
-0
source/libs/sync/src/syncTimeout.c
source/libs/sync/src/syncTimeout.c
+2
-1
source/libs/sync/src/syncUtil.c
source/libs/sync/src/syncUtil.c
+203
-0
未找到文件。
source/libs/sync/inc/syncInt.h
浏览文件 @
4940080a
...
...
@@ -258,12 +258,10 @@ int32_t syncNodeOnLocalCmd(SSyncNode* ths, const SRpcMsg* pMsg);
// timer control --------------
int32_t
syncNodeStartPingTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeStopPingTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeStartElectTimer
(
SSyncNode
*
pSyncNode
,
int32_t
ms
);
int32_t
syncNodeStopElectTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeRestartElectTimer
(
SSyncNode
*
pSyncNode
,
int32_t
ms
);
int32_t
syncNodeResetElectTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeStartHeartbeatTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeStopHeartbeatTimer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeRestartHeartbeatTimer
(
SSyncNode
*
pSyncNode
);
...
...
@@ -282,7 +280,6 @@ void syncNodeUpdateTermWithoutStepDown(SSyncNode* pSyncNode, SyncTerm term);
void
syncNodeStepDown
(
SSyncNode
*
pSyncNode
,
SyncTerm
newTerm
);
void
syncNodeBecomeFollower
(
SSyncNode
*
pSyncNode
,
const
char
*
debugStr
);
void
syncNodeBecomeLeader
(
SSyncNode
*
pSyncNode
,
const
char
*
debugStr
);
void
syncNodeCandidate2Leader
(
SSyncNode
*
pSyncNode
);
void
syncNodeFollower2Candidate
(
SSyncNode
*
pSyncNode
);
void
syncNodeLeader2Follower
(
SSyncNode
*
pSyncNode
);
...
...
@@ -321,8 +318,7 @@ bool syncNodeNeedSendAppendEntries(SSyncNode* ths, const SRaftId* pDestId, const
int32_t
syncGetSnapshotMeta
(
int64_t
rid
,
struct
SSnapshotMeta
*
sMeta
);
int32_t
syncGetSnapshotMetaByIndex
(
int64_t
rid
,
SyncIndex
snapshotIndex
,
struct
SSnapshotMeta
*
sMeta
);
bool
syncNodeCanChange
(
SSyncNode
*
pSyncNode
);
bool
syncNodeCanChange
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeLeaderTransfer
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodeLeaderTransferTo
(
SSyncNode
*
pSyncNode
,
SNodeInfo
newLeader
);
int32_t
syncDoLeaderTransfer
(
SSyncNode
*
ths
,
SRpcMsg
*
pRpcMsg
,
SSyncRaftEntry
*
pEntry
);
...
...
@@ -332,38 +328,6 @@ int32_t syncNodeDynamicQuorum(const SSyncNode* pSyncNode);
bool
syncNodeIsMnode
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodePeerStateInit
(
SSyncNode
*
pSyncNode
);
// trace log
void
syncLogRecvTimer
(
SSyncNode
*
pSyncNode
,
const
SyncTimeout
*
pMsg
,
const
char
*
s
);
void
syncLogRecvLocalCmd
(
SSyncNode
*
pSyncNode
,
const
SyncLocalCmd
*
pMsg
,
const
char
*
s
);
void
syncLogSendAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
);
void
syncLogRecvHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
);
void
syncLogSendHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
);
// syncUtil.h
void
syncPrintNodeLog
(
const
char
*
flags
,
ELogLevel
level
,
int32_t
dflag
,
SSyncNode
*
pNode
,
const
char
*
format
,
...);
void
syncPrintSnapshotSenderLog
(
const
char
*
flags
,
ELogLevel
level
,
int32_t
dflag
,
SSyncSnapshotSender
*
pSender
,
const
char
*
format
,
...);
void
syncPrintSnapshotReceiverLog
(
const
char
*
flags
,
ELogLevel
level
,
int32_t
dflag
,
SSyncSnapshotReceiver
*
pReceiver
,
const
char
*
format
,
...);
#ifdef __cplusplus
}
#endif
...
...
source/libs/sync/inc/syncUtil.h
浏览文件 @
4940080a
...
...
@@ -48,6 +48,39 @@ void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dfla
void
syncPrintSnapshotReceiverLog
(
const
char
*
flags
,
ELogLevel
level
,
int32_t
dflag
,
SSyncSnapshotReceiver
*
pReceiver
,
const
char
*
format
,
...);
void
syncLogRecvTimer
(
SSyncNode
*
pSyncNode
,
const
SyncTimeout
*
pMsg
,
const
char
*
s
);
void
syncLogRecvLocalCmd
(
SSyncNode
*
pSyncNode
,
const
SyncLocalCmd
*
pMsg
,
const
char
*
s
);
void
syncLogSendAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
);
void
syncLogRecvHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
);
void
syncLogSendHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
);
void
syncLogSendSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
);
void
syncLogRecvSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
);
void
syncLogRecvAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
);
void
syncLogSendAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
);
void
syncLogRecvRequestVote
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
);
void
syncLogSendRequestVote
(
SSyncNode
*
pNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
);
void
syncLogRecvRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
);
void
syncLogSendRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
);
#ifdef __cplusplus
}
#endif
...
...
source/libs/sync/src/syncAppendEntries.c
浏览文件 @
4940080a
...
...
@@ -124,18 +124,6 @@ int32_t syncNodeFollowerCommit(SSyncNode* ths, SyncIndex newCommitIndex) {
return
0
;
}
void
syncLogRecvAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-append-entries from %s:%d {term:%"
PRId64
", pre-index:%"
PRId64
", pre-term:%"
PRId64
", cmt:%"
PRId64
", pterm:%"
PRId64
", datalen:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
commitIndex
,
pMsg
->
privateTerm
,
pMsg
->
dataLen
,
s
);
}
int32_t
syncNodeOnAppendEntries
(
SSyncNode
*
ths
,
const
SRpcMsg
*
pRpcMsg
)
{
SyncAppendEntries
*
pMsg
=
pRpcMsg
->
pCont
;
SRpcMsg
rpcRsp
=
{
0
};
...
...
source/libs/sync/src/syncAppendEntriesReply.c
浏览文件 @
4940080a
...
...
@@ -15,12 +15,13 @@
#define _DEFAULT_SOURCE
#include "syncAppendEntriesReply.h"
#include "syncMessage.h"
#include "syncCommit.h"
#include "syncIndexMgr.h"
#include "syncMessage.h"
#include "syncRaftStore.h"
#include "syncReplication.h"
#include "syncSnapshot.h"
#include "syncUtil.h"
// TLA+ Spec
// HandleAppendEntriesResponse(i, j, m) ==
...
...
source/libs/sync/src/syncElection.c
浏览文件 @
4940080a
...
...
@@ -33,14 +33,6 @@
// mdest |-> j])
// /\ UNCHANGED <<serverVars, candidateVars, leaderVars, logVars>>
static
void
syncLogSendRequestVote
(
SSyncNode
*
pNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pNode
,
"send sync-request-vote to %s:%d {term:%"
PRId64
", lindex:%"
PRId64
", lterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogIndex
,
pMsg
->
lastLogTerm
,
s
);
}
static
int32_t
syncNodeRequestVotePeers
(
SSyncNode
*
pNode
)
{
if
(
pNode
->
state
!=
TAOS_SYNC_STATE_CANDIDATE
)
{
sNTrace
(
pNode
,
"not candidate, stop elect"
);
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
4940080a
...
...
@@ -2480,149 +2480,3 @@ bool syncNodeCanChange(SSyncNode* pSyncNode) {
return
true
;
}
void
syncLogRecvTimer
(
SSyncNode
*
pSyncNode
,
const
SyncTimeout
*
pMsg
,
const
char
*
s
)
{
sNTrace
(
pSyncNode
,
"recv sync-timer {type:%s, lc:%"
PRId64
", ms:%d, data:%p}, %s"
,
syncTimerTypeStr
(
pMsg
->
timeoutType
),
pMsg
->
logicClock
,
pMsg
->
timerMS
,
pMsg
->
data
,
s
);
}
void
syncLogSendAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-append-entries-reply to %s:%d, {term:%"
PRId64
", pterm:%"
PRId64
", success:%d, match:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
pMsg
->
success
,
pMsg
->
matchIndex
,
s
);
}
void
syncLogRecvAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-append-entries-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
", success:%d, match:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
pMsg
->
success
,
pMsg
->
matchIndex
,
s
);
}
void
syncLogSendHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-heartbeat to %s:%d {term:%"
PRId64
", cmt:%"
PRId64
", min-match:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
commitIndex
,
pMsg
->
minMatchIndex
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogRecvHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat from %s:%d {term:%"
PRId64
", cmt:%"
PRId64
", min-match:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
commitIndex
,
pMsg
->
minMatchIndex
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogSendHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-heartbeat-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogRecvHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogRecvLocalCmd
(
SSyncNode
*
pSyncNode
,
const
SyncLocalCmd
*
pMsg
,
const
char
*
s
)
{
sNTrace
(
pSyncNode
,
"recv sync-local-cmd {cmd:%d-%s, sd-new-term:%"
PRId64
", fc-index:%"
PRId64
"}, %s"
,
pMsg
->
cmd
,
syncLocalCmdGetStr
(
pMsg
->
cmd
),
pMsg
->
sdNewTerm
,
pMsg
->
fcIndex
,
s
);
}
void
syncLogSendSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-pre-snapshot to %s:%d {term:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
s
);
}
void
syncLogRecvSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-pre-snapshot from %s:%d {term:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
s
);
}
void
syncLogSendSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-pre-snapshot-reply to %s:%d {term:%"
PRId64
", snap-start:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapStart
,
s
);
}
void
syncLogRecvSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-pre-snapshot-reply from %s:%d {term:%"
PRId64
", snap-start:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapStart
,
s
);
}
void
syncLogSendSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-snapshot-send from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", end:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", seq:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
beginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
seq
,
s
);
}
void
syncLogRecvSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-snapshot-send from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", seq:%d, len:%u}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
beginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
seq
,
pMsg
->
dataLen
,
s
);
}
void
syncLogSendSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-snapshot-rsp from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", ack:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapBeginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
ack
,
s
);
}
void
syncLogRecvSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-snapshot-rsp from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", ack:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapBeginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
ack
,
s
);
}
source/libs/sync/src/syncRaftLog.c
浏览文件 @
4940080a
...
...
@@ -17,6 +17,7 @@
#include "syncRaftLog.h"
#include "syncRaftCfg.h"
#include "syncRaftStore.h"
#include "syncUtil.h"
// log[m .. n]
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
4940080a
...
...
@@ -137,17 +137,6 @@ int32_t syncNodeReplicate(SSyncNode* pSyncNode) {
return
0
;
}
static
void
syncLogSendAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-append-entries to %s:%d, {term:%"
PRId64
", pre-index:%"
PRId64
", pre-term:%"
PRId64
", pterm:%"
PRId64
", cmt:%"
PRId64
", datalen:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
privateTerm
,
pMsg
->
commitIndex
,
pMsg
->
dataLen
,
s
);
}
int32_t
syncNodeSendAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SRaftId
*
destRaftId
,
SRpcMsg
*
pRpcMsg
)
{
int32_t
ret
=
0
;
SyncAppendEntries
*
pMsg
=
pRpcMsg
->
pCont
;
...
...
source/libs/sync/src/syncRequestVote.c
浏览文件 @
4940080a
...
...
@@ -88,23 +88,6 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM
return
false
;
}
static
void
syncLogRecvRequestVote
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
)
{
char
logBuf
[
256
];
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-request-vote from %s:%d, {term:%"
PRId64
", lindex:%"
PRId64
", lterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogIndex
,
pMsg
->
lastLogTerm
,
s
);
}
static
void
syncLogSendRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-request-vote-reply to %s:%d {term:%"
PRId64
", grant:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
voteGranted
,
s
);
}
int32_t
syncNodeOnRequestVote
(
SSyncNode
*
ths
,
const
SRpcMsg
*
pRpcMsg
)
{
int32_t
ret
=
0
;
SyncRequestVote
*
pMsg
=
pRpcMsg
->
pCont
;
...
...
source/libs/sync/src/syncRequestVoteReply.c
浏览文件 @
4940080a
...
...
@@ -38,14 +38,6 @@
// /\ UNCHANGED <<serverVars, votedFor, leaderVars, logVars>>
//
static
void
syncLogRecvRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-request-vote-reply from %s:%d {term:%"
PRId64
", grant:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
voteGranted
,
s
);
}
int32_t
syncNodeOnRequestVoteReply
(
SSyncNode
*
ths
,
const
SRpcMsg
*
pRpcMsg
)
{
int32_t
ret
=
0
;
SyncRequestVoteReply
*
pMsg
=
pRpcMsg
->
pCont
;
...
...
source/libs/sync/src/syncRespMgr.c
浏览文件 @
4940080a
...
...
@@ -17,6 +17,7 @@
#include "syncRespMgr.h"
#include "syncRaftEntry.h"
#include "syncRaftStore.h"
#include "syncUtil.h"
SSyncRespMgr
*
syncRespMgrCreate
(
void
*
data
,
int64_t
ttl
)
{
SSyncRespMgr
*
pObj
=
taosMemoryCalloc
(
1
,
sizeof
(
SSyncRespMgr
));
...
...
source/libs/sync/src/syncTimeout.c
浏览文件 @
4940080a
...
...
@@ -19,12 +19,13 @@
#include "syncRaftCfg.h"
#include "syncRaftLog.h"
#include "syncReplication.h"
#include "syncUtil.h"
static
void
syncNodeCleanConfigIndex
(
SSyncNode
*
ths
)
{
int32_t
newArrIndex
=
0
;
SyncIndex
newConfigIndexArr
[
MAX_CONFIG_INDEX_COUNT
]
=
{
0
};
SSnapshot
snapshot
=
{
0
};
ths
->
pFsm
->
FpGetSnapshotInfo
(
ths
->
pFsm
,
&
snapshot
);
if
(
snapshot
.
lastApplyIndex
!=
SYNC_INDEX_INVALID
)
{
for
(
int32_t
i
=
0
;
i
<
ths
->
pRaftCfg
->
configIndexCount
;
++
i
)
{
...
...
source/libs/sync/src/syncUtil.c
浏览文件 @
4940080a
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncUtil.h"
#include "syncMessage.h"
#include "syncRaftCfg.h"
#include "syncRaftStore.h"
#include "syncSnapshot.h"
...
...
@@ -345,3 +346,205 @@ void syncPrintSnapshotReceiverLog(const char* flags, ELogLevel level, int32_t df
pNode
->
replicaNum
,
pNode
->
pRaftCfg
->
lastConfigIndex
,
pNode
->
changing
,
pNode
->
restoreFinish
,
quorum
,
pNode
->
electTimerLogicClock
,
pNode
->
heartbeatTimerLogicClockUser
,
peerStr
,
cfgStr
);
}
void
syncLogRecvTimer
(
SSyncNode
*
pSyncNode
,
const
SyncTimeout
*
pMsg
,
const
char
*
s
)
{
sNTrace
(
pSyncNode
,
"recv sync-timer {type:%s, lc:%"
PRId64
", ms:%d, data:%p}, %s"
,
syncTimerTypeStr
(
pMsg
->
timeoutType
),
pMsg
->
logicClock
,
pMsg
->
timerMS
,
pMsg
->
data
,
s
);
}
void
syncLogRecvLocalCmd
(
SSyncNode
*
pSyncNode
,
const
SyncLocalCmd
*
pMsg
,
const
char
*
s
)
{
sNTrace
(
pSyncNode
,
"recv sync-local-cmd {cmd:%d-%s, sd-new-term:%"
PRId64
", fc-index:%"
PRId64
"}, %s"
,
pMsg
->
cmd
,
syncLocalCmdGetStr
(
pMsg
->
cmd
),
pMsg
->
sdNewTerm
,
pMsg
->
fcIndex
,
s
);
}
void
syncLogSendAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-append-entries-reply to %s:%d, {term:%"
PRId64
", pterm:%"
PRId64
", success:%d, match:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
pMsg
->
success
,
pMsg
->
matchIndex
,
s
);
}
void
syncLogRecvAppendEntriesReply
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntriesReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-append-entries-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
", success:%d, match:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
pMsg
->
success
,
pMsg
->
matchIndex
,
s
);
}
void
syncLogSendHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-heartbeat to %s:%d {term:%"
PRId64
", cmt:%"
PRId64
", min-match:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
commitIndex
,
pMsg
->
minMatchIndex
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogRecvHeartbeat
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeat
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat from %s:%d {term:%"
PRId64
", cmt:%"
PRId64
", min-match:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
commitIndex
,
pMsg
->
minMatchIndex
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogSendHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-heartbeat-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogRecvHeartbeatReply
(
SSyncNode
*
pSyncNode
,
const
SyncHeartbeatReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-heartbeat-reply from %s:%d {term:%"
PRId64
", pterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
privateTerm
,
s
);
}
void
syncLogSendSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-pre-snapshot to %s:%d {term:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
s
);
}
void
syncLogRecvSyncPreSnapshot
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshot
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-pre-snapshot from %s:%d {term:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
s
);
}
void
syncLogSendSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-pre-snapshot-reply to %s:%d {term:%"
PRId64
", snap-start:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapStart
,
s
);
}
void
syncLogRecvSyncPreSnapshotReply
(
SSyncNode
*
pSyncNode
,
const
SyncPreSnapshotReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-pre-snapshot-reply from %s:%d {term:%"
PRId64
", snap-start:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapStart
,
s
);
}
void
syncLogSendSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-snapshot-send from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", end:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", seq:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
beginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
seq
,
s
);
}
void
syncLogRecvSyncSnapshotSend
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotSend
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-snapshot-send from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", seq:%d, len:%u}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
beginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
seq
,
pMsg
->
dataLen
,
s
);
}
void
syncLogSendSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-snapshot-rsp from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", ack:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapBeginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
ack
,
s
);
}
void
syncLogRecvSyncSnapshotRsp
(
SSyncNode
*
pSyncNode
,
const
SyncSnapshotRsp
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-snapshot-rsp from %s:%d {term:%"
PRId64
", begin:%"
PRId64
", lst:%"
PRId64
", lterm:%"
PRId64
", stime:%"
PRId64
", ack:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
snapBeginIndex
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
startTime
,
pMsg
->
ack
,
s
);
}
void
syncLogRecvAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-append-entries from %s:%d {term:%"
PRId64
", pre-index:%"
PRId64
", pre-term:%"
PRId64
", cmt:%"
PRId64
", pterm:%"
PRId64
", datalen:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
commitIndex
,
pMsg
->
privateTerm
,
pMsg
->
dataLen
,
s
);
}
void
syncLogSendAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SyncAppendEntries
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-append-entries to %s:%d, {term:%"
PRId64
", pre-index:%"
PRId64
", pre-term:%"
PRId64
", pterm:%"
PRId64
", cmt:%"
PRId64
", datalen:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
privateTerm
,
pMsg
->
commitIndex
,
pMsg
->
dataLen
,
s
);
}
void
syncLogRecvRequestVote
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
)
{
char
logBuf
[
256
];
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-request-vote from %s:%d, {term:%"
PRId64
", lindex:%"
PRId64
", lterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogIndex
,
pMsg
->
lastLogTerm
,
s
);
}
void
syncLogSendRequestVote
(
SSyncNode
*
pNode
,
const
SyncRequestVote
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pNode
,
"send sync-request-vote to %s:%d {term:%"
PRId64
", lindex:%"
PRId64
", lterm:%"
PRId64
"}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
lastLogIndex
,
pMsg
->
lastLogTerm
,
s
);
}
void
syncLogRecvRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
srcId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"recv sync-request-vote-reply from %s:%d {term:%"
PRId64
", grant:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
voteGranted
,
s
);
}
void
syncLogSendRequestVoteReply
(
SSyncNode
*
pSyncNode
,
const
SyncRequestVoteReply
*
pMsg
,
const
char
*
s
)
{
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pMsg
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sNTrace
(
pSyncNode
,
"send sync-request-vote-reply to %s:%d {term:%"
PRId64
", grant:%d}, %s"
,
host
,
port
,
pMsg
->
term
,
pMsg
->
voteGranted
,
s
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录