Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3139aaef
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看板
提交
3139aaef
编写于
3月 21, 2022
作者:
M
Minghao Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync refactor
上级
48aace92
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
8 deletion
+9
-8
source/libs/sync/inc/syncIO.h
source/libs/sync/inc/syncIO.h
+1
-1
source/libs/sync/test/syncElectTest.cpp
source/libs/sync/test/syncElectTest.cpp
+1
-0
source/libs/sync/test/syncElectTest2.cpp
source/libs/sync/test/syncElectTest2.cpp
+7
-7
未找到文件。
source/libs/sync/inc/syncIO.h
浏览文件 @
3139aaef
...
...
@@ -35,7 +35,7 @@ extern "C" {
typedef
struct
SSyncIO
{
STaosQueue
*
pMsgQ
;
STaosQset
*
pQset
;
TdThread
consumerTid
;
TdThread
consumerTid
;
void
*
serverRpc
;
void
*
clientRpc
;
...
...
source/libs/sync/test/syncElectTest.cpp
浏览文件 @
3139aaef
...
...
@@ -120,6 +120,7 @@ int main(int argc, char** argv) {
"elect sleep, state: %d, %s, term:%lu electTimerLogicClock:%lu, electTimerLogicClockUser:%lu, electTimerMS:%d"
,
gSyncNode
->
state
,
syncUtilState2String
(
gSyncNode
->
state
),
gSyncNode
->
pRaftStore
->
currentTerm
,
gSyncNode
->
electTimerLogicClock
,
gSyncNode
->
electTimerLogicClockUser
,
gSyncNode
->
electTimerMS
);
taosMsleep
(
1000
);
}
return
0
;
...
...
source/libs/sync/test/syncElectTest2.cpp
浏览文件 @
3139aaef
...
...
@@ -21,10 +21,10 @@ uint16_t ports[] = {7010, 7110, 7210, 7310, 7410};
int32_t
replicaNum
=
3
;
int32_t
myIndex
=
0
;
SRaftId
ids
[
TSDB_MAX_REPLICA
];
SSyncInfo
syncInfo
;
SSyncFSM
*
pFsm
;
SWal
*
pWal
;
SRaftId
ids
[
TSDB_MAX_REPLICA
];
SSyncInfo
syncInfo
;
SSyncFSM
*
pFsm
;
SWal
*
pWal
;
int64_t
syncNodeInit
()
{
syncInfo
.
vgId
=
1234
;
...
...
@@ -33,7 +33,7 @@ int64_t syncNodeInit() {
syncInfo
.
queue
=
gSyncIO
->
pMsgQ
;
syncInfo
.
FpEqMsg
=
syncIOEqMsg
;
syncInfo
.
pFsm
=
pFsm
;
snprintf
(
syncInfo
.
path
,
sizeof
(
syncInfo
.
path
),
"./elect_test_%d"
,
myIndex
);
snprintf
(
syncInfo
.
path
,
sizeof
(
syncInfo
.
path
),
"./elect
2
_test_%d"
,
myIndex
);
int
code
=
walInit
();
assert
(
code
==
0
);
...
...
@@ -48,7 +48,7 @@ int64_t syncNodeInit() {
walCfg
.
level
=
TAOS_WAL_FSYNC
;
char
tmpdir
[
128
];
snprintf
(
tmpdir
,
sizeof
(
tmpdir
),
"./elect_test_wal_%d"
,
myIndex
);
snprintf
(
tmpdir
,
sizeof
(
tmpdir
),
"./elect
2
_test_wal_%d"
,
myIndex
);
pWal
=
walOpen
(
tmpdir
,
&
walCfg
);
assert
(
pWal
!=
NULL
);
...
...
@@ -64,7 +64,6 @@ int64_t syncNodeInit() {
// taosGetFqdn(pCfg->nodeInfo[0].nodeFqdn);
}
int64_t
rid
=
syncStart
(
&
syncInfo
);
assert
(
rid
>
0
);
...
...
@@ -127,6 +126,7 @@ int main(int argc, char** argv) {
"elect sleep, state: %d, %s, term:%lu electTimerLogicClock:%lu, electTimerLogicClockUser:%lu, electTimerMS:%d"
,
pSyncNode
->
state
,
syncUtilState2String
(
pSyncNode
->
state
),
pSyncNode
->
pRaftStore
->
currentTerm
,
pSyncNode
->
electTimerLogicClock
,
pSyncNode
->
electTimerLogicClockUser
,
pSyncNode
->
electTimerMS
);
taosMsleep
(
1000
);
}
syncNodeRelease
(
pSyncNode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录