Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0914c023
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看板
提交
0914c023
编写于
10月 22, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: compile error in mac
上级
8354d7a4
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
116 addition
and
116 deletion
+116
-116
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+5
-5
source/libs/sync/src/syncMessage.c
source/libs/sync/src/syncMessage.c
+67
-67
source/libs/sync/src/syncRaftCfg.c
source/libs/sync/src/syncRaftCfg.c
+13
-13
source/libs/sync/src/syncRaftEntry.c
source/libs/sync/src/syncRaftEntry.c
+8
-8
source/libs/sync/src/syncRaftLog.c
source/libs/sync/src/syncRaftLog.c
+8
-8
source/libs/sync/src/syncRaftStore.c
source/libs/sync/src/syncRaftStore.c
+4
-4
source/libs/sync/src/syncTimeout.c
source/libs/sync/src/syncTimeout.c
+3
-3
source/libs/sync/src/syncVoteMgr.c
source/libs/sync/src/syncVoteMgr.c
+8
-8
未找到文件。
source/libs/sync/src/syncMain.c
浏览文件 @
0914c023
...
...
@@ -2693,35 +2693,35 @@ int32_t syncNodeGetPreIndexTerm(SSyncNode* pSyncNode, SyncIndex index, SyncIndex
// for debug --------------
void
syncNodePrint
(
SSyncNode
*
pObj
)
{
char
*
serialized
=
syncNode2Str
(
pObj
);
printf
(
"syncNodePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"syncNodePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
syncNodePrint2
(
char
*
s
,
SSyncNode
*
pObj
)
{
char
*
serialized
=
syncNode2Str
(
pObj
);
printf
(
"syncNodePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"syncNodePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
syncNodeLog
(
SSyncNode
*
pObj
)
{
char
*
serialized
=
syncNode2Str
(
pObj
);
sTraceLong
(
"syncNodeLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTraceLong
(
"syncNodeLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
syncNodeLog2
(
char
*
s
,
SSyncNode
*
pObj
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
syncNode2Str
(
pObj
);
sTraceLong
(
"syncNodeLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTraceLong
(
"syncNodeLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
}
void
syncNodeLog3
(
char
*
s
,
SSyncNode
*
pObj
)
{
char
*
serialized
=
syncNode2Str
(
pObj
);
sTraceLong
(
"syncNodeLog3 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTraceLong
(
"syncNodeLog3 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
...
...
source/libs/sync/src/syncMessage.c
浏览文件 @
0914c023
此差异已折叠。
点击以展开。
source/libs/sync/src/syncRaftCfg.c
浏览文件 @
0914c023
...
...
@@ -447,85 +447,85 @@ int32_t raftCfgFromStr(const char *s, SRaftCfg *pRaftCfg) {
// for debug ----------------------
void
syncCfgPrint
(
SSyncCfg
*
pCfg
)
{
char
*
serialized
=
syncCfg2Str
(
pCfg
);
printf
(
"syncCfgPrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"syncCfgPrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
syncCfgPrint2
(
char
*
s
,
SSyncCfg
*
pCfg
)
{
char
*
serialized
=
syncCfg2Str
(
pCfg
);
printf
(
"syncCfgPrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"syncCfgPrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
syncCfgLog
(
SSyncCfg
*
pCfg
)
{
char
*
serialized
=
syncCfg2Str
(
pCfg
);
sTrace
(
"syncCfgLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"syncCfgLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
syncCfgLog2
(
char
*
s
,
SSyncCfg
*
pCfg
)
{
char
*
serialized
=
syncCfg2Str
(
pCfg
);
sTrace
(
"syncCfgLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"syncCfgLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
void
syncCfgLog3
(
char
*
s
,
SSyncCfg
*
pCfg
)
{
char
*
serialized
=
syncCfg2SimpleStr
(
pCfg
);
sTrace
(
"syncCfgLog3 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"syncCfgLog3 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftCfgPrint
(
SRaftCfg
*
pCfg
)
{
char
*
serialized
=
raftCfg2Str
(
pCfg
);
printf
(
"raftCfgPrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"raftCfgPrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCfgPrint2
(
char
*
s
,
SRaftCfg
*
pCfg
)
{
char
*
serialized
=
raftCfg2Str
(
pCfg
);
printf
(
"raftCfgPrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"raftCfgPrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCfgLog
(
SRaftCfg
*
pCfg
)
{
char
*
serialized
=
raftCfg2Str
(
pCfg
);
sTrace
(
"raftCfgLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"raftCfgLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftCfgLog2
(
char
*
s
,
SRaftCfg
*
pCfg
)
{
char
*
serialized
=
raftCfg2Str
(
pCfg
);
sTrace
(
"raftCfgLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"raftCfgLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
// ---------
void
raftCfgIndexPrint
(
SRaftCfgIndex
*
pCfg
)
{
char
*
serialized
=
raftCfgIndex2Str
(
pCfg
);
printf
(
"raftCfgIndexPrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"raftCfgIndexPrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCfgIndexPrint2
(
char
*
s
,
SRaftCfgIndex
*
pCfg
)
{
char
*
serialized
=
raftCfgIndex2Str
(
pCfg
);
printf
(
"raftCfgIndexPrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"raftCfgIndexPrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCfgIndexLog
(
SRaftCfgIndex
*
pCfg
)
{
char
*
serialized
=
raftCfgIndex2Str
(
pCfg
);
sTrace
(
"raftCfgIndexLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"raftCfgIndexLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftCfgIndexLog2
(
char
*
s
,
SRaftCfgIndex
*
pCfg
)
{
char
*
serialized
=
raftCfgIndex2Str
(
pCfg
);
sTrace
(
"raftCfgIndexLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"raftCfgIndexLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
source/libs/sync/src/syncRaftEntry.c
浏览文件 @
0914c023
...
...
@@ -418,28 +418,28 @@ char* raftCache2Str(SRaftEntryHashCache* pCache) {
void
raftCachePrint
(
SRaftEntryHashCache
*
pCache
)
{
char
*
serialized
=
raftCache2Str
(
pCache
);
printf
(
"raftCachePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"raftCachePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCachePrint2
(
char
*
s
,
SRaftEntryHashCache
*
pCache
)
{
char
*
serialized
=
raftCache2Str
(
pCache
);
printf
(
"raftCachePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"raftCachePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftCacheLog
(
SRaftEntryHashCache
*
pCache
)
{
char
*
serialized
=
raftCache2Str
(
pCache
);
sTrace
(
"raftCacheLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"raftCacheLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftCacheLog2
(
char
*
s
,
SRaftEntryHashCache
*
pCache
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
raftCache2Str
(
pCache
);
sTraceLong
(
"raftCacheLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTraceLong
(
"raftCacheLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
}
...
...
@@ -677,28 +677,28 @@ char* raftEntryCache2Str(SRaftEntryCache* pObj) {
void
raftEntryCachePrint
(
SRaftEntryCache
*
pObj
)
{
char
*
serialized
=
raftEntryCache2Str
(
pObj
);
printf
(
"raftEntryCachePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"raftEntryCachePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftEntryCachePrint2
(
char
*
s
,
SRaftEntryCache
*
pObj
)
{
char
*
serialized
=
raftEntryCache2Str
(
pObj
);
printf
(
"raftEntryCachePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"raftEntryCachePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftEntryCacheLog
(
SRaftEntryCache
*
pObj
)
{
char
*
serialized
=
raftEntryCache2Str
(
pObj
);
sTrace
(
"raftEntryCacheLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"raftEntryCacheLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftEntryCacheLog2
(
char
*
s
,
SRaftEntryCache
*
pObj
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
raftEntryCache2Str
(
pObj
);
sTraceLong
(
"raftEntryCacheLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTraceLong
(
"raftEntryCacheLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
}
source/libs/sync/src/syncRaftLog.c
浏览文件 @
0914c023
...
...
@@ -505,14 +505,14 @@ SyncIndex logStoreWalCommitVer(SSyncLogStore* pLogStore) {
// for debug -----------------
void
logStorePrint
(
SSyncLogStore
*
pLogStore
)
{
char
*
serialized
=
logStore2Str
(
pLogStore
);
printf
(
"logStorePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"logStorePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
logStorePrint2
(
char
*
s
,
SSyncLogStore
*
pLogStore
)
{
char
*
serialized
=
logStore2Str
(
pLogStore
);
printf
(
"logStorePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"logStorePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
...
...
@@ -520,7 +520,7 @@ void logStorePrint2(char* s, SSyncLogStore* pLogStore) {
void
logStoreLog
(
SSyncLogStore
*
pLogStore
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
logStore2Str
(
pLogStore
);
sTraceLong
(
"logStoreLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTraceLong
(
"logStoreLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
}
...
...
@@ -528,7 +528,7 @@ void logStoreLog(SSyncLogStore* pLogStore) {
void
logStoreLog2
(
char
*
s
,
SSyncLogStore
*
pLogStore
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
logStore2Str
(
pLogStore
);
sTraceLong
(
"logStoreLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTraceLong
(
"logStoreLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
}
...
...
@@ -536,28 +536,28 @@ void logStoreLog2(char* s, SSyncLogStore* pLogStore) {
// for debug -----------------
void
logStoreSimplePrint
(
SSyncLogStore
*
pLogStore
)
{
char
*
serialized
=
logStoreSimple2Str
(
pLogStore
);
printf
(
"logStoreSimplePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"logStoreSimplePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
logStoreSimplePrint2
(
char
*
s
,
SSyncLogStore
*
pLogStore
)
{
char
*
serialized
=
logStoreSimple2Str
(
pLogStore
);
printf
(
"logStoreSimplePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"logStoreSimplePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
logStoreSimpleLog
(
SSyncLogStore
*
pLogStore
)
{
char
*
serialized
=
logStoreSimple2Str
(
pLogStore
);
sTrace
(
"logStoreSimpleLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"logStoreSimpleLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
logStoreSimpleLog2
(
char
*
s
,
SSyncLogStore
*
pLogStore
)
{
if
(
gRaftDetailLog
)
{
char
*
serialized
=
logStoreSimple2Str
(
pLogStore
);
sTrace
(
"logStoreSimpleLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"logStoreSimpleLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
}
source/libs/sync/src/syncRaftStore.c
浏览文件 @
0914c023
...
...
@@ -226,25 +226,25 @@ char *raftStore2Str(SRaftStore *pRaftStore) {
// for debug -------------------
void
raftStorePrint
(
SRaftStore
*
pObj
)
{
char
*
serialized
=
raftStore2Str
(
pObj
);
printf
(
"raftStorePrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"raftStorePrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftStorePrint2
(
char
*
s
,
SRaftStore
*
pObj
)
{
char
*
serialized
=
raftStore2Str
(
pObj
);
printf
(
"raftStorePrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"raftStorePrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
raftStoreLog
(
SRaftStore
*
pObj
)
{
char
*
serialized
=
raftStore2Str
(
pObj
);
sTrace
(
"raftStoreLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"raftStoreLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
raftStoreLog2
(
char
*
s
,
SRaftStore
*
pObj
)
{
char
*
serialized
=
raftStore2Str
(
pObj
);
sTrace
(
"raftStoreLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"raftStoreLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
source/libs/sync/src/syncTimeout.c
浏览文件 @
0914c023
...
...
@@ -115,8 +115,8 @@ int32_t syncNodeOnTimer(SSyncNode* ths, SyncTimeout* pMsg) {
}
else
if
(
pMsg
->
timeoutType
==
SYNC_TIMEOUT_ELECTION
)
{
if
(
atomic_load_64
(
&
ths
->
electTimerLogicClockUser
)
<=
pMsg
->
logicClock
)
{
++
(
ths
->
electTimerCounter
);
sTrace
(
"vgId:%d, sync timer, type:election count:%
lu, lc-user:%"
PRId64
,
ths
->
vgId
,
ths
->
electTimerCounter
,
ths
->
electTimerLogicClockUser
);
sTrace
(
"vgId:%d, sync timer, type:election count:%
"
PRIu64
", lc-user:%"
PRIu64
,
ths
->
vgId
,
ths
->
electTimer
Counter
,
ths
->
electTimer
LogicClockUser
);
syncNodeElect
(
ths
);
}
...
...
@@ -124,7 +124,7 @@ int32_t syncNodeOnTimer(SSyncNode* ths, SyncTimeout* pMsg) {
}
else
if
(
pMsg
->
timeoutType
==
SYNC_TIMEOUT_HEARTBEAT
)
{
if
(
atomic_load_64
(
&
ths
->
heartbeatTimerLogicClockUser
)
<=
pMsg
->
logicClock
)
{
++
(
ths
->
heartbeatTimerCounter
);
sTrace
(
"vgId:%d, sync timer, type:replicate count:%"
PRIu64
", lc-user:%"
PRI
d
64
,
ths
->
vgId
,
sTrace
(
"vgId:%d, sync timer, type:replicate count:%"
PRIu64
", lc-user:%"
PRI
u
64
,
ths
->
vgId
,
ths
->
heartbeatTimerCounter
,
ths
->
heartbeatTimerLogicClockUser
);
// syncNodeReplicate(ths, true);
...
...
source/libs/sync/src/syncVoteMgr.c
浏览文件 @
0914c023
...
...
@@ -138,27 +138,27 @@ char *voteGranted2Str(SVotesGranted *pVotesGranted) {
// for debug -------------------
void
voteGrantedPrint
(
SVotesGranted
*
pObj
)
{
char
*
serialized
=
voteGranted2Str
(
pObj
);
printf
(
"voteGrantedPrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"voteGrantedPrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
voteGrantedPrint2
(
char
*
s
,
SVotesGranted
*
pObj
)
{
char
*
serialized
=
voteGranted2Str
(
pObj
);
printf
(
"voteGrantedPrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"voteGrantedPrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
voteGrantedLog
(
SVotesGranted
*
pObj
)
{
char
*
serialized
=
voteGranted2Str
(
pObj
);
sTrace
(
"voteGrantedLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"voteGrantedLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
voteGrantedLog2
(
char
*
s
,
SVotesGranted
*
pObj
)
{
char
*
serialized
=
voteGranted2Str
(
pObj
);
sTrace
(
"voteGrantedLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"voteGrantedLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
...
...
@@ -267,26 +267,26 @@ char *votesRespond2Str(SVotesRespond *pVotesRespond) {
// for debug -------------------
void
votesRespondPrint
(
SVotesRespond
*
pObj
)
{
char
*
serialized
=
votesRespond2Str
(
pObj
);
printf
(
"votesRespondPrint | len:%
"
PRIu64
" | %s
\n
"
,
strlen
(
serialized
),
serialized
);
printf
(
"votesRespondPrint | len:%
d | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
votesRespondPrint2
(
char
*
s
,
SVotesRespond
*
pObj
)
{
char
*
serialized
=
votesRespond2Str
(
pObj
);
printf
(
"votesRespondPrint2 | len:%
"
PRIu64
" | %s | %s
\n
"
,
strlen
(
serialized
),
s
,
serialized
);
printf
(
"votesRespondPrint2 | len:%
d | %s | %s
\n
"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
fflush
(
NULL
);
taosMemoryFree
(
serialized
);
}
void
votesRespondLog
(
SVotesRespond
*
pObj
)
{
char
*
serialized
=
votesRespond2Str
(
pObj
);
sTrace
(
"votesRespondLog | len:%
"
PRIu64
" | %s"
,
strlen
(
serialized
),
serialized
);
sTrace
(
"votesRespondLog | len:%
d | %s"
,
(
int32_t
)
strlen
(
serialized
),
serialized
);
taosMemoryFree
(
serialized
);
}
void
votesRespondLog2
(
char
*
s
,
SVotesRespond
*
pObj
)
{
char
*
serialized
=
votesRespond2Str
(
pObj
);
sTrace
(
"votesRespondLog2 | len:%
"
PRIu64
" | %s | %s"
,
strlen
(
serialized
),
s
,
serialized
);
sTrace
(
"votesRespondLog2 | len:%
d | %s | %s"
,
(
int32_t
)
strlen
(
serialized
),
s
,
serialized
);
taosMemoryFree
(
serialized
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录