未验证 提交 cdb35a08 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #15183 from taosdata/fix/mnode

test: restore 2.0 case
......@@ -17,7 +17,7 @@
./test.sh -f tsim/db/basic4.sim
./test.sh -f tsim/db/basic5.sim
./test.sh -f tsim/db/basic6.sim
# nojira ./test.sh -f tsim/db/commit.sim
./test.sh -f tsim/db/commit.sim
./test.sh -f tsim/db/create_all_options.sim
./test.sh -f tsim/db/delete_reuse1.sim
./test.sh -f tsim/db/delete_reuse2.sim
......@@ -27,7 +27,7 @@
./test.sh -f tsim/db/delete_writing2.sim
# unsupport ./test.sh -f tsim/db/dropdnodes.sim
./test.sh -f tsim/db/error1.sim
# nojira ./test.sh -f tsim/db/keep.sim
# jira ./test.sh -f tsim/db/keep.sim
./test.sh -f tsim/db/len.sim
./test.sh -f tsim/db/repeat.sim
./test.sh -f tsim/db/show_create_db.sim
......@@ -88,7 +88,7 @@
./test.sh -f tsim/parser/alter__for_community_version.sim
./test.sh -f tsim/parser/alter_column.sim
./test.sh -f tsim/parser/alter_stable.sim
# nojira ./test.sh -f tsim/parser/auto_create_tb.sim
# jira ./test.sh -f tsim/parser/auto_create_tb.sim
./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim
./test.sh -f tsim/parser/between_and.sim
./test.sh -f tsim/parser/binary_escapeCharacter.sim
......
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 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 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 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
print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sql connect
sleep 2000
print ========= start other dnodes
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 2000
sql create dnode $hostname port 7200
$x = 0
step1:
$ = $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
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
print ======== step1 create db
sql create database commitdb replica 1 duration 7 keep 30
......@@ -68,9 +76,7 @@ $num = $rows + 2
print ======== step3 import old data
sql import into tb values (now - 10d , -10 )
sql import into tb values (now - 11d , -11 )
sql select * from tb order by ts desc
print ===> rows $rows expect $num
print ===> last $data01 expect $data01
......@@ -99,9 +105,7 @@ endi
print ======== step5 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql select * from tb
print ===> rows $rows
......@@ -116,10 +120,4 @@ if $data01 != 40 then
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
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
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 transPullupInterval -v 1
system sh/cfg.sh -n dnode2 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode3 -c transPullupInterval -v 1
system sh/cfg.sh -n dnode4 -c transPullupInterval -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sql connect
print =============== step1 create dnode2
sql create dnode $hostname port 7200
$x = 0
step1:
$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
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
print ======== step1 create db
sql create database keepdb replica 1 keep 30 duration 7
sql create database keepdb replica 1 keep 30 duration 7 vgroups 2
sql use keepdb
sql create table tb (ts timestamp, i int)
$x = 1
while $x < 41
$time = $x . d
sql insert into tb values (now + $time , $x ) -x step2
sql insert into tb values (now - $time , $x ) -x step2
step2:
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
print ===> rows $rows last $data01
if $rows >= 40 then
return -1
endi
......@@ -61,9 +27,7 @@ system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s start
sql select * from tb
print ===> rows $rows
print ===> last $data01
print ===> rows $rows last $data01
if $rows >= 40 then
return -1
endi
......@@ -75,23 +39,13 @@ $num1 = $rows + 40
print ======== step3 alter db
sql alter database keepdb keep 60
flush database keepdb
sql flush database keepdb
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data02 != 1 then
if $data22 != 2 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 7 then
return -1
endi
if $data06 != 60 then
if $data27 != 86400m,86400m,86400m then
return -1
endi
......@@ -99,98 +53,73 @@ print ======== step4 insert data
$x = 41
while $x < 81
$time = $x . d
sql insert into tb values (now + $time , $x )
sql insert into tb values (now - $time , $x ) -x step4
step4:
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows != $num1 then
print ===> rows $rows last $data01
if $rows >= 80 then
return -1
endi
if $data01 != 80 then
if $rows <= 50 then
return -1
endi
return
print ======== step5 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
system sh/exec.sh -n dnode2 -s start
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows >= $num1 then
print ===> rows $rows last $data01
if $rows >= 80 then
return -1
endi
if $rows <= 50 then
return -1
endi
if $data01 != 80 then
return -1
endi
print ======== step6 alter db
sql alter database keepdb keep 30
sleep 1000
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data02 != 1 then
return -1
endi
if $data03 != 1 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data05 != 7 then
if $data22 != 2 then
return -1
endi
if $data06 != 30 then
if $data27 != 43200m,43200m,43200m then
return -1
endi
print ======== step7 stop dnode
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 2000
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
system sh/exec.sh -n dnode2 -s start
sleep 2000
sql select * from tb
print ===> rows $rows
print ===> last $data01
print ===> rows $rows last $data01
if $rows >= 40 then
return -1
endi
if $rows <= 20 then
return -1
endi
if $data01 != 80 then
return -1
endi
$num3 = $rows + 40
print ======== step8 insert data
$x = 81
while $x < 121
$time = $x . d
sql insert into tb values (now + $time , $x )
sql insert into tb values (now - $time , $x ) -x step4
step4:
$x = $x + 1
endw
sql select * from tb
print ===> rows $rows
print ===> last $data01
if $rows != $num3 then
print ===> rows $rows last $data01
if $rows >= 40 then
return -1
endi
if $data01 != 120 then
if $rows <= 20 then
return -1
endi
......@@ -208,4 +137,6 @@ sql alter database keepdb duration 1 -x error3
error3:
print ======= test success
\ No newline at end of file
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册