Merge pull request #14319 from taosdata/fix/tsim

test: case for balance vgroup
This commit is contained in:
Shengliang Guan 2022-06-28 15:50:25 +08:00 committed by GitHub
commit 1c9715c5f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 1003 additions and 2719 deletions

View File

@ -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 @@
./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

View File

@ -1,40 +1,18 @@
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)
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 $data2_1 print dnode1 openVnodes $data(1)[2]
if $data2_1 != 1 then if $data(1)[2] != 1 then
return -1 return -1
endi endi
print ========== step2 print ========== step2
sql create dnode $hostname2 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
show2: step2:
$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 endi
if $data2_2 != 1 then if $data(1)[4] != ready then
goto show2 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
if $data(2)[2] != 1 then
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)
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]
if $data2_1 != 0 then if $data(1)[2] != 0 then
return -1 return -1
endi endi
if $data2_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 endi
if $data2_2 != null then if $data(2)[2] != null then
goto show4 return -1
endi
if $rows != 1 then
goto show4
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 $hostname3 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
show5: step5:
$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 $data2_2 != null then if $data(1)[4] != ready then
goto show5 goto step5
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)
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 $hostname4 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
show7: step7:
$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 $data2_2 != null then if $data(1)[4] != ready then
goto show7 goto step7
endi endi
if $data2_3 != 2 then if $data(3)[4] != ready then
goto show7 goto step7
endi endi
if $data2_4 != 1 then if $data(4)[4] != ready then
goto show7 goto step7
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)
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 $data2_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 endi
if $data2_2 != null then if $data(4)[2] != 2 then
goto show9 return -1
endi
if $data2_3 != null then
goto show9
endi
if $data2_4 != 4 then
goto show9
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

View File

@ -0,0 +1,280 @@
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 supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
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 dnode5 -c supportVnodes -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
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 dnode3 -s start
$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
print ===> $data20 $data21 $data22 $data23 $data24 $data25
if $rows != 3 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
if $data(3)[4] != ready then
goto step1
endi
print ========== step2
sql create database d1 replica 3 vgroups 1
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 3 vgroups 1
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 3 vgroups 1
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 3 vgroups 1
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 $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data(3)[2]
if $data(1)[2] != 4 then
return -1
endi
if $data(2)[2] != 4 then
return -1
endi
if $data(3)[2] != 4 then
return -1
endi
print ========== step3
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
$x = 0
step3:
$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
print ===> $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
return -1
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
if $data(5)[4] != ready then
goto step3
endi
sql balance vgroup
sql show dnodes
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
endi
if $data(2)[2] != 3 then
return -1
endi
if $data(3)[2] != 3 then
return -1
endi
if $data(4)[2] != 2 then
return -1
endi
if $data(5)[2] != 2 then
return -1
endi
print ========== step4
sql drop dnode 2
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] != 2 then
return -1
endi
if $data(3)[2] != 3 then
return -1
endi
if $data(4)[2] != 4 then
return -1
endi
if $data(5)[2] != 3 then
return -1
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
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
endi
if $data(3)[2] != null then
return -1
endi
if $data(4)[2] != 4 then
return -1
endi
if $data(5)[2] != 4 then
return -1
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

View File

@ -0,0 +1,340 @@
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/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
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 dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode6 -c supportVnodes -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
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 dnode3 -s start
system sh/exec.sh -n dnode4 -s start
$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
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 step1
endi
if $data(2)[4] != ready then
goto step1
endi
if $data(3)[4] != ready then
goto step1
endi
if $data(4)[4] != ready then
goto step1
endi
sql create database d1 replica 3 vgroups 1
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 3 vgroups 1
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 $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
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] != 2 then
return -1
endi
print ========== step2
sql drop dnode 2
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode3 openVnodes $data(3)[2]
print dnode4 openVnodes $data(4)[2]
if $data(1)[2] != 2 then
return -1
endi
if $data(2)[2] != null then
return -1
endi
if $data(3)[2] != 2 then
return -1
endi
if $data(4)[2] != 2 then
return -1
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step3
sql create dnode $hostname port 7500
system sh/exec.sh -n dnode5 -s start
$x = 0
step3:
$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 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
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
if $data(3)[2] != 2 then
return -1
endi
if $data(4)[2] != 2 then
return -1
endi
if $data(5)[2] != 1 then
return -1
endi
print ========== step4
sql create database d3 replica 3 vgroups 1
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 $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
if $data(3)[2] != 3 then
return -1
endi
if $data(4)[2] != 3 then
return -1
endi
if $data(5)[2] != 2 then
return -1
endi
print ========== step5
sql create dnode $hostname port 7600
system sh/exec.sh -n dnode6 -s start
$x = 0
step5:
$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
print ===> $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then
return -1
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
if $data(5)[4] != ready then
goto step5
endi
if $data(6)[4] != ready then
goto step5
endi
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
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]
print dnode5 openVnodes $data(6)[2]
if $data(1)[2] != 2 then
return -1
endi
if $data(3)[2] != null then
return -1
endi
if $data(4)[2] != 2 then
return -1
endi
if $data(5)[2] != 3 then
return -1
endi
if $data(6)[2] != 2 then
return -1
endi
system sh/exec.sh -n dnode3 -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

