Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
631dc77e
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
631dc77e
编写于
9月 10, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1382
上级
59711f9d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
102 addition
and
6 deletion
+102
-6
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+0
-2
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+1
-1
tests/script/unique/cluster/balance3.sim
tests/script/unique/cluster/balance3.sim
+101
-3
未找到文件。
src/mnode/src/mnodeSdb.c
浏览文件 @
631dc77e
...
@@ -395,8 +395,6 @@ int32_t sdbInit() {
...
@@ -395,8 +395,6 @@ int32_t sdbInit() {
tsSdbObj
.
role
=
TAOS_SYNC_ROLE_MASTER
;
tsSdbObj
.
role
=
TAOS_SYNC_ROLE_MASTER
;
}
}
sdbUpdateSync
();
tsSdbObj
.
status
=
SDB_STATUS_SERVING
;
tsSdbObj
.
status
=
SDB_STATUS_SERVING
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/sync/src/syncMain.c
浏览文件 @
631dc77e
...
@@ -513,7 +513,7 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) {
...
@@ -513,7 +513,7 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) {
if
(
pPeer
->
nodeId
==
0
||
(
ret
>
0
)
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
if
(
pPeer
->
nodeId
==
0
||
(
ret
>
0
)
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
sDebug
(
"%s, start to check peer connection"
,
pPeer
->
id
);
sDebug
(
"%s, start to check peer connection"
,
pPeer
->
id
);
int32_t
checkMs
=
100
+
(
pNode
->
vgId
*
10
)
%
100
;
int32_t
checkMs
=
100
+
(
pNode
->
vgId
*
10
)
%
100
;
if
(
pNode
->
vgId
)
checkMs
=
tsStatusInterval
*
3
000
+
100
;
if
(
pNode
->
vgId
)
checkMs
=
tsStatusInterval
*
2
000
+
100
;
taosTmrReset
(
syncCheckPeerConnection
,
checkMs
,
pPeer
,
syncTmrCtrl
,
&
pPeer
->
timer
);
taosTmrReset
(
syncCheckPeerConnection
,
checkMs
,
pPeer
,
syncTmrCtrl
,
&
pPeer
->
timer
);
}
}
...
...
tests/script/unique/cluster/balance3.sim
浏览文件 @
631dc77e
...
@@ -105,6 +105,15 @@ if $dnode4Vnodes != null then
...
@@ -105,6 +105,15 @@ if $dnode4Vnodes != null then
goto show1
goto show1
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step2
print ============================== step2
print ========= start dnode4
print ========= start dnode4
sql create dnode $hostname4
sql create dnode $hostname4
...
@@ -132,6 +141,15 @@ if $dnode4Vnodes != 2 then
...
@@ -132,6 +141,15 @@ if $dnode4Vnodes != 2 then
goto show2
goto show2
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step3
print ============================== step3
print ========= drop dnode2
print ========= drop dnode2
sql drop dnode $hostname2
sql drop dnode $hostname2
...
@@ -167,6 +185,15 @@ if $dnode4Vnodes != 3 then
...
@@ -167,6 +185,15 @@ if $dnode4Vnodes != 3 then
goto show3
goto show3
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ============================== step4
print ============================== step4
...
@@ -195,6 +222,15 @@ if $dnode5Vnodes != 2 then
...
@@ -195,6 +222,15 @@ if $dnode5Vnodes != 2 then
goto show4
goto show4
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step5
print ============================== step5
print ========= drop dnode3
print ========= drop dnode3
sql drop dnode $hostname3
sql drop dnode $hostname3
...
@@ -232,6 +268,15 @@ endi
...
@@ -232,6 +268,15 @@ endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step6
print ============================== step6
sql create dnode $hostname6
sql create dnode $hostname6
system sh/exec.sh -n dnode6 -s start
system sh/exec.sh -n dnode6 -s start
...
@@ -258,6 +303,15 @@ if $dnode6Vnodes != 2 then
...
@@ -258,6 +303,15 @@ if $dnode6Vnodes != 2 then
goto show6
goto show6
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step7
print ============================== step7
print ========= drop dnode4
print ========= drop dnode4
sql drop dnode $hostname4
sql drop dnode $hostname4
...
@@ -294,6 +348,14 @@ if $dnode4Vnodes != null then
...
@@ -294,6 +348,14 @@ if $dnode4Vnodes != null then
endi
endi
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step8
print ============================== step8
sql create dnode $hostname7
sql create dnode $hostname7
...
@@ -321,6 +383,15 @@ if $dnode7Vnodes != 2 then
...
@@ -321,6 +383,15 @@ if $dnode7Vnodes != 2 then
goto show8
goto show8
endi
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step9
print ============================== step9
print ========= drop dnode1
print ========= drop dnode1
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
@@ -335,15 +406,20 @@ sql show mnodes
...
@@ -335,15 +406,20 @@ sql show mnodes
$dnode1Role = $data2_1
$dnode1Role = $data2_1
$dnode4Role = $data2_4
$dnode4Role = $data2_4
$dnode5Role = $data2_5
$dnode5Role = $data2_5
print dnode1 ==> $dnode1Role
print dnode1 ==> $data2_1
print dnode4 ==> $dnode4Role
print dnode2 ==> $data2_2
print dnode5 ==> $dnode5Role
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
if $dnode1Role != offline then
if $dnode1Role != offline then
return -1
return -1
endi
endi
print ============================== step9.1
print ============================== step9.1
sleep 2000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$x = 0
$x = 0
...
@@ -353,6 +429,19 @@ show9:
...
@@ -353,6 +429,19 @@ show9:
if $x == 20 then
if $x == 20 then
return -1
return -1
endi
endi
sql show mnodes
$dnode1Role = $data2_1
$dnode4Role = $data2_4
$dnode5Role = $data2_5
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
sql show dnodes -x show9
sql show dnodes -x show9
$dnode5Vnodes = $data2_5
$dnode5Vnodes = $data2_5
print dnode5 $dnode5Vnodes
print dnode5 $dnode5Vnodes
...
@@ -374,6 +463,15 @@ endi
...
@@ -374,6 +463,15 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
sleep 5000
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step11
print ============================== step11
print ========= add db4
print ========= add db4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录