Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
286ec4ec
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
286ec4ec
编写于
6月 28, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: case for balance vgroup
上级
a7a5dac1
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
998 addition
and
1815 deletion
+998
-1815
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+5
-0
tests/script/tsim/dnode/balance1.sim
tests/script/tsim/dnode/balance1.sim
+101
-141
tests/script/tsim/dnode/balance2.sim
tests/script/tsim/dnode/balance2.sim
+280
-0
tests/script/tsim/dnode/balance3.sim
tests/script/tsim/dnode/balance3.sim
+340
-0
tests/script/tsim/dnode/balancex.sim
tests/script/tsim/dnode/balancex.sim
+111
-94
tests/script/tsim/dnode/offline_reason.sim
tests/script/tsim/dnode/offline_reason.sim
+161
-0
tests/script/unique/dnode/alternativeRole.sim
tests/script/unique/dnode/alternativeRole.sim
+0
-97
tests/script/unique/dnode/balance2.sim
tests/script/unique/dnode/balance2.sim
+0
-306
tests/script/unique/dnode/balancex.sim
tests/script/unique/dnode/balancex.sim
+0
-215
tests/script/unique/dnode/m2.sim
tests/script/unique/dnode/m2.sim
+0
-367
tests/script/unique/dnode/monitor_bug.sim
tests/script/unique/dnode/monitor_bug.sim
+0
-77
tests/script/unique/dnode/offline1.sim
tests/script/unique/dnode/offline1.sim
+0
-77
tests/script/unique/dnode/offline2.sim
tests/script/unique/dnode/offline2.sim
+0
-126
tests/script/unique/dnode/offline3.sim
tests/script/unique/dnode/offline3.sim
+0
-111
tests/script/unique/dnode/remove2.sim
tests/script/unique/dnode/remove2.sim
+0
-204
未找到文件。
tests/script/jenkins/basic.txt
浏览文件 @
286ec4ec
...
@@ -23,6 +23,10 @@
...
@@ -23,6 +23,10 @@
# ---- dnode
# ---- dnode
./test.sh -f tsim/dnode/balance_replica1.sim
./test.sh -f tsim/dnode/balance_replica1.sim
./test.sh -f tsim/dnode/balance_replica3.sim
./test.sh -f tsim/dnode/balance_replica3.sim
./test.sh -f tsim/dnode/balance1.sim
./test.sh -f tsim/dnode/balance2.sim
./test.sh -f tsim/dnode/balance3.sim
./test.sh -f tsim/dnode/balancex.sim
./test.sh -f tsim/dnode/create_dnode.sim
./test.sh -f tsim/dnode/create_dnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim
./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim
...
@@ -30,6 +34,7 @@
...
@@ -30,6 +34,7 @@
./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim
./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim
./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim
./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim
./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim
./test.sh -f tsim/dnode/offline_reason.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim
...
...
tests/script/
unique
/dnode/balance1.sim
→
tests/script/
tsim
/dnode/balance1.sim
浏览文件 @
286ec4ec
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
print ========== step1
print ========== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create database d1
sql create database d1
vgroups 1
sql create table d1.t1 (t timestamp, i int)
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+2s, 14)
...
@@ -43,35 +21,49 @@ sql insert into d1.t1 values(now+4s, 12)
...
@@ -43,35 +21,49 @@ sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql insert into d1.t1 values(now+5s, 11)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data
2_1
print dnode1 openVnodes $data
(1)[2]
if $data
2_1
!= 1 then
if $data
(1)[2]
!= 1 then
return -1
return -1
endi
endi
print ========== step2
print ========== step2
sql create dnode $hostname
2
sql create dnode $hostname
port 7200
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
$x = 0
$x = 0
s
how2:
s
tep2:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 20 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $data2_1 != 0 then
if $rows != 2 then
goto show2
return -1
endi
if $data(1)[4] != ready then
goto step2
endi
if $data(2)[4] != ready then
goto step2
endi
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
if $data(1)[2] != 0 then
return -1
endi
endi
if $data
2_2
!= 1 then
if $data
(2)[2]
!= 1 then
goto show2
return -1
endi
endi
print ========== step3
print ========== step3
sql create database d2
sql create database d2
vgroups 1
sql create table d2.t2 (t timestamp, i int)
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+2s, 24)
...
@@ -80,69 +72,67 @@ sql insert into d2.t2 values(now+4s, 22)
...
@@ -80,69 +72,67 @@ sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data
2_1
print dnode1 openVnodes $data
(1)[2]
print dnode2 openVnodes $data
2_2
print dnode2 openVnodes $data
(2)[2]
if $data
2_1
!= 0 then
if $data
(1)[2]
!= 0 then
return -1
return -1
endi
endi
if $data
2_2
!= 2 then
if $data
(2)[2]
!= 2 then
return -1
return -1
endi
endi
print ========== step4
print ========== step4
sql drop dnode $hostname2
sql drop dnode 2
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
if $data2_1 != 2 then
if $data(1)[2] != 2 then
goto show4
return -1
endi
if $data2_2 != null then
goto show4
endi
endi
if $
rows != 1
then
if $
data(2)[2] != null
then
goto show4
return -1
endi
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step5
print ========== step5
sql create dnode $hostname
3
sql create dnode $hostname
port 7300
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
$x = 0
s
how5:
s
tep5:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 30 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 openVnodes $data2_3
if $rows != 2 then
if $data2_1 != 0 then
return -1
goto show5
endi
endi
if $data
2_2 != null
then
if $data
(1)[4] != ready
then
goto s
how
5
goto s
tep
5
endi
endi
if $data2_3 != 2 then
if $data(3)[4] != ready then
goto show5
goto step5
endi
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(3)[2]
if $data(1)[2] != 1 then
return -1
endi
if $data(3)[2] != 1 then
return -1
endi
endi
print ========== step6
print ========== step6
sql create database d3
sql create database d3
vgroups 1
sql create table d3.t3 (t timestamp, i int)
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+2s, 34)
...
@@ -151,52 +141,46 @@ sql insert into d3.t3 values(now+4s, 32)
...
@@ -151,52 +141,46 @@ sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql insert into d3.t3 values(now+5s, 31)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(3)[2]
print dnode3 openVnodes $data2_3
if $data(1)[2] != 1 then
if $data2_1 != 0 then
return -1
return -1
endi
endi
if $data2_2 != null then
if $data(3)[2] != 2 then
return -1
endi
if $data2_3 != 3 then
return -1
return -1
endi
endi
print ========== step7
print ========== step7
sql create dnode $hostname
4
sql create dnode $hostname
port 7400
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode4 -s start
$x = 0
$x = 0
s
how7:
s
tep7:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 20 then
if $x == 10 then
return -1
print ====> dnode not ready!
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 openVnodes $data2_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 openVnodes $data2_4
if $rows != 3 then
if $data2_1 != 0 then
return -1
goto show7
endi
endi
if $data
2_2 != null
then
if $data
(1)[4] != ready
then
goto s
how
7
goto s
tep
7
endi
endi
if $data
2_3 != 2
then
if $data
(3)[4] != ready
then
goto s
how
7
goto s
tep
7
endi
endi
if $data
2_4 != 1
then
if $data
(4)[4] != ready
then
goto s
how
7
goto s
tep
7
endi
endi
print ========== step8
print ========== step8
sql create database d4
sql create database d4
vgroups 1
sql create table d4.t4 (t timestamp, i int)
sql create table d4.t4 (t timestamp, i int)
sql insert into d4.t4 values(now+1s, 45)
sql insert into d4.t4 values(now+1s, 45)
sql insert into d4.t4 values(now+2s, 44)
sql insert into d4.t4 values(now+2s, 44)
...
@@ -205,56 +189,32 @@ sql insert into d4.t4 values(now+4s, 42)
...
@@ -205,56 +189,32 @@ sql insert into d4.t4 values(now+4s, 42)
sql insert into d4.t4 values(now+5s, 41)
sql insert into d4.t4 values(now+5s, 41)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(3)[2]
print dnode3 openVnodes $data2_3
print dnode2 openVnodes $data(4)[2]
print dnode4 openVnodes $data2_4
if $data(1)[2] != 1 then
if $data2_1 != 0 then
return -1
return -1
endi
endi
if $data
2_2 != null
then
if $data
(3)[2] != 2
then
return -1
return -1
endi
endi
if $data2_3 != 2 then
if $data(4)[2] != 1 then
return -1
endi
if $data2_4 != 2 then
return -1
return -1
endi
endi
print ========== step9
print ========== step9
sql drop dnode $hostname3
sql drop dnode 3
$x = 0
show9:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(4)[2]
print dnode3 openVnodes $data2_3
if $data(1)[2] != 2 then
print dnode4 openVnodes $data2_4
return -1
if $data2_1 != 0 then
goto show9
endi
if $data2_2 != null then
goto show9
endi
if $data2_3 != null then
goto show9
endi
endi
if $data
2_4 != 4
then
if $data
(4)[2] != 2
then
goto show9
return -1
endi
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sql reset query cache
sql reset query cache
sleep 100
sleep 100
...
...
tests/script/
unique/dnode/m3
.sim
→
tests/script/
tsim/dnode/balance2
.sim
浏览文件 @
286ec4ec
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
system sh/cfg.sh -n dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode5 -c balanceInterval -v 10
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4
print ========== step1
print ========== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create dnode $hostname2
sql create dnode $hostname port 7200
sql create dnode $hostname3
sql create dnode $hostname port 7300
sql create dnode $hostname4
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
$x = 0
$x = 0
step1:
step1:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 10 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 $data4_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 $data4_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 $data4_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 $data4_4
if $rows != 3 then
return -1
if $data4_1 != ready then
goto step1
endi
endi
if $data
4_2
!= ready then
if $data
(1)[4]
!= ready then
goto step1
goto step1
endi
endi
if $data
4_3
!= ready then
if $data
(2)[4]
!= ready then
goto step1
goto step1
endi
endi
if $data
4_4
!= ready then
if $data
(3)[4]
!= ready then
goto step1
goto step1
endi
endi
print ========== step2
print ========== step2
sql create database d1 replica 3 vgroups 1
sql create database d1 replica 3
sql create table d1.t1 (t timestamp, i int)
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+2s, 14)
...
@@ -71,7 +53,7 @@ sql insert into d1.t1 values(now+3s, 13)
...
@@ -71,7 +53,7 @@ sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2 replica 3
sql create database d2 replica 3
vgroups 1
sql create table d2.t2 (t timestamp, i int)
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+2s, 24)
...
@@ -79,7 +61,7 @@ sql insert into d2.t2 values(now+3s, 23)
...
@@ -79,7 +61,7 @@ sql insert into d2.t2 values(now+3s, 23)
sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql insert into d2.t2 values(now+5s, 21)
sql create database d3 replica 3
sql create database d3 replica 3
vgroups 1
sql create table d3.t3 (t timestamp, i int)
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+2s, 34)
...
@@ -87,7 +69,7 @@ sql insert into d3.t3 values(now+3s, 33)
...
@@ -87,7 +69,7 @@ sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql insert into d3.t3 values(now+5s, 31)
sql create database d4 replica 3
sql create database d4 replica 3
vgroups 1
sql create table d4.t4 (t timestamp, i int)
sql create table d4.t4 (t timestamp, i int)
sql insert into d4.t4 values(now+1s, 45)
sql insert into d4.t4 values(now+1s, 45)
sql insert into d4.t4 values(now+2s, 44)
sql insert into d4.t4 values(now+2s, 44)
...
@@ -96,190 +78,129 @@ sql insert into d4.t4 values(now+4s, 42)
...
@@ -96,190 +78,129 @@ sql insert into d4.t4 values(now+4s, 42)
sql insert into d4.t4 values(now+5s, 41)
sql insert into d4.t4 values(now+5s, 41)
print ========== step2.1
print ========== step2.1
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data2_3
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data2_4
if $data(1)[2] != 4 then
if $data2_1 != 0 then
return -1
return -1
endi
endi
if $data
2_2
!= 4 then
if $data
(2)[2]
!= 4 then
return -1
return -1
endi
endi
if $data2_3 != 4 then
if $data(3)[2] != 4 then
return -1
endi
if $data2_4 != 4 then
return -1
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
endi
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 3 then
return -1
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 2 then
return -1
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
return -1
endi
endi
print ========== step3
print ========== step3
sql create dnode $hostname5
sql create dnode $hostname port 7400
sql create dnode $hostname port 7500
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode5 -s start
$x = 0
$x = 0
s
how3:
s
tep3:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 10 then
return -1
print ====> dnode not ready!
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 openVnodes $data2_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 openVnodes $data2_4
print ===> $data30 $data31 $data32 $data33 $data34 $data35
print dnode5 openVnodes $data2_5
print ===> $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
if $data2_2 != 3 then
return -1
goto show3
endi
endi
if $data
2_3 != 3
then
if $data
(1)[4] != ready
then
goto show
3
goto step
3
endi
endi
if $data
2_4 != 3
then
if $data
(2)[4] != ready
then
goto show
3
goto step
3
endi
endi
if $data
2_5 != 3
then
if $data
(3)[4] != ready
then
goto show
3
goto step
3
endi
endi
if $data(4)[4] != ready then
sql show d1.vgroups;
goto step3
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 5 then
return -1
endi
endi
if $data
03 != 3
then
if $data
(5)[4] != ready
then
goto show
3
goto step
3
endi
endi
sql show d2.vgroups;
sql balance vgroup
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show dnodes
if $data04 != 5 then
print dnode1 openVnodes $data(1)[2]
print dnode3 openVnodes $data(2)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
print dnode5 openVnodes $data(5)[2]
if $data(1)[2] != 2 then
return -1
return -1
endi
endi
if $data03 != 3 then
if $data(2)[2] != 3 then
goto show3
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 2 then
return -1
return -1
endi
endi
if $data
03
!= 3 then
if $data
(3)[2]
!= 3 then
goto show3
return -1
endi
endi
if $data(4)[2] != 2 then
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
return -1
endi
endi
if $data
03 != 3
then
if $data
(5)[2] != 2
then
goto show3
return -1
endi
endi
print ========== step4
print ========== step4
sql drop dnode $hostname2
sql drop dnode 2
$x = 0
show4:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data(3)[2]
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data(4)[2]
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data(5)[2]
print dnode5 openVnodes $data2_5
if $data(1)[2] != 2 then
if $data2_2 != null then
goto show4
endi
if $data2_3 != 4 then
goto show4
endi
if $data2_4 != 4 then
goto show4
endi
if $data2_5 != 4 then
goto show4
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 5 then
return -1
return -1
endi
endi
if $data
03
!= 3 then
if $data
(3)[2]
!= 3 then
goto show4
return -1
endi
endi
if $data(4)[2] != 4 then
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 3 then
return -1
return -1
endi
endi
if $data
03
!= 3 then
if $data
(5)[2]
!= 3 then
goto show4
return -1
endi
endi
sql show d3.vgroups;
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
print ========== step5
sql drop dnode 3
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
print dnode5 openVnodes $data(5)[2]
if $data(1)[2] != 4 then
return -1
return -1
endi
endi
if $data
03 != 3
then
if $data
(3)[2] != null
then
goto show4
return -1
endi
endi
if $data(4)[2] != 4 then
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
return -1
endi
endi
if $data
03 != 3
then
if $data
(5)[2] != 4
then
goto show4
return -1
endi
endi
sql reset query cache
sql reset query cache
sleep 100
sleep 100
system sh/exec.sh -n dnode3 -s stop -x SIGINT
print ========== step
5
print ========== step
6
sql select * from d1.t1 order by t desc
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
if $data01 != 11 then
...
...
tests/script/
unique
/dnode/balance3.sim
→
tests/script/
tsim
/dnode/balance3.sim
浏览文件 @
286ec4ec
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode6 -c supportVnodes -v 4
system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode5 -c wallevel -v 1
system sh/cfg.sh -n dnode6 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode6 -c maxTablesPerVnode -v 4
print ========== step1
print ========== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create dnode $hostname
2
sql create dnode $hostname
port 7200
sql create dnode $hostname
3
sql create dnode $hostname
port 7300
sql create dnode $hostname
4
sql create dnode $hostname
port 7400
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode4 -s start
$x = 0
$x = 0
step1:
step1:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 10 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 $data4_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 $data4_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 $data4_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 $data4_4
print ===> $data30 $data31 $data32 $data33 $data34 $data35
if $rows != 4 then
if $data4_1 != ready then
return -1
endi
if $data(1)[4] != ready then
goto step1
goto step1
endi
endi
if $data
4_2
!= ready then
if $data
(2)[4]
!= ready then
goto step1
goto step1
endi
endi
if $data
4_3
!= ready then
if $data
(3)[4]
!= ready then
goto step1
goto step1
endi
endi
if $data
4_4
!= ready then
if $data
(4)[4]
!= ready then
goto step1
goto step1
endi
endi
sql create database d1 replica 3
sql create database d1 replica 3
vgroups 1
sql create table d1.t1 (t timestamp, i int)
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+2s, 14)
...
@@ -73,7 +60,7 @@ sql insert into d1.t1 values(now+3s, 13)
...
@@ -73,7 +60,7 @@ sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2 replica 3
sql create database d2 replica 3
vgroups 1
sql create table d2.t2 (t timestamp, i int)
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+2s, 24)
...
@@ -82,92 +69,99 @@ sql insert into d2.t2 values(now+4s, 22)
...
@@ -82,92 +69,99 @@ sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data2_3
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data2_4
print dnode4 openVnodes $data(4)[2]
if $data(1)[2] != 0 then
if $data2_1 != 0 then
return -1
return -1
endi
endi
if $data
2_2
!= 2 then
if $data
(2)[2]
!= 2 then
return -1
return -1
endi
endi
if $data
2_3
!= 2 then
if $data
(3)[2]
!= 2 then
return -1
return -1
endi
endi
if $data
2_4
!= 2 then
if $data
(4)[2]
!= 2 then
return -1
return -1
endi
endi
print ========== step2
print ========== step2
sql drop dnode $hostname2
sql drop dnode 2
$x = 0
show2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data2_3
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data2_4
print dnode4 openVnodes $data(4)[2]
if $data(1)[2] != 2 then
if $data2_1 != 2 then
return -1
goto show2
endi
endi
if $data
2_2
!= null then
if $data
(2)[2]
!= null then
goto show2
return -1
endi
endi
if $data
2_3
!= 2 then
if $data
(3)[2]
!= 2 then
goto show2
return -1
endi
endi
if $data
2_4
!= 2 then
if $data
(4)[2]
!= 2 then
goto show2
return -1
endi
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step
sql create dnode $hostname5
print ========== step3
sql create dnode $hostname port 7500
system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode5 -s start
$x = 0
$x = 0
s
how3:
s
tep3:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 60 then
if $x == 10 then
return -1
print ====> dnode not ready!
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 openVnodes $data2_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 openVnodes $data2_4
print ===> $data30 $data31 $data32 $data33 $data34 $data35
print dnode5 openVnodes $data2_5
if $rows != 4 then
return -1
if $data2_1 != 0 then
endi
goto show3
if $data(1)[4] != ready then
goto step3
endi
if $data(3)[4] != ready then
goto step3
endi
if $data(4)[4] != ready then
goto step3
endi
if $data(5)[4] != ready then
goto step3
endi
endi
if $data2_2 != null then
goto show3
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
print dnode5 openVnodes $data(5)[2]
if $data(1)[2] != 1 then
return -1
endi
endi
if $data
2_3
!= 2 then
if $data
(3)[2]
!= 2 then
goto show3
return -1
endi
endi
if $data
2_4
!= 2 then
if $data
(4)[2]
!= 2 then
goto show3
return -1
endi
endi
if $data
2_5 != 2
then
if $data
(5)[2] != 1
then
goto show3
return -1
endi
endi
print ========== step4
print ========== step4
sql create database d3 replica 3
sql create database d3 replica 3
vgroups 1
sql create table d3.t3 (t timestamp, i int)
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+2s, 34)
...
@@ -175,97 +169,106 @@ sql insert into d3.t3 values(now+3s, 33)
...
@@ -175,97 +169,106 @@ sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql insert into d3.t3 values(now+5s, 31)
$x = 0
show4:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data(3)[2]
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data(4)[2]
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data(5)[2]
print dnode5 openVnodes $data2_5
if $data(1)[2] != 1 then
return -1
if $data2_1 != 0 then
goto show4
endi
if $data2_2 != null then
goto show4
endi
endi
if $data
2_3
!= 3 then
if $data
(3)[2]
!= 3 then
goto show4
return -1
endi
endi
if $data
2_4
!= 3 then
if $data
(4)[2]
!= 3 then
goto show4
return -1
endi
endi
if $data
2_5 != 3
then
if $data
(5)[2] != 2
then
goto show4
return -1
endi
endi
print ========== step5
print ========== step5
sql create dnode $hostname
6
sql create dnode $hostname
port 7600
system sh/exec.sh -n dnode6 -s start
system sh/exec.sh -n dnode6 -s start
$x = 0
$x = 0
s
how5:
s
tep5:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 20 then
if $x == 10 then
return -1
print ====> dnode not ready!
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode6 openVnodes $data2_6
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 openVnodes $data2_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 openVnodes $data2_4
print ===> $data30 $data31 $data32 $data33 $data34 $data35
print dnode5 openVnodes $data2_5
print ===> $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
if $data2_1 != 0 then
return -1
goto show5
endi
if $data(1)[4] != ready then
goto step5
endi
if $data(3)[4] != ready then
goto step5
endi
if $data(4)[4] != ready then
goto step5
endi
endi
if $data2_6 != 2 then
if $data(5)[4] != ready then
goto show5
goto step5
endi
if $data(6)[4] != ready then
goto step5
endi
endi
sleep 8000
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
print dnode5 openVnodes $data(5)[2]
print dnode5 openVnodes $data(6)[2]
if $data(1)[2] != 1 then
return -1
endi
if $data(3)[2] != 2 then
return -1
endi
if $data(4)[2] != 2 then
return -1
endi
if $data(5)[2] != 2 then
return -1
endi
if $data(6)[2] != 2 then
return -1
endi
print ========== step6
print ========== step6
sql drop dnode $hostname3
sql drop dnode 3
$x = 0
show6:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode6 openVnodes $data2_6
print dnode3 openVnodes $data(3)[2]
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data(4)[2]
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data(5)[2]
print dnode5 openVnodes $data2_5
print dnode5 openVnodes $data(6)[2]
if $data(1)[2] != 2 then
if $data2_1 != 0 then
return -1
goto show6
endi
endi
if $data
2_6 != 3
then
if $data
(3)[2] != null
then
goto show6
return -1
endi
endi
if $data
2_3 != null
then
if $data
(4)[2] != 2
then
goto show6
return -1
endi
endi
if $data
2_4
!= 3 then
if $data
(5)[2]
!= 3 then
goto show6
return -1
endi
endi
if $data
2_5 != 3
then
if $data
(6)[2] != 2
then
goto show6
return -1
endi
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
...
...
tests/script/
unique/dnode/remove1
.sim
→
tests/script/
tsim/dnode/balancex
.sim
浏览文件 @
286ec4ec
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
print ========== step1
print ========== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create database d1
sql create database d1
vgroups 1
sql create table d1.t1 (t timestamp, i int)
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+2s, 14)
...
@@ -32,7 +20,7 @@ sql insert into d1.t1 values(now+3s, 13)
...
@@ -32,7 +20,7 @@ sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2
sql create database d2
vgroups 1
sql create table d2.t2 (t timestamp, i int)
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+2s, 24)
...
@@ -41,36 +29,59 @@ sql insert into d2.t2 values(now+4s, 22)
...
@@ -41,36 +29,59 @@ sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data
2_1
print dnode1 openVnodes $data
(1)[2]
if $data
2_1
!= 2 then
if $data
(1)[2]
!= 2 then
return -1
return -1
endi
endi
print ========== step2
print ========== step2
sql create dnode $hostname2
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
$x = 0
step2:
step2:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 10 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 $data4_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 $data4_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print dnode3 $data4_3
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print dnode4 $data4_4
if $rows != 3 then
return -1
if $data4_1 != ready then
endi
if $data(1)[4] != ready then
goto step2
endi
if $data(2)[4] != ready then
goto step2
goto step2
endi
endi
if $data
4_2
!= ready then
if $data
(3)[4]
!= ready then
goto step2
goto step2
endi
endi
sql create database d3 replica 2
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode2 openVnodes $data(3)[2]
if $data(1)[2] != 0 then
return -1
endi
if $data(2)[2] != 1 then
return -1
endi
if $data(3)[2] != 1 then
return -1
endi
print ========== step3
sql create database d3 replica 3 vgroups 1
sql create table d3.t3 (t timestamp, i int)
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+2s, 34)
...
@@ -78,90 +89,96 @@ sql insert into d3.t3 values(now+3s, 33)
...
@@ -78,90 +89,96 @@ sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql insert into d3.t3 values(now+5s, 31)
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
if $data2_1 != 1 then
print dnode2 openVnodes $data(3)[2]
goto show2
if $data(1)[2] != 1 then
return -1
endi
if $data(2)[2] != 2 then
return -1
endi
endi
if $data
2_2 != 3
then
if $data
(3)[2] != 2
then
goto show2
return -1
endi
endi
print ========== step3
print ========== step3
sql create dnode $hostname port 7400
system sh/exec.sh -n dnode4 -s start
$x = 0
$x = 0
s
how3:
s
tep3:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 20 then
if $x == 10 then
return -1
print ====> dnode not ready!
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 openVnodes $data2_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ========== step4
print ===> $data30 $data31 $data32 $data33 $data34 $data35
sql create dnode $hostname3
if $rows != 4 then
system sh/exec.sh -n dnode3 -s start
return -1
sql drop dnode $hostname2
endi
if $data(1)[4] != ready then
goto step3
endi
if $data(2)[4] != ready then
goto step3
endi
if $data(3)[4] != ready then
goto step3
endi
if $data(4)[4] != ready then
goto step3
endi
$x = 0
sql balance vgroup
show4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data2_2
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data2_3
print dnode2 openVnodes $data(3)[2]
if $data2_2 != null then
print dnode2 openVnodes $data(4)[2]
goto show4
if $data(1)[2] != 0 then
return -1
endi
if $data(2)[2] != 2 then
return -1
endi
if $data(3)[2] != 2 then
return -1
endi
if $data(4)[2] != 1 then
return -1
endi
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step5
print ========== step5
sql create dnode $hostname4
sql drop dnode 2
system sh/exec.sh -n dnode4 -s start
$x = 0
show5:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
sql show dnodes
print dnode1 openVnodes $data
2_1
print dnode1 openVnodes $data
(1)[2]
print dnode2 openVnodes $data
2_2
print dnode2 openVnodes $data
(2)[2]
print dnode
3 openVnodes $data2_3
print dnode
2 openVnodes $data(3)[2]
print dnode
4 openVnodes $data2_4
print dnode
2 openVnodes $data(4)[2]
if $data
2_1 != 0
then
if $data
(1)[2] != 1
then
goto show5
return -1
endi
endi
if $data
2_2
!= null then
if $data
(2)[2]
!= null then
goto show5
return -1
endi
endi
if $data
2_3
!= 2 then
if $data
(3)[2]
!= 2 then
goto show5
return -1
endi
endi
if $data
2_4
!= 2 then
if $data
(4)[2]
!= 2 then
goto show5
return -1
endi
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sql reset query cache
sleep 100
print ========== step6
print ========== step6
sql select * from d1.t1 order by t desc
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
print $data01 $data11 $data21 $data31 $data41
...
@@ -224,4 +241,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT
...
@@ -224,4 +241,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/
unique/dnode/
reason.sim
→
tests/script/
tsim/dnode/offline_
reason.sim
浏览文件 @
286ec4ec
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
print ========== step1
print ========== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create dnode $hostname
2
sql create dnode $hostname
port 7200
sql show dnodes
sql show dnodes
print dnode1 off: $data7_1
print dnode1 off: $data(1)[6]
print dnode2 off: $data7_2
print dnode2 off: $data(2)[6]
if $data7_2 != @status not received@ then
if $data(2)[6] != @status not received@ then
return -1
return -1
endi
endi
...
@@ -19,26 +19,28 @@ print ========== step2
...
@@ -19,26 +19,28 @@ print ========== step2
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
$x = 0
$x = 0
step
1:
step
2:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 10 then
if $x == 10 then
print ====> dnode not ready!
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 $data4_1
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print dnode2 $data4_2
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
if $data4_1 != ready then
return -1
goto step1
endi
if $data(1)[4] != ready then
goto step2
endi
endi
if $data
4_2
!= ready then
if $data
(2)[4]
!= ready then
goto step
1
goto step
2
endi
endi
print ========== step3
print ========== step3
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode2 -s stop
$x = 0
$x = 0
step3:
step3:
...
@@ -48,30 +50,22 @@ step3:
...
@@ -48,30 +50,22 @@ step3:
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
print dnode1 off: $data
7_1
print dnode1 off: $data
(1)[6]
print dnode2 off: $data
7_2
print dnode2 off: $data
(2)[6]
if $data
7_2
!= @status msg timeout@ then
if $data
(2)[6]
!= @status msg timeout@ then
goto step3
goto step3
endi
endi
print ========== step4
print ========== step4
sql drop dnode $hostname2
sql drop dnode 2
$x = 0
step4:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
sql show dnodes
if $rows != 1 then
if $rows != 1 then
goto step4
return -1
endi
endi
print ========== step5
print ========== step5
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname
2
sql create dnode $hostname
port 7200
$x = 0
$x = 0
step5:
step5:
...
@@ -82,17 +76,17 @@ step5:
...
@@ -82,17 +76,17 @@ step5:
endi
endi
sql show dnodes
sql show dnodes
print dnode1 off: $data
7_1
print dnode1 off: $data
(1)[6]
print dnode2 off: $data
7_3
print dnode2 off: $data
(3)[6]
if $data
7_3
!= @dnodeId not match@ then
if $data
(3)[6]
!= @dnodeId not match@ then
goto step5
goto step5
endi
endi
print ========== step6
print ========== step6
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode4 -c
mnodeEqualVnodeNum -v 3
system sh/cfg.sh -n dnode4 -c
statusInterval -v 4
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname
4
sql create dnode $hostname
port 7400
$x = 0
$x = 0
step6:
step6:
...
@@ -103,17 +97,18 @@ step6:
...
@@ -103,17 +97,18 @@ step6:
endi
endi
sql show dnodes
sql show dnodes
print dnode1 off: $data7_1
print dnode1 off: $data(1)[6]
print dnode4 off: $data7_4
print dnode2 off: $data(3)[6]
if $data7_4 != @mnEqualVn not match@ then
print dnode3 off: $data(4)[6]
if $data(4)[6] != @interval not match@ then
goto step6
goto step6
endi
endi
print ========== step7
print ========== step7
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode5 -c
statusInterval -v 3
system sh/cfg.sh -n dnode5 -c
locale -v zn_CH.UTF-8
system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode5 -s start
sql create dnode $hostname
5
sql create dnode $hostname
port 7500
$x = 0
$x = 0
step7:
step7:
...
@@ -124,17 +119,19 @@ step7:
...
@@ -124,17 +119,19 @@ step7:
endi
endi
sql show dnodes
sql show dnodes
print dnode1 off: $data7_1
print dnode1 off: $data(1)[6]
print dnode5 off: $data7_5
print dnode3 off: $data(3)[6]
if $data7_5 != @interval not match@ then
print dnode4 off: $data(4)[6]
print dnode5 off: $data(5)[6]
if $data(5)[6] != @locale not match@ then
goto step7
goto step7
endi
endi
print ========== step8
print ========== step8
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode6 -c
balance -v 0
system sh/cfg.sh -n dnode6 -c
charset -v UTF-16
system sh/exec.sh -n dnode6 -s start
system sh/exec.sh -n dnode6 -s start
sql create dnode $hostname
6
sql create dnode $hostname
port 7600
$x = 0
$x = 0
step8:
step8:
...
@@ -145,54 +142,15 @@ step8:
...
@@ -145,54 +142,15 @@ step8:
endi
endi
sql show dnodes
sql show dnodes
print dnode1 off: $data7_1
print dnode1 off: $data(1)[6]
print dnode6 off: $data7_6
print dnode3 off: $data(3)[6]
if $data7_6 != @balance not match@ then
print dnode4 off: $data(4)[6]
print dnode5 off: $data(5)[6]
print dnode6 off: $data(6)[6]
if $data(6)[6] != @charset not match@ then
goto step8
goto step8
endi
endi
print ========== step9
system sh/deploy.sh -n dnode7 -i 7
system sh/cfg.sh -n dnode7 -c maxTablesPerVnode -v 3000
system sh/exec.sh -n dnode7 -s start
sql create dnode $hostname7
$x = 0
step9:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode7 off: $data7_7
if $data7_7 != @maxTabPerVn not match@ then
goto step9
endi
print ========== step10
system sh/deploy.sh -n dnode8 -i 8
system sh/cfg.sh -n dnode8 -c maxVgroupsPerDb -v 3
system sh/exec.sh -n dnode8 -s start
sql create dnode $hostname8
$x = 0
step10:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode8 off: $data7_8
if $data7_8 != @maxVgPerDb not match@ then
goto step10
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
...
...
tests/script/unique/dnode/alternativeRole.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c role -v 1
system sh/cfg.sh -n dnode2 -c role -v 2
system sh/cfg.sh -n dnode3 -c role -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 5000
sql show dnodes
print dnode1 $data5_1
print dnode1 $data5_2
print dnode1 $data5_3
if $data5_1 != mnode then
return -1
endi
if $data5_2 != vnode then
return -1
endi
if $data5_3 != any then
return -1
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
if $data2_1 != master then
return -1
endi
if $data2_2 != null then
return -1
endi
if $data2_3 != slave then
return -1
endi
print ========== step2
sql create database d1
sql create table d1.t1 (ts timestamp, i int)
sql create table d1.t2 (ts timestamp, i int)
sql create table d1.t3 (ts timestamp, i int)
sql create table d1.t4 (ts timestamp, i int)
sql create table d1.t5 (ts timestamp, i int)
sql create table d1.t6 (ts timestamp, i int)
sql create table d1.t7 (ts timestamp, i int)
sql create table d1.t8 (ts timestamp, i int)
sql show dnodes
print dnode1 $data2_1
print dnode2 $data2_2
print dnode3 $data2_3
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 1 then
return -1
endi
if $data2_3 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/balance2.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode5 -c wallevel -v 1
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql create database d1 replica 2
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2 replica 2
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+3s, 23)
sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 2 then
return -1
endi
if $data2_3 != 2 then
return -1
endi
print ========== step2
sql drop dnode $hostname2
$x = 0
show2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 2 then
goto show2
endi
if $data2_2 != null then
goto show2
endi
if $data2_3 != 2 then
goto show2
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step3
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
$x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
goto show3
endi
if $data2_2 != null then
goto show3
endi
if $data2_3 != 2 then
goto show3
endi
if $data2_4 != 2 then
goto show3
endi
print ========== step4
sql create database d3 replica 2
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
return -1
endi
if $data2_2 != null then
return -1
endi
if $data2_3 != 3 then
return -1
endi
if $data2_4 != 3 then
return -1
endi
print ========== step5
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
$x = 0
show5:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show5
endi
if $data2_2 != null then
goto show5
endi
if $data2_3 != 2 then
goto show5
endi
if $data2_4 != 2 then
goto show5
endi
if $data2_5 != 2 then
goto show5
endi
print ========== step6
sql drop dnode $hostname3
$x = 0
show6:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show6
endi
if $data2_2 != null then
goto show6
endi
if $data2_3 != null then
goto show6
endi
if $data2_4 != 3 then
goto show6
endi
if $data2_5 != 3 then
goto show6
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sql reset query cache
sleep 100
print ========== step7
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql select * from d2.t2 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql select * from d3.t3 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/balancex.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 2000
sql create database d1
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+3s, 23)
sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
print dnode1 openVnodes $data2_1
if $data2_1 != 2 then
return -1
endi
print ========== step2
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 0 then
goto show2
endi
if $data2_2 != 2 then
goto show2
endi
print ========== step3
sql create database d3 replica 2
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
$x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 1 then
goto show3
endi
if $data2_2 != 3 then
goto show3
endi
print ========== step3
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 0 then
goto show4
endi
if $data2_2 != 2 then
goto show4
endi
if $data2_3 != 2 then
goto show4
endi
print ========== step5
sql drop dnode $hostname2
$x = 0
show5:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 1 then
goto show5
endi
if $data2_2 != null then
goto show5
endi
if $data2_3 != 3 then
goto show5
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql reset query cache
sleep 1000
print ========== step6
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql select * from d2.t2 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql select * from d3.t3 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/m2.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
system sh/cfg.sh -n dnode4 -c balanceInterval -v 10
system sh/cfg.sh -n dnode5 -c balanceInterval -v 10
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
print ========== step2
sql create database d1 replica 2
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(now+1s, 15)
sql insert into d1.t1 values(now+2s, 14)
sql insert into d1.t1 values(now+3s, 13)
sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql create database d2 replica 2
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(now+1s, 25)
sql insert into d2.t2 values(now+2s, 24)
sql insert into d2.t2 values(now+3s, 23)
sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql create database d3 replica 2
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(now+1s, 35)
sql insert into d3.t3 values(now+2s, 34)
sql insert into d3.t3 values(now+3s, 33)
sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql create database d4 replica 2
sql create table d4.t4 (t timestamp, i int)
sql insert into d4.t4 values(now+1s, 45)
sql insert into d4.t4 values(now+2s, 44)
sql insert into d4.t4 values(now+3s, 43)
sql insert into d4.t4 values(now+4s, 42)
sql insert into d4.t4 values(now+5s, 41)
print ========== step2.1
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 4 then
return -1
endi
if $data2_3 != 4 then
return -1
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ========== step3
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
$x = 0
show3:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data2_5
if $data2_2 != 2 then
goto show3
endi
if $data2_3 != 2 then
goto show3
endi
if $data2_4 != 2 then
goto show3
endi
if $data2_5 != 2 then
goto show3
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show3
endi
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show3
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show3
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show3
endi
print ========== step4
sql drop dnode $hostname2
$x = 0
show4:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data2_5
if $data2_2 != null then
goto show4
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show4
endi
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show4
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show4
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show4
endi
sql reset query cache
sleep 100
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step5
sql drop dnode $hostname3
$x = 0
show5:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
print dnode5 openVnodes $data2_5
if $data2_2 != null then
goto show5
endi
if $data2_3 != null then
goto show5
endi
if $data2_4 != 4 then
goto show5
endi
if $data2_5 != 4 then
goto show4
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show5
endi
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show5
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show5
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 2 then
goto show5
endi
sql reset query cache
sleep 100
system sh/exec.sh -n dnode3 -s stop -x SIGINT
print ========== step6
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql select * from d2.t2 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql select * from d3.t3 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
sql select * from d4.t4 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 41 then
return -1
endi
if $data11 != 42 then
return -1
endi
if $data21 != 43 then
return -1
endi
if $data31 != 44 then
return -1
endi
if $data41 != 45 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/monitor_bug.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode2 -c monitor -v 0
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 3000
sql show dnodes
print dnode1 openVnodes $data2_1
if $data2_1 > 2 then
return -1
endi
print ========== step2
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 0 then
goto show2
endi
if $data2_2 > 2 then
goto show2
endi
print ========== step3
sql show log.tables
print $data00
print $data10
print $data20
print $data30
print $data40
print $data50
if $rows > 5 then
return -1
endi
print ========== step4
sql select * from log.dn1
print $rows
$rows1 = $rows
sleep 2000
sql select * from log.dn1
print $rows
$rows2 = $rows
if $rows2 <= $rows1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/offline1.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode1 -c balanceInterval -v 5
system sh/cfg.sh -n dnode2 -c balanceInterval -v 5
system sh/cfg.sh -n dnode3 -c balanceInterval -v 5
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 2000
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 != ready then
return -1
endi
print ========== step2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 8000
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 == ready then
return -1
endi
print ========== step3
sleep 10000
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 != null then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/offline2.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10
system sh/cfg.sh -n dnode1 -c balanceInterval -v 5
system sh/cfg.sh -n dnode2 -c balanceInterval -v 5
system sh/cfg.sh -n dnode3 -c balanceInterval -v 5
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 2000
sql create database d1 replica 2
sql create table d1.t1(ts timestamp, i int)
sql insert into d1.t1 values(1588262400001, 1)
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 != ready then
return -1
endi
print ========== step2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 8000
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 == ready then
return -1
endi
print ========== step3
sleep 10000
sql show dnodes
print dnode1 $data4_1
print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 != dropping then
return -1
endi
print ========== step4
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode2 -s start
sql drop dnode $hostname2
sleep 3000
$x = 0
show4:
$x = $x + 1
sleep 3000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto show4
endi
if $data4_2 != null then
goto show4
endi
if $data4_3 != ready then
goto show4
endi
print ======================== step5
sql reset query cache
sleep 1000
sql select * from d1.t1
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/offline3.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode2 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode3 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode4 -c offlineThreshold -v 3
system sh/cfg.sh -n dnode1 -c balanceInterval -v 300
system sh/cfg.sh -n dnode2 -c balanceInterval -v 300
system sh/cfg.sh -n dnode3 -c balanceInterval -v 300
system sh/cfg.sh -n dnode4 -c balanceInterval -v 300
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
if $data4_4 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
if $data2_1 != master then
goto step1
endi
print ========== step2
sql create database db replica 3
sql use db
sql create table tb (ts timestamp, value int)
sql insert into tb values (now, 1)
sql insert into tb values (now, 2)
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ========== step2
system sh/exec.sh -n dnode4 -s stop -x SIGINT
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show vgroups;
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step2
endi
if $data4_2 != ready then
goto step2
endi
if $data4_3 != ready then
goto step2
endi
if $data4_4 != null then
goto step2
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/dnode/remove2.sim
已删除
100644 → 0
浏览文件 @
a7a5dac1
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database d1
sql create table d1.t1 (t timestamp, i int)
sql insert into d1.t1 values(1588262400001, 15)
sql insert into d1.t1 values(1588262400002, 14)
sql insert into d1.t1 values(1588262400003, 13)
sql insert into d1.t1 values(1588262400004, 12)
sql insert into d1.t1 values(1588262400005, 11)
sql create database d2
sql create table d2.t2 (t timestamp, i int)
sql insert into d2.t2 values(1588262400001, 25)
sql insert into d2.t2 values(1588262400002, 24)
sql insert into d2.t2 values(1588262400003, 23)
sql insert into d2.t2 values(1588262400004, 22)
sql insert into d2.t2 values(1588262400005, 21)
sql show dnodes
print dnode1 openVnodes $data2_1
if $data2_1 != 2 then
return -1
endi
print ========== step2
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step2
endi
if $data4_2 != ready then
goto step2
endi
sql create database d3 replica 2
sql create table d3.t3 (t timestamp, i int)
sql insert into d3.t3 values(1588262400001, 35)
sql insert into d3.t3 values(1588262400002, 34)
sql insert into d3.t3 values(1588262400003, 33)
sql insert into d3.t3 values(1588262400004, 32)
sql insert into d3.t3 values(1588262400005, 31)
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 1 then
goto show2
endi
if $data2_2 != 3 then
goto show2
endi
print ========== step3
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print ========== step4
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
$x = 0
step4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
# wait dnode3 create first vgroup in dnode-status msg
if $data2_3 != 1 then
goto step4
endi
print ============ step 4.1
system sh/exec.sh -n dnode2 -s start
$x = 0
step4.1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_2 != ready then
goto step4.1
endi
sql drop dnode $hostname2
$x = 0
show4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_1 != 1 then
goto show4
endi
if $data2_2 != null then
goto show4
endi
if $data2_3 != 3 then
goto show4
endi
print ========== step5
sql select * from d1.t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
sql select * from d2.t2 order by t desc
print $data01 $data11 $data21 $data31 $data41
sql select * from d3.t3 order by t desc
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录