View File

@ -1,30 +1,18 @@
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)
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)
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]
if $data2_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 goto step2
endi endi
if $data4_2 != ready then if $data(2)[4] != ready then
goto step2
endi
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,89 +89,95 @@ 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 endi
if $data2_2 != 3 then if $data(2)[2] != 2 then
goto show2 return -1
endi
if $data(3)[2] != 2 then
return -1
endi endi
print ========== step3 print ========== step3
sql create dnode $hostname port 7400
$x = 0
show3:
$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 ========== step4
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
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_2 != null then
goto show4
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step5
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start system sh/exec.sh -n dnode4 -s start
$x = 0 $x = 0
show5: step3:
$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 print ===> $data30 $data31 $data32 $data33 $data34 $data35
if $data2_1 != 0 then if $rows != 4 then
goto show5 return -1
endi endi
if $data2_2 != null then if $data(1)[4] != ready then
goto show5 goto step3
endi endi
if $data2_3 != 2 then if $data(2)[4] != ready then
goto show5 goto step3
endi endi
if $data2_4 != 2 then if $data(3)[4] != ready then
goto show5 goto step3
endi endi
if $data(4)[4] != ready then
goto step3
endi
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode2 openVnodes $data(3)[2]
print dnode2 openVnodes $data(4)[2]
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
print ========== step5
sql drop dnode 2
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
print dnode2 openVnodes $data(3)[2]
print dnode2 openVnodes $data(4)[2]
if $data(1)[2] != 1 then
return -1
endi
if $data(2)[2] != null then
return -1
endi
if $data(3)[2] != 2 then
return -1
endi
if $data(4)[2] != 2 then
return -1
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

View File

@ -0,0 +1,161 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname port 7200
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode2 off: $data(2)[6]
if $data(2)[6] != @status not received@ then
return -1
endi
print ========== step2
system sh/exec.sh -n dnode2 -s start
$x = 0
step2:
$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 step2
endi
if $data(2)[4] != ready then
goto step2
endi
print ========== step3
system sh/exec.sh -n dnode2 -s stop
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode2 off: $data(2)[6]
if $data(2)[6] != @status msg timeout@ then
goto step3
endi
print ========== step4
sql drop dnode 2
sql show dnodes
if $rows != 1 then
return -1
endi
print ========== step5
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname port 7200
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode2 off: $data(3)[6]
if $data(3)[6] != @dnodeId not match@ then
goto step5
endi
print ========== step6
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode4 -c statusInterval -v 4
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname port 7400
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode2 off: $data(3)[6]
print dnode3 off: $data(4)[6]
if $data(4)[6] != @interval not match@ then
goto step6
endi
print ========== step7
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode5 -c locale -v zn_CH.UTF-8
system sh/exec.sh -n dnode5 -s start
sql create dnode $hostname port 7500
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode3 off: $data(3)[6]
print dnode4 off: $data(4)[6]
print dnode5 off: $data(5)[6]
if $data(5)[6] != @locale not match@ then
goto step7
endi
print ========== step8
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode6 -c charset -v UTF-16
system sh/exec.sh -n dnode6 -s start
sql create dnode $hostname port 7600
$x = 0
step8:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data(1)[6]
print dnode3 off: $data(3)[6]
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
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

View File

