Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e27381a5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e27381a5
编写于
6月 28, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
6月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14325 from taosdata/fix/tsim
test: case for replica3 db
上级
b0b9b013
98e81746
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
1212 addition
and
1274 deletion
+1212
-1274
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+7
-0
tests/script/tsim/dnode/balance3.sim
tests/script/tsim/dnode/balance3.sim
+60
-6
tests/script/tsim/vnode/back_insert.sim
tests/script/tsim/vnode/back_insert.sim
+0
-0
tests/script/tsim/vnode/back_insert_many.sim
tests/script/tsim/vnode/back_insert_many.sim
+0
-0
tests/script/tsim/vnode/replica3_basic.sim
tests/script/tsim/vnode/replica3_basic.sim
+368
-0
tests/script/tsim/vnode/replica3_import.sim
tests/script/tsim/vnode/replica3_import.sim
+338
-0
tests/script/tsim/vnode/replica3_many.sim
tests/script/tsim/vnode/replica3_many.sim
+262
-0
tests/script/tsim/vnode/replica3_repeat.sim
tests/script/tsim/vnode/replica3_repeat.sim
+48
-41
tests/script/tsim/vnode/replica3_vgroup.sim
tests/script/tsim/vnode/replica3_vgroup.sim
+129
-0
tests/script/unique/import/replica2.sim
tests/script/unique/import/replica2.sim
+0
-300
tests/script/unique/import/testSuite.sim
tests/script/unique/import/testSuite.sim
+0
-2
tests/script/unique/vnode/backup/replica4.sim
tests/script/unique/vnode/backup/replica4.sim
+0
-220
tests/script/unique/vnode/backup/replica5.sim
tests/script/unique/vnode/backup/replica5.sim
+0
-263
tests/script/unique/vnode/replica2_a_large.sim
tests/script/unique/vnode/replica2_a_large.sim
+0
-103
tests/script/unique/vnode/replica2_basic2.sim
tests/script/unique/vnode/replica2_basic2.sim
+0
-223
tests/script/unique/vnode/replica2_repeat.sim
tests/script/unique/vnode/replica2_repeat.sim
+0
-110
tests/script/unique/vnode/testSuite.sim
tests/script/unique/vnode/testSuite.sim
+0
-6
未找到文件。
tests/script/jenkins/basic.txt
浏览文件 @
e27381a5
...
@@ -162,6 +162,13 @@
...
@@ -162,6 +162,13 @@
# --- valgrind
# --- valgrind
./test.sh -f tsim/valgrind/checkError.sim -v
./test.sh -f tsim/valgrind/checkError.sim -v
# --- vnode
#./test.sh -f tsim/vnode/replica3_basic.sim
#./test.sh -f tsim/vnode/replica3_repeat.sim
./test.sh -f tsim/vnode/replica3_vgroup.sim
#./test.sh -f tsim/vnode/replica3_many.sim
#./test.sh -f tsim/vnode/replica3_import.sim
# --- sync
# --- sync
./test.sh -f tsim/sync/3Replica1VgElect.sim
./test.sh -f tsim/sync/3Replica1VgElect.sim
./test.sh -f tsim/sync/3Replica5VgElect.sim
./test.sh -f tsim/sync/3Replica5VgElect.sim
...
...
tests/script/tsim/dnode/balance3.sim
浏览文件 @
e27381a5
...
@@ -24,7 +24,7 @@ system sh/exec.sh -n dnode3 -s start
...
@@ -24,7 +24,7 @@ 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
0
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 10 then
if $x == 10 then
...
@@ -40,19 +40,74 @@ if $rows != 4 then
...
@@ -40,19 +40,74 @@ if $rows != 4 then
return -1
return -1
endi
endi
if $data(1)[4] != ready then
if $data(1)[4] != ready then
goto step1
goto step1
0
endi
endi
if $data(2)[4] != ready then
if $data(2)[4] != ready then
goto step1
goto step1
0
endi
endi
if $data(3)[4] != ready then
if $data(3)[4] != ready then
goto step1
goto step1
0
endi
endi
if $data(4)[4] != ready then
if $data(4)[4] != ready then
goto step1
goto step1
0
endi
endi
sql create database d1 replica 3 vgroups 1
sql create database d1 replica 3 vgroups 1
$x = 0
step11:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show d1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $rows != 1 then
return -1
endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step11
endi
sql create database d2 replica 3 vgroups 1
$x = 0
step12:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> d2 not ready!
return -1
endi
sql show d2.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $rows != 1 then
return -1
endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step12
endi
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)
...
@@ -60,7 +115,6 @@ sql insert into d1.t1 values(now+3s, 13)
...
@@ -60,7 +115,6 @@ 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 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)
...
...
tests/script/
unique
/vnode/back_insert.sim
→
tests/script/
tsim
/vnode/back_insert.sim
浏览文件 @
e27381a5
文件已移动
tests/script/
unique
/vnode/back_insert_many.sim
→
tests/script/
tsim
/vnode/back_insert_many.sim
浏览文件 @
e27381a5
文件已移动
tests/script/
unique
/vnode/replica3_basic.sim
→
tests/script/
tsim
/vnode/replica3_basic.sim
浏览文件 @
e27381a5
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/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 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
print ========== step0
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 $hostname3
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
system sh/exec.sh -n dnode3 -s start
$x = 0
$x = 0
step
1:
step
01:
$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
if $rows != 3 then
if $data4_1 != ready then
return -1
goto step1
endi
endi
if $data
4_2
!= ready then
if $data
(1)[4]
!= ready then
goto step1
goto step
0
1
endi
endi
if $data4_3 != ready then
if $data(2)[4] != ready then
goto step1
goto step01
endi
if $data(3)[4] != ready then
goto step01
endi
endi
sql create mnode on dnode 2
sql create mnode on dnode 3
$x = 0
step02:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show mnodes
sql show mnodes
print mnode1 $data2_1
print $data(1)[0] $data(1)[1] $data(1)[2]
print mnode1 $data2_2
print $data(2)[0] $data(2)[1] $data(2)[2]
print mnode1 $data2_3
print $data(3)[0] $data(3)[1] $data(3)[2]
if $data2_1 != master then
goto step1
if $rows != 3 then
return -1
endi
endi
if $data
2_2 != slave then
if $data
(1)[0] != 1 then
goto step
1
return -
1
endi
endi
if $data2_3 != slave then
if $data(1)[2] != leader then
goto step1
return -1
endi
if $data(2)[0] != 2 then
return -1
endi
if $data(2)[2] != follower then
goto step02
endi
if $data(3)[0] != 3 then
return -1
endi
if $data(3)[2] != follower then
goto step02
endi
endi
$N = 10
$N = 10
...
@@ -59,13 +79,37 @@ $table = table_r3
...
@@ -59,13 +79,37 @@ $table = table_r3
$db = db1
$db = db1
print =================== step 1
print =================== step 1
sql create database $db replica 3 vgroups 1
sql use $db
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups -x step1
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step1
endi
sql create database $db replica 3
sql use $db
sql use $db
sql create table $table (ts timestamp, speed int)
sql create table $table (ts timestamp, speed int)
sleep 3001
print =================== step
2
print =================== step2
$x = 1
$x = 1
$y = $x + $N
$y = $x + $N
$expect = $N
$expect = $N
...
@@ -81,9 +125,32 @@ if $rows != $expect then
...
@@ -81,9 +125,32 @@ if $rows != $expect then
return -1
return -1
endi
endi
print =================== step
3
print =================== step3
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode2 -s stop
sleep 2000
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups -x step3
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step3
endi
$y = $x + $N
$y = $x + $N
$expect = $N * 2
$expect = $N * 2
while $x < $y
while $x < $y
...
@@ -92,26 +159,34 @@ while $x < $y
...
@@ -92,26 +159,34 @@ while $x < $y
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#
if $rows != $expect then
return -1
#
return -1
endi
#
endi
print =================== step
4
print =================== step4
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
$x = 0
$x = 0
step4:
step4:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups -x step4
sql show db1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print online vnodes $data03
$leaderExist = 0
if $data03 != 3 then
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step4
goto step4
endi
endi
...
@@ -125,12 +200,36 @@ endw
...
@@ -125,12 +200,36 @@ endw
sql select * from $table
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#if $rows != $expect then
# return -1
#endi
print =================== step5
system sh/exec.sh -n dnode3 -s stop
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
sql show vgroups -x step5
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step5
endi
endi
print =================== step 5
system sh/exec.sh -n dnode3 -s stop
$y = $x + $N
$y = $x + $N
$expect = $N * 4
$expect = $N * 4
while $x < $y
while $x < $y
...
@@ -141,24 +240,33 @@ endw
...
@@ -141,24 +240,33 @@ endw
sql select * from $table
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#
if $rows != $expect then
return -1
#
return -1
endi
#
endi
print =================== step
6
print =================== step6
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
$x = 0
step6:
step6:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups -x step6
sql show db1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print online vnodes $data03
$leaderExist = 0
if $data03 != 3 then
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step6
goto step6
endi
endi
...
@@ -172,12 +280,36 @@ endw
...
@@ -172,12 +280,36 @@ endw
sql select * from $table
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#if $rows != $expect then
return -1
#
return -1
endi
#
endi
print =================== step
7
print =================== step7
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode1 -s stop
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups -x step7
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step7
endi
$y = $x + $N
$y = $x + $N
$expect = $N * 6
$expect = $N * 6
while $x < $y
while $x < $y
...
@@ -188,24 +320,33 @@ endw
...
@@ -188,24 +320,33 @@ endw
sql select * from $table
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#if $rows != $expect then
return -1
#
return -1
endi
#
endi
print =================== step 8
print =================== step 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$x = 0
$x = 0
step8:
step8:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups -x step8
sql show db1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print online vnodes $data03
$leaderExist = 0
if $data03 != 3 then
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step8
goto step8
endi
endi
...
@@ -217,17 +358,11 @@ while $x < $y
...
@@ -217,17 +358,11 @@ while $x < $y
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from $table
print sql select * from $table -> $rows points
print sql select * from $table -> $rows points
if $rows != $expect then
#
if $rows != $expect then
return -1
#
return -1
endi
#
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
\ No newline at end of file
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/import/replica3
.sim
→
tests/script/
tsim/vnode/replica3_import
.sim
浏览文件 @
e27381a5
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/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode6 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
print ========== step1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
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
print ========= start dnode1
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 $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
$x = 0
$x = 0
step
1:
step
a:
$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
goto step1
endi
endi
if $data
4_2
!= ready then
if $data
(1)[4]
!= ready then
goto step
1
goto step
a
endi
endi
if $data4_3 != ready then
if $data(2)[4] != ready then
goto step1
goto stepa
endi
if $data(3)[4] != ready then
goto stepa
endi
if $data(4)[4] != ready then
goto stepa
endi
endi
sql create database ir3db replica 3 duration 7
sql create database ir3db replica 3 duration 7
vgroups 1
sql use ir3db
sql use ir3db
$x = 0
stepb:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $rows != 1 then
return -1
endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto stepb
endi
sql create table tb(ts timestamp, i bigint)
sql create table tb(ts timestamp, i bigint)
print ================= step1
print ================= step1
sql i
mpo
rt into tb values(1520000010000, 1520000010000)
sql i
nse
rt into tb values(1520000010000, 1520000010000)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 1 then
if $rows != 1 then
...
@@ -87,9 +108,9 @@ if $rows != 3 then
...
@@ -87,9 +108,9 @@ if $rows != 3 then
endi
endi
print ================= step4
print ================= step4
sql i
mpo
rt into tb values(1520000009000, 1520000009000)
sql i
nse
rt into tb values(1520000009000, 1520000009000)
sql i
mpo
rt into tb values(1520000015000, 1520000015000)
sql i
nse
rt into tb values(1520000015000, 1520000015000)
sql i
mpo
rt into tb values(1520000030000, 1520000030000)
sql i
nse
rt into tb values(1520000030000, 1520000030000)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 6 then
if $rows != 6 then
...
@@ -108,44 +129,50 @@ if $rows != 9 then
...
@@ -108,44 +129,50 @@ if $rows != 9 then
endi
endi
print ================= step6
print ================= step6
sql i
mpo
rt into tb values(1520000007000, 1520000007000)
sql i
nse
rt into tb values(1520000007000, 1520000007000)
sql i
mpo
rt into tb values(1520000012000, 1520000012000)
sql i
nse
rt into tb values(1520000012000, 1520000012000)
sql i
mpo
rt into tb values(1520000023000, 1520000023000)
sql i
nse
rt into tb values(1520000023000, 1520000023000)
sql i
mpo
rt into tb values(1520000034000, 1520000034000)
sql i
nse
rt into tb values(1520000034000, 1520000034000)
sql i
mpo
rt into tb values(1520000050000, 1520000050000)
sql i
nse
rt into tb values(1520000050000, 1520000050000)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 14 then
if $rows != 14 then
return -1
return -1
endi
endi
print ==================
dnode restart
print ==================
step7
system sh/exec.sh -n dnode
1
-s stop -x SIGINT
system sh/exec.sh -n dnode
2
-s stop -x SIGINT
system sh/exec.sh -n dnode
1
-s start
system sh/exec.sh -n dnode
2
-s start
$x = 0
$x = 0
a4:
step7:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups
sql show vgroups -x step7
print online vnodes $data03
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 3 then
$leaderExist = 0
goto a4
if $data(2)[4] == leader then
$leaderExist = 1
endi
endi
if $data(2)[6] == leader then
sql select * from tb;
$leaderExist = 1
if $rows != 14 then
endi
return -1
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step7
endi
endi
print ================= step7
print ================= step7
sql i
mpo
rt into tb values(1520000007001, 1520000007001)
sql i
nse
rt into tb values(1520000007001, 1520000007001)
sql i
mpo
rt into tb values(1520000012001, 1520000012001)
sql i
nse
rt into tb values(1520000012001, 1520000012001)
sql i
mpo
rt into tb values(1520000023001, 1520000023001)
sql i
nse
rt into tb values(1520000023001, 1520000023001)
sql i
mpo
rt into tb values(1520000034001, 1520000034001)
sql i
nse
rt into tb values(1520000034001, 1520000034001)
sql i
mpo
rt into tb values(1520000050001, 1520000050001)
sql i
nse
rt into tb values(1520000050001, 1520000050001)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 19 then
if $rows != 19 then
...
@@ -165,32 +192,18 @@ if $rows != 23 then
...
@@ -165,32 +192,18 @@ if $rows != 23 then
endi
endi
print ================= step9
print ================= step9
#1520000000000
sql insert into tb values(1517408000000, 1517408000000)
#sql import into tb values(now-30d, 7003)
sql insert into tb values(1518272000000, 1518272000000)
#sql import into tb values(now-20d, 34003)
sql insert into tb values(1519136000000, 1519136000000)
#sql import into tb values(now-10d, 34003)
sql insert into tb values(1519568000000, 1519568000000)
#sql import into tb values(now-5d, 34003)
sql insert into tb values(1519654400000, 1519654400000)
#sql import into tb values(now+1d, 50001)
sql insert into tb values(1519827200000, 1519827200000)
#sql import into tb values(now+2d, 50001)
sql insert into tb values(1520345600000, 1520345600000)
#sql import into tb values(now+6d, 50001)
sql insert into tb values(1520691200000, 1520691200000)
#sql import into tb values(now+8d, 50002)
sql insert into tb values(1520864000000, 1520864000000)
#sql import into tb values(now+10d, 50003)
sql insert into tb values(1521900800000, 1521900800000)
#sql import into tb values(now+12d, 50004)
sql insert into tb values(1523110400000, 1523110400000)
#sql import into tb values(now+14d, 50001)
sql insert into tb values(1521382400000, 1521382400000)
#sql import into tb values(now+16d, 500051)
sql import into tb values(1517408000000, 1517408000000)
sql import into tb values(1518272000000, 1518272000000)
sql import into tb values(1519136000000, 1519136000000)
sql import into tb values(1519568000000, 1519568000000)
sql import into tb values(1519654400000, 1519654400000)
sql import into tb values(1519827200000, 1519827200000)
sql import into tb values(1520345600000, 1520345600000)
sql import into tb values(1520691200000, 1520691200000)
sql import into tb values(1520864000000, 1520864000000)
sql import into tb values(1521900800000, 1521900800000)
sql import into tb values(1523110400000, 1523110400000)
sql import into tb values(1521382400000, 1521382400000)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 35 then
if $rows != 35 then
...
@@ -198,19 +211,29 @@ if $rows != 35 then
...
@@ -198,19 +211,29 @@ if $rows != 35 then
endi
endi
print ================= step10
print ================= step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
$x = 0
step10:
step10:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups
sql show vgroups -x step10
print online vnodes $data03
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 3 then
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step10
goto step10
endi
endi
...
@@ -221,18 +244,14 @@ if $rows != 35 then
...
@@ -221,18 +244,14 @@ if $rows != 35 then
endi
endi
print ================= step11
print ================= step11
sql insert into tb values(1515680000000, 1) (1515852800000, 2) (1516025600000, 3) (1516198400000, 4) (1516371200000, 5)
#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003)
sql import into tb values(1515680000000, 1) (1515852800000, 2) (1516025600000, 3) (1516198400000, 4) (1516371200000, 5)
sql select * from tb;
sql select * from tb;
if $rows != 40 then
if $rows != 40 then
return -1
return -1
endi
endi
print ================= step12
print ================= step12
#1520000000000
sql insert into tb values(1518358400000, 6) (1518444800000, 7) (1518531200000, 8) (1518617600000, 9) (1518704000000, 10) (1518790400000, 11) (1518876800000, 12) (1518963200000, 13) (1519049600000, 14)
#sql import into tb values(now-19d, -19) (now-18d, -18) (now-17d, -17) (now-16d, -16) (now-15d, -15) (now-14d, -14) (now-13d, -13) (now-12d, -12) (now-11d, -11)
sql import into tb values(1518358400000, 6) (1518444800000, 7) (1518531200000, 8) (1518617600000, 9) (1518704000000, 10) (1518790400000, 11) (1518876800000, 12) (1518963200000, 13) (1519049600000, 14)
sql select * from tb;
sql select * from tb;
print $rows
print $rows
if $rows != 49 then
if $rows != 49 then
...
@@ -240,22 +259,39 @@ if $rows != 49 then
...
@@ -240,22 +259,39 @@ if $rows != 49 then
endi
endi
print ================= step13
print ================= step13
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode2 -s start
$x = 0
sleep 3000
step13:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups -x step13
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step13
endi
print ================= step14
print ================= step14
#1520000000000
sql insert into tb values(1515852800001, -48)
#sql import into tb values(now-48d, -48)
sql insert into tb values(1516716800000, -38)
#sql import into tb values(now-38d, -38)
sql insert into tb values(1517580800000, -28)
#sql import into tb values(now-28d, -28)
sql import into tb values(1515852800001, -48)
sql import into tb values(1516716800000, -38)
sql import into tb values(1517580800000, -28)
sql select * from tb;
sql select * from tb;
print $rows
if $rows != 52 then
if $rows != 52 then
return -1
return -1
endi
endi
...
@@ -267,12 +303,23 @@ $x = 0
...
@@ -267,12 +303,23 @@ $x = 0
step15:
step15:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 60 then
print ====> db not ready!
return -1
return -1
endi
endi
sql show vgroups
sql show vgroups -x step15
print online vnodes $data03
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data03 != 3 then
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step15
goto step15
endi
endi
...
...
tests/script/
unique/vnode/
many.sim
→
tests/script/
tsim/vnode/replica3_
many.sim
浏览文件 @
e27381a5
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 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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
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/exec.sh -n dnode1 -s start
print ========== step0
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
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
$x = 0
$x = 0
step
1:
step
0:
$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
return -1
endi
if $data(1)[4] != ready then
goto step0
endi
if $data(2)[4] != ready then
goto step0
endi
if $data(3)[4] != ready then
goto step0
endi
if $data(4)[4] != ready then
goto step0
endi
print ========= step1
sql create database db1 replica 3 vgroups 1
sql create database db2 replica 3 vgroups 1
sql create database db3 replica 3 vgroups 1
sql create database db4 replica 3 vgroups 1
if $data4_1 != ready then
print =============== step12 wait vgroup2
goto step1
$x = 0
step12:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show d1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39
if $rows != 4 then
return -1
endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
endi
if $data
4_2 != ready
then
if $data
(2)[6] == leader
then
goto step
1
$leaderExist =
1
endi
endi
if $data4_3 != ready then
if $data(2)[8] == leader then
goto step1
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step12
endi
endi
sql show mnodes
print =============== step13 wait vgroup3
print mnode1 $data2_1
$x = 0
print mnode1 $data2_2
step13:
print mnode1 $data2_3
$x = $x + 1
if $data2_1 != master then
sleep 1000
goto step1
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show d1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39
if $rows != 4 then
return -1
endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step13
endi
endi
print ========= step1
print =============== step14 wait vgroup4
sql create database db1 replica 2
$x = 0
sql create database db2 replica 2
step14:
sql create database db3 replica 2
$x = $x + 1
sql create database db4 replica 2
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show d1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39
if $rows != 4 then
return -1
endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step14
endi
print =============== step15 wait vgroup5
$x = 0
step15:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show d1.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29
print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39
if $rows != 4 then
return -1
endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step15
endi
print =============== step16: create table
sql create table db1.tb1 (ts timestamp, i int)
sql create table db1.tb1 (ts timestamp, i int)
sql create table db2.tb2 (ts timestamp, i int)
sql create table db2.tb2 (ts timestamp, i int)
sql create table db3.tb3 (ts timestamp, i int)
sql create table db3.tb3 (ts timestamp, i int)
...
@@ -79,14 +190,18 @@ sql select count(*) from db4.tb4
...
@@ -79,14 +190,18 @@ sql select count(*) from db4.tb4
$lastRows4 = $rows
$lastRows4 = $rows
print ======== step2
print ======== step2
run_back
unique
/vnode/back_insert_many.sim
run_back
tsim
/vnode/back_insert_many.sim
sleep 3000
sleep 3000
print ======== step3
$x = 0
$x = 0
loop:
loop:
print ======== step3
system sh/exec.sh -n dnode2 -s stop
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
print ======== step4
print ======== step4
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode3 -s stop
sleep 3000
sleep 3000
...
...
tests/script/
unique
/vnode/replica3_repeat.sim
→
tests/script/
tsim
/vnode/replica3_repeat.sim
浏览文件 @
e27381a5
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 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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
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 ========== step0
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 $hostname3
sql create dnode $hostname port 7200
sql create dnode $hostname4
sql create dnode $hostname port 7300
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
step
1:
step
0:
$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
goto step1
endi
endi
if $data
4_2
!= ready then
if $data
(1)[4]
!= ready then
goto step
1
goto step
0
endi
endi
if $data
4_3
!= ready then
if $data
(2)[4]
!= ready then
goto step
1
goto step
0
endi
endi
if $data4_4 != ready then
if $data(3)[4] != ready then
goto step1
goto step0
endi
if $data(4)[4] != ready then
goto step0
endi
endi
sql show mnodes
print ========= step1
print mnode1 $data2_1
sql create database db replica 3 vgroups 1
print mnode1 $data2_2
$x = 0
print mnode1 $data2_3
step1:
if $data2_1 != master then
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show db.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $rows != 4 then
return -1
endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step1
goto step1
endi
endi
print ========= step1
sql create database db replica 3
sql create table db.tb (ts timestamp, i int)
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql insert into db.tb values(now, 1)
sql select count(*) from db.tb
sql select count(*) from db.tb
$lastRows = $rows
$lastRows = $rows
print ======== step2
print ======== step2
run_back
unique
/vnode/back_insert.sim
run_back
tsim
/vnode/back_insert.sim
sleep 2000
sleep 2000
print ======== step3
print ======== step3
...
...
tests/script/
unique
/vnode/replica3_vgroup.sim
→
tests/script/
tsim
/vnode/replica3_vgroup.sim
浏览文件 @
e27381a5
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/cfg.sh -n dnode1 -c wallevel -v 2
system sh/deploy.sh -n dnode4 -i 4
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 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
print ========== step0
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 $hostname3
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
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
sleep 2000
system sh/exec.sh -n dnode4 -s start
$x = 0
step0:
$x = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data30 $data31 $data32 $data33 $data34 $data35
if $rows != 4 then
return -1
endi
if $data(1)[4] != ready then
goto step0
endi
if $data(2)[4] != ready then
goto step0
endi
if $data(3)[4] != ready then
goto step0
endi
if $data(4)[4] != ready then
goto step0
endi
$N = 10
$N = 10
$table = table_r3
$table = table_r3
$db = db1
$db = db1
sleep 2000
print =================== step 1
print =================== step 1
sql create database $db replica 3 vgroups 2
sql create database $db replica 3
sql use $db
sql use $db
sql create table st (ts timestamp, speed int) tags (t1 int)
sleep 3001
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 60 then
print ====> db not ready!
return -1
endi
sql show vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19
if $rows != 2 then
return -1
endi
$leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step1
endi
$leaderExist = 0
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
goto step1
endi
sql create table st (ts timestamp, speed int) tags (t1 int)
$tbPre = m
$tbPre = m
$N = 300
$N = 300
...
@@ -44,8 +107,7 @@ while $x < $y
...
@@ -44,8 +107,7 @@ while $x < $y
$x = $x + 1
$x = $x + 1
endw
endw
#print =================== step2
#print =================== step 2
$x = -500
$x = -500
$y = $x + $N
$y = $x + $N
while $x < $y
while $x < $y
...
@@ -65,7 +127,3 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
@@ -65,7 +127,3 @@ 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
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
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/import/replica2.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
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
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -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
sql create database ir2db replica 2 duration 7
sql use ir2db
sql create table tb(ts timestamp, i bigint)
print ================= step1
sql import into tb values(1520000010000, 1520000010000)
sql select * from tb;
print $rows
if $rows != 1 then
return -1
endi
print ================= step2
sql insert into tb values(1520000008000, 1520000008000)
print $rows
sql select * from tb;
if $rows != 2 then
return -1
endi
print ================= step3
sql insert into tb values(1520000020000, 1520000020000)
sql select * from tb;
print $rows
if $rows != 3 then
return -1
endi
print ================= step4
sql import into tb values(1520000009000, 1520000009000)
sql import into tb values(1520000015000, 1520000015000)
sql import into tb values(1520000030000, 1520000030000)
sql select * from tb;
print $rows
if $rows != 6 then
return -1
endi
print ================= step5
sql insert into tb values(1520000008000, 1520000008000)
sql insert into tb values(1520000014000, 1520000014000)
sql insert into tb values(1520000025000, 1520000025000)
sql insert into tb values(1520000040000, 1520000040000)
sql select * from tb;
print $rows
if $rows != 9 then
return -1
endi
print ================= step6
sql import into tb values(1520000007000, 1520000007000)
sql import into tb values(1520000012000, 1520000012000)
sql import into tb values(1520000023000, 1520000023000)
sql import into tb values(1520000034000, 1520000034000)
sql import into tb values(1520000050000, 1520000050000)
sql select * from tb;
print $rows
if $rows != 14 then
return -1
endi
print ================== dnode restart
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql select * from tb;
if $rows != 14 then
return -1
endi
print ================= step7
sql import into tb values(1520000007001, 1520000007001)
sql import into tb values(1520000012001, 1520000012001)
sql import into tb values(1520000023001, 1520000023001)
sql import into tb values(1520000034001, 1520000034001)
sql import into tb values(1520000050001, 1520000050001)
sql select * from tb;
print $rows
if $rows != 19 then
print expect 19, actual: $rows
return -1
endi
print ================= step8
sql insert into tb values(1520000008002, 1520000008002)
sql insert into tb values(1520000014002, 1520000014002)
sql insert into tb values(1520000025002, 1520000025002)
sql insert into tb values(1520000060000, 1520000060000)
sql select * from tb;
print $rows
if $rows != 23 then
return -1
endi
print ================= step9
#1520000000000
#sql import into tb values(now-30d, 7003)
#sql import into tb values(now-20d, 34003)
#sql import into tb values(now-10d, 34003)
#sql import into tb values(now-5d, 34003)
#sql import into tb values(now+1d, 50001)
#sql import into tb values(now+2d, 50001)
#sql import into tb values(now+6d, 50001)
#sql import into tb values(now+8d, 50002)
#sql import into tb values(now+10d, 50003)
#sql import into tb values(now+12d, 50004)
#sql import into tb values(now+14d, 50001)
#sql import into tb values(now+16d, 500051)
sql import into tb values(1517408000000, 1517408000000)
sql import into tb values(1518272000000, 1518272000000)
sql import into tb values(1519136000000, 1519136000000)
sql import into tb values(1519568000000, 1519568000000)
sql import into tb values(1519654400000, 1519654400000)
sql import into tb values(1519827200000, 1519827200000)
sql import into tb values(1520345600000, 1520345600000)
sql import into tb values(1520691200000, 1520691200000)
sql import into tb values(1520864000000, 1520864000000)
sql import into tb values(1521900800000, 1521900800000)
sql import into tb values(1523110400000, 1523110400000)
sql import into tb values(1521382400000, 1521382400000)
sql select * from tb;
print $rows
if $rows != 35 then
return -1
endi
print ================= step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$x = 0
a2:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a2
endi
sql select * from tb;
print $rows
if $rows != 35 then
return -1
endi
print ================= step11
#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003)
sql import into tb values(1515680000000, 1) (1515852800000, 2) (1516025600000, 3) (1516198400000, 4) (1516371200000, 5)
sql select * from tb;
if $rows != 40 then
return -1
endi
print ================= step12
#1520000000000
#sql import into tb values(now-19d, -19) (now-18d, -18) (now-17d, -17) (now-16d, -16) (now-15d, -15) (now-14d, -14) (now-13d, -13) (now-12d, -12) (now-11d, -11)
sql import into tb values(1518358400000, 6) (1518444800000, 7) (1518531200000, 8) (1518617600000, 9) (1518704000000, 10) (1518790400000, 11) (1518876800000, 12) (1518963200000, 13) (1519049600000, 14)
sql select * from tb;
print $rows
if $rows != 49 then
return -1
endi
print ================= step13
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s start
$x = 0
a3:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a3
endi
print ================= step14
#1520000000000
#sql import into tb values(now-48d, -48)
#sql import into tb values(now-38d, -38)
#sql import into tb values(now-28d, -28)
sql import into tb values(1515852800001, -48)
sql import into tb values(1516716800000, -38)
sql import into tb values(1517580800000, -28)
sql select * from tb;
if $rows != 52 then
return -1
endi
print ================= step15
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$x = 0
a4:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a4
endi
sql select * from tb;
if $rows != 52 then
goto a4
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/import/testSuite.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
run unique/import/replica2.sim
run unique/import/replica3.sim
\ No newline at end of file
tests/script/unique/vnode/backup/replica4.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 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/exec.sh -n dnode1 -s start
$x = 0
connectTbase:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql connect -x connectTbase
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
sleep 3001
$N = 10
$table = table_r4
$db = db1
print =================== step 1
$x = 0
created:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create database $db replica 4 -x created
sql use $db
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $table (ts timestamp, speed int) -x create1
sleep 3001
print =================== step 2
$x = 1
$y = $x + $N
$expect = $N
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 3
system sh/exec.sh -n dnode2 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 2
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 4
system sh/exec.sh -n dnode2 -s start
sleep 2000
$y = $x + $N
$expect = $N * 3
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 5
system sh/exec.sh -n dnode3 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 4
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 6
system sh/exec.sh -n dnode3 -s start
sleep 2000
$y = $x + $N
$expect = $N * 5
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 7
system sh/exec.sh -n dnode4 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 6
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 8
system sh/exec.sh -n dnode4 -s start
sleep 2000
$y = $x + $N
$expect = $N * 7
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 9
system sh/exec.sh -n dnode1 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 8
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 10
system sh/exec.sh -n dnode1 -s start
sleep 2000
$y = $x + $N
$expect = $N * 9
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
tests/script/unique/vnode/backup/replica5.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 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/exec.sh -n dnode1 -s start
$x = 0
connectTbase:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql connect -x connectTbase
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname5
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode5 -s start
sleep 3001
$N = 10
$table = table_r5
$db = db1
print =================== step 1
$x = 0
created:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create database $db replica 5 -x created
sql use $db
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $table (ts timestamp, speed int) -x create1
sleep 3001
print =================== step 2
$x = 1
$y = $x + $N
$expect = $N
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 3
system sh/exec.sh -n dnode2 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 2
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 4
system sh/exec.sh -n dnode2 -s start
sleep 2000
$y = $x + $N
$expect = $N * 3
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 5
system sh/exec.sh -n dnode3 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 4
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 6
system sh/exec.sh -n dnode3 -s start
sleep 2000
$y = $x + $N
$expect = $N * 5
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 7
system sh/exec.sh -n dnode4 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 6
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 8
system sh/exec.sh -n dnode4 -s start
sleep 2000
$y = $x + $N
$expect = $N * 7
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 9
system sh/exec.sh -n dnode5 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 8
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 10
system sh/exec.sh -n dnode5 -s start
sleep 2000
$y = $x + $N
$expect = $N * 9
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 11
system sh/exec.sh -n dnode1 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 10
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 12
system sh/exec.sh -n dnode1 -s start
sleep 2000
$y = $x + $N
$expect = $N * 11
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , 10)
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
system sh/exec.sh -n dnode5 -s stop
tests/script/unique/vnode/replica2_a_large.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
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 debugFlag -v 131
system sh/cfg.sh -n dnode2 -c debugFlag -v 131
system sh/cfg.sh -n dnode3 -c debugFlag -v 131
system sh/cfg.sh -n dnode4 -c debugFlag -v 131
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
print ============== step0: start tarbitrator
system sh/exec_tarbitrator.sh -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start -t
system sh/exec.sh -n dnode3 -s start -t
sleep 2000
print ========= step1
sql create database db replica 2
#sql create table db.tb1 (ts timestamp, i int)
#sql create table db.tb2 (ts timestamp, i int)
#sql create table db.tb3 (ts timestamp, i int)
#sql create table db.tb4 (ts timestamp, i int)
#sql insert into db.tb1 values(now, 1)
#sql select count(*) from db.tb1
sql create database db replica 2
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql select count(*) from db.tb
$lastRows = $rows
print ======== step2
#run_back unique/vnode/back_insert_many.sim
run_back unique/vnode/back_insert.sim
sleep 2000
print ======== step3
$x = 0
loop:
print ======== step4
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode2 -s start -t
sleep 10000
print ======== step5
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 10000
system sh/exec.sh -n dnode3 -s start -t
sleep 10000
print ======== step6
#sql select count(*) from db.tb1
#print select count(*) from db.tb1 ==> $data00 $lastRows
sql select count(*) from db.tb
print select count(*) from db.tb ==> $data00 $lastRows
if $data00 <= $lastRows then
return -1
endi
print ======== step7
$lastRows = $data00
print ======== loop Times $x
if $x < 10 then
$x = $x + 1
goto loop
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/vnode/replica2_basic2.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
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 ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 2000
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
sleep 2000
sql reset query cache
print ========= step1
sql create database d1 replica 2
sql create database d2 replica 2
sql create database d3 replica 2
sql create database d4 replica 2
sql create table d1.t1 (ts timestamp, i int)
sql create table d2.t2 (ts timestamp, i int)
sql create table d3.t3 (ts timestamp, i int)
sql create table d4.t4 (ts timestamp, i int)
sql insert into d1.t1 values(now, 1)
sql insert into d2.t2 values(now, 1)
sql insert into d3.t3 values(now, 1)
sql insert into d4.t4 values(now, 1)
sql select * from d1.t1
if $rows != 1 then
return -1
endi
sql select * from d2.t2
if $rows != 1 then
return -1
endi
sql select * from d3.t3
if $rows != 1 then
return -1
endi
sql select * from d4.t4
if $rows != 1 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
return -1
endi
if $data2_2 != 4 then
return -1
endi
if $data2_3 != 4 then
return -1
endi
if $data4_1 != ready then
print dnode1 status should ready but is $data4_1
return -1
endi
if $data4_2 != ready then
return -1
endi
if $data4_3 != ready then
return -1
endi
print ========= step2
sql insert into d1.t1 values(now, 2)
sql insert into d2.t2 values(now, 2)
sql insert into d3.t3 values(now, 2)
sql insert into d4.t4 values(now, 2)
sql select * from d1.t1
if $rows != 2 then
return -1
endi
sql select * from d2.t2
if $rows != 2 then
return -1
endi
sql select * from d3.t3
if $rows != 2 then
return -1
endi
sql select * from d4.t4
if $rows != 2 then
return -1
endi
print ========= step3
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
#sql insert into d1.t1 values(now, 3)
#sql insert into d2.t2 values(now, 3)
#sql insert into d3.t3 values(now, 3)
#sql insert into d4.t4 values(now, 3)
#sql select * from d1.t1
#if $rows != 2 then
# return -1
#endi
#sql select * from d2.t2
#if $rows != 2 then
# return -1
#endi
#sql select * from d3.t3
#if $rows != 2 then
# return -1
#endi
#sql select * from d4.t4
#if $rows != 2 then
# return -1
#endi
print ========= step4
system sh/exec.sh -n dnode2 -s start
sleep 3000
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 3000
#sql insert into d1.t1 values(now, 4)
#sql insert into d2.t2 values(now, 4)
#sql insert into d3.t3 values(now, 4)
#sql insert into d4.t4 values(now, 4)
#sql select * from d1.t1
#if $rows != 2 then
# return -1
#endi
#sql select * from d2.t2
#if $rows != 2 then
# return -1
#endi
#sql select * from d3.t3
#if $rows != 2 then
# return -1
#endi
#sql select * from d4.t4
#if $rows != 2 then
# return -1
#endi
print ========= step5
system sh/exec.sh -n dnode3 -s start
sleep 3000
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sql select * from d1.t1
if $rows != 3 then
return -1
endi
sql select * from d2.t2
if $rows != 3 then
return -1
endi
sql select * from d3.t3
if $rows != 3 then
return -1
endi
sql select * from d4.t4
if $rows != 3 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/vnode/replica2_repeat.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
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 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 numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
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/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 show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
print ========= step1
sql create database db replica 2
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql select count(*) from db.tb
$lastRows = $rows
print ======== step2
run_back unique/vnode/back_insert.sim
sleep 2000
print ======== step3
$x = 0
loop:
print ======== step4
system sh/exec.sh -n dnode2 -s stop
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
print ======== step5
system sh/exec.sh -n dnode3 -s stop
sleep 3000
system sh/exec.sh -n dnode3 -s start
sleep 3000
print ======== step6
sql select count(*) from db.tb
print select count(*) from db.tb ==> $data00 $lastRows
if $data00 <= $lastRows then
return -1
endi
print ======== step7
$lastRows = $data00
print ======== loop Times $x
if $x < 2 then
$x = $x + 1
goto loop
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/vnode/testSuite.sim
已删除
100644 → 0
浏览文件 @
b0b9b013
run unique/vnode/many.sim
run unique/vnode/replica2_basic2.sim
run unique/vnode/replica2_repeat.sim
run unique/vnode/replica3_basic.sim
run unique/vnode/replica3_repeat.sim
run unique/vnode/replica3_vgroup.sim
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录