Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6a4cdade
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6a4cdade
编写于
6月 11, 2022
作者:
M
Minghao Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(sync): add debug log
上级
f92f1bbc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
57 deletion
+80
-57
source/libs/sync/src/syncAppendEntries.c
source/libs/sync/src/syncAppendEntries.c
+2
-2
source/libs/sync/src/syncAppendEntriesReply.c
source/libs/sync/src/syncAppendEntriesReply.c
+4
-4
source/libs/sync/src/syncCommit.c
source/libs/sync/src/syncCommit.c
+1
-1
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+9
-7
source/libs/sync/src/syncRaftLog.c
source/libs/sync/src/syncRaftLog.c
+2
-2
source/libs/sync/src/syncSnapshot.c
source/libs/sync/src/syncSnapshot.c
+62
-41
未找到文件。
source/libs/sync/src/syncAppendEntries.c
浏览文件 @
6a4cdade
...
...
@@ -713,7 +713,7 @@ static int32_t syncNodeMakeLogSame(SSyncNode* ths, SyncAppendEntries* pMsg) {
// delete confict entries
code
=
ths
->
pLogStore
->
syncLogTruncate
(
ths
->
pLogStore
,
delBegin
);
ASSERT
(
code
==
0
);
s
Info
(
"sync event vgId:%d
log truncate, from %ld to %ld"
,
ths
->
vgId
,
delBegin
,
delEnd
);
s
Debug
(
"vgId:%d sync event
log truncate, from %ld to %ld"
,
ths
->
vgId
,
delBegin
,
delEnd
);
logStoreSimpleLog2
(
"after syncNodeMakeLogSame"
,
ths
->
pLogStore
);
return
code
;
...
...
@@ -994,7 +994,7 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
SyncIndex
commitEnd
=
snapshot
.
lastApplyIndex
;
ths
->
commitIndex
=
snapshot
.
lastApplyIndex
;
s
Info
(
"sync event vgId:%d
commit by snapshot from index:%ld to index:%ld, %s"
,
ths
->
vgId
,
commitBegin
,
s
Debug
(
"vgId:%d sync event
commit by snapshot from index:%ld to index:%ld, %s"
,
ths
->
vgId
,
commitBegin
,
commitEnd
,
syncUtilState2String
(
ths
->
state
));
}
...
...
source/libs/sync/src/syncAppendEntriesReply.c
浏览文件 @
6a4cdade
...
...
@@ -189,16 +189,16 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
if
(
gRaftDetailLog
)
{
char
*
s
=
snapshotSender2Str
(
pSender
);
s
Info
(
"
sync event vgId:%d
snapshot send to %s:%d start sender first time, lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d start sender first time, lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld"
"sender:%s"
,
ths
->
vgId
,
host
,
port
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
,
s
);
taosMemoryFree
(
s
);
}
else
{
s
Info
(
"
sync event vgId:%d
snapshot send to %s:%d start sender first time, lastApplyIndex:%ld "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d start sender first time, lastApplyIndex:%ld "
"lastApplyTerm:%lu lastConfigIndex:%ld"
,
ths
->
vgId
,
host
,
port
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
);
...
...
source/libs/sync/src/syncCommit.c
浏览文件 @
6a4cdade
...
...
@@ -56,7 +56,7 @@ void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) {
SyncIndex
commitEnd
=
snapshot
.
lastApplyIndex
;
pSyncNode
->
commitIndex
=
snapshot
.
lastApplyIndex
;
s
Info
(
"sync event vgId:%d
commit by snapshot from index:%ld to index:%ld, %s"
,
pSyncNode
->
vgId
,
s
Debug
(
"vgId:%d sync event
commit by snapshot from index:%ld to index:%ld, %s"
,
pSyncNode
->
vgId
,
pSyncNode
->
commitIndex
,
snapshot
.
lastApplyIndex
,
syncUtilState2String
(
pSyncNode
->
state
));
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
6a4cdade
...
...
@@ -470,7 +470,7 @@ int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak) {
return
TAOS_SYNC_PROPOSE_OTHER_ERROR
;
}
assert
(
rid
==
pSyncNode
->
rid
);
s
Trace
(
"sync event vgId:%d
propose msgType:%s"
,
pSyncNode
->
vgId
,
TMSG_INFO
(
pMsg
->
msgType
));
s
Debug
(
"vgId:%d sync event
propose msgType:%s"
,
pSyncNode
->
vgId
,
TMSG_INFO
(
pMsg
->
msgType
));
if
(
pSyncNode
->
state
==
TAOS_SYNC_STATE_LEADER
)
{
SRespStub
stub
;
...
...
@@ -501,7 +501,7 @@ int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak) {
SSyncNode
*
syncNodeOpen
(
const
SSyncInfo
*
pOldSyncInfo
)
{
SSyncInfo
*
pSyncInfo
=
(
SSyncInfo
*
)
pOldSyncInfo
;
s
Info
(
"sync event vgId:%d
sync open"
,
pSyncInfo
->
vgId
);
s
Debug
(
"vgId:%d sync event
sync open"
,
pSyncInfo
->
vgId
);
SSyncNode
*
pSyncNode
=
(
SSyncNode
*
)
taosMemoryMalloc
(
sizeof
(
SSyncNode
));
assert
(
pSyncNode
!=
NULL
);
...
...
@@ -761,7 +761,7 @@ void syncNodeStartStandBy(SSyncNode* pSyncNode) {
}
void
syncNodeClose
(
SSyncNode
*
pSyncNode
)
{
s
Info
(
"sync event vgId:%d
sync close"
,
pSyncNode
->
vgId
);
s
Debug
(
"vgId:%d sync event
sync close"
,
pSyncNode
->
vgId
);
int32_t
ret
;
assert
(
pSyncNode
!=
NULL
);
...
...
@@ -1240,7 +1240,8 @@ void syncNodeUpdateTerm(SSyncNode* pSyncNode, SyncTerm term) {
}
void
syncNodeBecomeFollower
(
SSyncNode
*
pSyncNode
,
const
char
*
debugStr
)
{
sInfo
(
"sync event vgId:%d become follower, isStandBy:%d, %s"
,
pSyncNode
->
vgId
,
pSyncNode
->
pRaftCfg
->
isStandBy
,
debugStr
);
sDebug
(
"vgId:%d sync event become follower, isStandBy:%d, %s"
,
pSyncNode
->
vgId
,
pSyncNode
->
pRaftCfg
->
isStandBy
,
debugStr
);
// maybe clear leader cache
if
(
pSyncNode
->
state
==
TAOS_SYNC_STATE_LEADER
)
{
...
...
@@ -1274,7 +1275,8 @@ void syncNodeBecomeFollower(SSyncNode* pSyncNode, const char* debugStr) {
// /\ UNCHANGED <<messages, currentTerm, votedFor, candidateVars, logVars>>
//
void
syncNodeBecomeLeader
(
SSyncNode
*
pSyncNode
,
const
char
*
debugStr
)
{
sInfo
(
"sync event vgId:%d become leader, isStandBy:%d, %s"
,
pSyncNode
->
vgId
,
pSyncNode
->
pRaftCfg
->
isStandBy
,
debugStr
);
sDebug
(
"vgId:%d sync event become leader, isStandBy:%d, %s"
,
pSyncNode
->
vgId
,
pSyncNode
->
pRaftCfg
->
isStandBy
,
debugStr
);
// state change
pSyncNode
->
state
=
TAOS_SYNC_STATE_LEADER
;
...
...
@@ -1882,7 +1884,7 @@ static int32_t syncNodeConfigChange(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftE
int32_t
syncNodeCommit
(
SSyncNode
*
ths
,
SyncIndex
beginIndex
,
SyncIndex
endIndex
,
uint64_t
flag
)
{
int32_t
code
=
0
;
ESyncState
state
=
flag
;
s
Info
(
"sync event vgId:%d
commit by wal from index:%"
PRId64
" to index:%"
PRId64
", %s"
,
ths
->
vgId
,
beginIndex
,
s
Debug
(
"vgId:%d sync event
commit by wal from index:%"
PRId64
" to index:%"
PRId64
", %s"
,
ths
->
vgId
,
beginIndex
,
endIndex
,
syncUtilState2String
(
state
));
// execute fsm
...
...
@@ -1931,7 +1933,7 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex,
ths
->
pFsm
->
FpRestoreFinishCb
(
ths
->
pFsm
);
}
ths
->
restoreFinish
=
true
;
s
Info
(
"sync event vgId:%d
restore finish"
,
ths
->
vgId
);
s
Debug
(
"vgId:%d sync event
restore finish"
,
ths
->
vgId
);
}
}
...
...
source/libs/sync/src/syncRaftLog.c
浏览文件 @
6a4cdade
...
...
@@ -162,7 +162,7 @@ static int32_t raftLogAppendEntry(struct SSyncLogStore* pLogStore, SSyncRaftEntr
walFsync
(
pWal
,
true
);
s
Trace
(
"sync event vgId:%d
write index:%ld, %s, isStandBy:%d, msgType:%s, originalRpcType:%s"
,
pData
->
pSyncNode
->
vgId
,
s
Debug
(
"vgId:%d sync event
write index:%ld, %s, isStandBy:%d, msgType:%s, originalRpcType:%s"
,
pData
->
pSyncNode
->
vgId
,
pEntry
->
index
,
syncUtilState2String
(
pData
->
pSyncNode
->
state
),
pData
->
pSyncNode
->
pRaftCfg
->
isStandBy
,
TMSG_INFO
(
pEntry
->
msgType
),
TMSG_INFO
(
pEntry
->
originalRpcType
));
...
...
@@ -320,7 +320,7 @@ int32_t logStoreAppendEntry(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry) {
walFsync
(
pWal
,
true
);
s
Trace
(
"sync event old write wal: %ld"
,
pEntry
->
index
);
s
Debug
(
"sync event old write wal: %ld"
,
pEntry
->
index
);
return
code
;
}
...
...
source/libs/sync/src/syncSnapshot.c
浏览文件 @
6a4cdade
...
...
@@ -140,16 +140,16 @@ void snapshotSenderStart(SSyncSnapshotSender *pSender) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
s
Trace
(
"
sync event vgId:%d
snapshot send to %s:%d begin seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d begin seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld send "
"msg:%s"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
s
Trace
(
"
sync event vgId:%d
snapshot send to %s:%d begin seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d begin seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
);
...
...
@@ -278,23 +278,23 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) {
if
(
pSender
->
seq
==
SYNC_SNAPSHOT_SEQ_END
)
{
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
s
Trace
(
"
sync event vgId:%d
snapshot send to %s:%d finish seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d finish seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld send "
"msg:%s"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
s
Trace
(
"
sync event vgId:%d
snapshot send to %s:%d finish seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d finish seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
);
}
}
else
{
s
Trace
(
"
sync event vgId:%d
snapshot send to %s:%d sending seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
s
Debug
(
"
vgId:%d sync event
snapshot send to %s:%d sending seq:%d ack:%d lastApplyIndex:%ld lastApplyTerm:%lu "
"lastConfigIndex:%ld"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
pSender
->
snapshot
.
lastApplyIndex
,
pSender
->
snapshot
.
lastApplyTerm
,
pSender
->
snapshot
.
lastConfigIndex
);
...
...
@@ -328,11 +328,11 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
s
Trace
(
"sync event vgId:%d
snapshot send to %s:%d resend seq:%d ack:%d send msg:%s"
,
pSender
->
pSyncNode
->
vgId
,
s
Debug
(
"vgId:%d sync event
snapshot send to %s:%d resend seq:%d ack:%d send msg:%s"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
s
Trace
(
"sync event vgId:%d
snapshot send to %s:%d resend seq:%d ack:%d"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
s
Debug
(
"vgId:%d sync event
snapshot send to %s:%d resend seq:%d ack:%d"
,
pSender
->
pSyncNode
->
vgId
,
host
,
port
,
pSender
->
seq
,
pSender
->
ack
);
}
...
...
@@ -565,12 +565,17 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d begin ack:%d, lastIndex:%ld, lastTerm:%lu, recv msg:%s"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
msgStr
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d begin ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld, recv msg:%s"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d begin ack:%d, lastIndex:%ld, lastTerm:%lu"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d begin ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
}
}
else
if
(
pMsg
->
seq
==
SYNC_SNAPSHOT_SEQ_END
)
{
...
...
@@ -597,12 +602,12 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
bool
isDrop
;
if
(
IamInNew
)
{
s
Trace
(
"sync event vgId:%d
update config by snapshot, lastIndex:%ld, lastTerm:%lu, lastConfigIndex:%ld "
,
s
Debug
(
"vgId:%d sync event
update config by snapshot, lastIndex:%ld, lastTerm:%lu, lastConfigIndex:%ld "
,
pSyncNode
->
vgId
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
syncNodeUpdateConfig
(
pSyncNode
,
&
newSyncCfg
,
pMsg
->
lastConfigIndex
,
&
isDrop
);
}
else
{
s
Trace
(
"
sync event vgId:%d
do not update config by snapshot, I am not in newCfg, lastIndex:%ld, lastTerm:%lu, "
s
Debug
(
"
vgId:%d sync event
do not update config by snapshot, I am not in newCfg, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld "
,
pSyncNode
->
vgId
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
}
...
...
@@ -626,19 +631,20 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
if
(
gRaftDetailLog
)
{
char
*
logSimpleStr
=
logStoreSimple2Str
(
pSyncNode
->
pLogStore
);
s
Info
(
"
sync event vgId:%d
snapshot recv from %s:%d finish, update log begin index:%ld, "
s
Debug
(
"
vgId:%d sync event
snapshot recv from %s:%d finish, update log begin index:%ld, "
"snapshot.lastApplyIndex:%ld, "
"snapshot.lastApplyTerm:%lu, raft log:%s"
,
"snapshot.lastApplyTerm:%lu,
snapshot.lastConfigIndex:%ld,
raft log:%s"
,
pSyncNode
->
vgId
,
host
,
port
,
pMsg
->
lastIndex
+
1
,
snapshot
.
lastApplyIndex
,
snapshot
.
lastApplyTerm
,
logSimpleStr
);
snapshot
.
lastConfigIndex
,
logSimpleStr
);
taosMemoryFree
(
logSimpleStr
);
}
else
{
s
Info
(
"
sync event vgId:%d
snapshot recv from %s:%d finish, update log begin index:%ld, "
s
Debug
(
"
vgId:%d sync event
snapshot recv from %s:%d finish, update log begin index:%ld, "
"snapshot.lastApplyIndex:%ld, "
"snapshot.lastApplyTerm:%lu"
,
pSyncNode
->
vgId
,
host
,
port
,
pMsg
->
lastIndex
+
1
,
snapshot
.
lastApplyIndex
,
snapshot
.
lastApplyTerm
);
"snapshot.lastApplyTerm:%lu, snapshot.lastConfigIndex:%ld"
,
pSyncNode
->
vgId
,
host
,
port
,
pMsg
->
lastIndex
+
1
,
snapshot
.
lastApplyIndex
,
snapshot
.
lastApplyTerm
,
snapshot
.
lastConfigIndex
);
}
pReceiver
->
pWriter
=
NULL
;
...
...
@@ -648,12 +654,18 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d end ack:%d, lastIndex:%ld, lastTerm:%lu, recv msg:%s"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
msgStr
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d end ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld, recv msg:%s"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d end ack:%d, lastIndex:%ld, lastTerm:%lu"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d end ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
}
}
else
if
(
pMsg
->
seq
==
SYNC_SNAPSHOT_SEQ_FORCE_CLOSE
)
{
...
...
@@ -667,14 +679,19 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d force close ack:%d, lastIndex:%ld, lastTerm:%lu, recv "
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d force close ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld, recv "
"msg:%s"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
msgStr
);
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d force close ack:%d, lastIndex:%ld, lastTerm:%lu"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d force close ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld"
,
pReceiver
->
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
}
}
else
if
(
pMsg
->
seq
>
SYNC_SNAPSHOT_SEQ_BEGIN
&&
pMsg
->
seq
<
SYNC_SNAPSHOT_SEQ_END
)
{
...
...
@@ -693,13 +710,17 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) {
if
(
gRaftDetailLog
)
{
char
*
msgStr
=
syncSnapshotSend2Str
(
pMsg
);
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d receiving ack:%d, lastIndex:%ld, lastTerm:%lu, recv msg:%s"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
msgStr
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d receiving ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld, recv msg:%s"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
,
msgStr
);
taosMemoryFree
(
msgStr
);
}
else
{
sTrace
(
"sync event vgId:%d snapshot recv from %s:%d receiving ack:%d, lastIndex:%ld, lastTerm:%lu"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
);
sDebug
(
"vgId:%d sync event snapshot recv from %s:%d receiving ack:%d, lastIndex:%ld, lastTerm:%lu, "
"lastConfigIndex:%ld"
,
pSyncNode
->
vgId
,
host
,
port
,
pReceiver
->
ack
,
pMsg
->
lastIndex
,
pMsg
->
lastTerm
,
pMsg
->
lastConfigIndex
);
}
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录