@ -1,97 +0,0 @@
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

View File

@ -1,306 +0,0 @@
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

View File

@ -1,337 +0,0 @@
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/deploy.sh -n dnode6 -i 6
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 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
system sh/exec.sh -n dnode1 -s start
sql connect
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
$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 create database d1 replica 3
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 3
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
print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 2 then
return -1
endi
if $data2_3 != 2 then
return -1
endi
if $data2_4 != 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
print dnode4 openVnodes $data2_4
if $data2_1 != 2 then
goto show2
endi
if $data2_2 != null then
goto show2
endi
if $data2_3 != 2 then
goto show2
endi
if $data2_4 != 2 then
goto show2
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========== step
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
$x = 0
show3:
$x = $x + 1
sleep 1000
if $x == 60 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 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
if $data2_5 != 2 then
goto show3
endi
print ========== step4
sql create database d3 replica 3
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
show4:
$x = $x + 1
sleep 1000
if $x == 30 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 show4
endi
if $data2_2 != null then
goto show4
endi
if $data2_3 != 3 then
goto show4
endi
if $data2_4 != 3 then
goto show4
endi
if $data2_5 != 3 then
goto show4
endi
print ========== step5
sql create dnode $hostname6
system sh/exec.sh -n dnode6 -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 dnode6 openVnodes $data2_6
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_6 != 2 then
goto show5
endi
sleep 8000
print ========== step6
sql drop dnode $hostname3
$x = 0
show6:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode6 openVnodes $data2_6
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_6 != 3 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 dnode3 -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

View File

@ -1,215 +0,0 @@
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

View File

@ -1,367 +0,0 @@
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

View File

@ -1,359 +0,0 @@
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
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
$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
print ========== step2
sql create database d1 replica 3
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 3
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 3
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 3
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
print dnode4 openVnodes $data2_4
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 $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
endi
print ========== step3
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 != 3 then
goto show3
endi
if $data2_3 != 3 then
goto show3
endi
if $data2_4 != 3 then
goto show3
endi
if $data2_5 != 3 then
goto show3
endi
sql show d1.vgroups;
print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 5 then
return -1
endi
if $data03 != 3 then
goto show3
endi
sql show d2.vgroups;
print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 5 then
return -1
endi
if $data03 != 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
endi
if $data03 != 3 then
goto show3
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
endi
if $data03 != 3 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
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
endi
if $data03 != 3 then
goto show4
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
if $data03 != 3 then
goto show4
endi
sql show d3.vgroups;
print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
endi
if $data03 != 3 then
goto show4
endi
sql show d4.vgroups;
print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
if $data04 != 4 then
return -1
endi
if $data03 != 3 then
goto show4
endi
sql reset query cache
sleep 100
print ========== step5
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

View File

@ -1,77 +0,0 @@
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

View File

@ -1,77 +0,0 @@
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

View File

@ -1,126 +0,0 @@
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

View File

@ -1,111 +0,0 @@
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

View File

@ -1,203 +0,0 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql show dnodes
print dnode1 off: $data7_1
print dnode2 off: $data7_2
if $data7_2 != @status not received@ then
return -1
endi
print ========== step2
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
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
print ========== step3
system sh/exec.sh -n dnode2 -s stop
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode2 off: $data7_2
if $data7_2 != @status msg timeout@ then
goto step3
endi
print ========== step4
sql drop dnode $hostname2
$x = 0
step4:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
if $rows != 1 then
goto step4
endi
print ========== step5
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname2
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode2 off: $data7_3
if $data7_3 != @dnodeId not match@ then
goto step5
endi
print ========== step6
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 3
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname4
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode4 off: $data7_4
if $data7_4 != @mnEqualVn not match@ then
goto step6
endi
print ========== step7
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode5 -c statusInterval -v 3
system sh/exec.sh -n dnode5 -s start
sql create dnode $hostname5
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode5 off: $data7_5
if $data7_5 != @interval not match@ then
goto step7
endi
print ========== step8
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode6 -c balance -v 0
system sh/exec.sh -n dnode6 -s start
sql create dnode $hostname6
$x = 0
step8:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 off: $data7_1
print dnode6 off: $data7_6
if $data7_6 != @balance not match@ then
goto step8
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 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

View File

@ -1,204 +0,0 @@
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