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

Merge pull request #1922 from taosdata/feature/mwrite

scripts
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -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/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
createDnode:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes;
if $data4_2 == offline then
goto createDnode
endi
if $data4_3 == offline then
goto createDnode
endi
if $data4_4 == offline then
goto createDnode
endi
print ======================== dnode1 start
$dbPrefix = r3v3_db
$tbPrefix = r3v3_tb
$mtPrefix = r3v3_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db maxTables 4
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$val = $x * 60000
$ms = 1519833600000 + $val
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sql show vgroups
print vgroups ==> $rows
if $rows != 3 then
return -1
endi
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
sql select count(tbcol) from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step3
sql select count(tbcol) from $tb where ts <= 1519833840000
print ===> $data00
if $data00 != 5 then
return -1
endi
print =============== step4
sql select count(tbcol) as b from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step5
sql select count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
print select count(*) from $mt
sql select count(*) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
sql select count(tbcol) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
print =============== step8
sql select count(tbcol) as c from $mt where ts <= 1519833840000
print ===> $data00
if $data00 != 50 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 100 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5 and ts <= 1519833840000
print ===> $data00
if $data00 != 25 then
return -1
endi
print =============== step9
sql select count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
endi
print =============== step10
sql select count(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != $rowNum then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
run general/stable/disk.sim
run general/stable/dnode3.sim
run general/stable/metrics.sim
run general/stable/values.sim
run general/stable/vnode3.sim
......@@ -85,10 +85,10 @@ cd ../../../debug; make
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
#hongze ./test.sh -f general/import/replica1.sim
#liao ./test.sh -f general/import/replica1.sim
./test.sh -f general/insert/basic.sim
#hongze ./test.sh -f general/insert/insert_drop.sim
#liao ./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim
./test.sh -f general/insert/query_block2_memory.sim
./test.sh -f general/insert/query_block1_file.sim
......@@ -150,6 +150,7 @@ cd ../../../debug; make
#./test.sh -f general/parser/bug.sim
./test.sh -f general/stable/disk.sim
#./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
......@@ -251,16 +252,16 @@ cd ../../../debug; make
./test.sh -u -f unique/column/replica3.sim
#hongze ./test.sh -u -f unique/db/commit.sim
#hongze crash ./test.sh -u -f unique/db/commit.sim
./test.sh -u -f unique/db/delete.sim
#./test.sh -u -f unique/db/delete_part.sim
##./test.sh -u -f unique/db/replica_add12.sim
##./test.sh -u -f unique/db/replica_add13.sim
##./test.sh -u -f unique/db/replica_add23.sim
##./test.sh -u -f unique/db/replica_reduce21.sim
##./test.sh -u -f unique/db/replica_reduce32.sim
##./test.sh -u -f unique/db/replica_reduce31.sim
##./test.sh -u -f unique/db/replica_part.sim
./test.sh -u -f unique/db/delete_part.sim
./test.sh -u -f unique/db/replica_add12.sim
#hongze crash ./test.sh -u -f unique/db/replica_add13.sim
#hongze crash ./test.sh -u -f unique/db/replica_add23.sim
#hongze crash ./test.sh -u -f unique/db/replica_reduce21.sim
./test.sh -u -f unique/db/replica_reduce32.sim
#hongze crash /test.sh -u -f unique/db/replica_reduce31.sim
./test.sh -u -f unique/db/replica_part.sim
##./test.sh -u -f unique/dnode/balance1.sim
##./test.sh -u -f unique/dnode/balance2.sim
......@@ -278,14 +279,14 @@ cd ../../../debug; make
#./test.sh -u -f unique/import/replica2.sim
#./test.sh -u -f unique/import/replica3.sim
#./test.sh -u -f unique/metrics/balance_replica1.sim
#./test.sh -u -f unique/metrics/dnode2_stop.sim
#./test.sh -u -f unique/metrics/dnode2.sim
#./test.sh -u -f unique/metrics/dnode3.sim
#./test.sh -u -f unique/metrics/replica2_dnode4.sim
#./test.sh -u -f unique/metrics/replica2_vnode3.sim
#./test.sh -u -f unique/metrics/replica3_dnode6.sim
#./test.sh -u -f unique/metrics/replica3_vnode3.sim
#./test.sh -u -f unique/stable/balance_replica1.sim
#./test.sh -u -f unique/stable/dnode2_stop.sim
#./test.sh -u -f unique/stable/dnode2.sim
#./test.sh -u -f unique/stable/dnode3.sim
#./test.sh -u -f unique/stable/replica2_dnode4.sim
#./test.sh -u -f unique/stable/replica2_vnode3.sim
#./test.sh -u -f unique/stable/replica3_dnode6.sim
#./test.sh -u -f unique/stable/replica3_vnode3.sim
./test.sh -u -f unique/mnode/mgmt22.sim
./test.sh -u -f unique/mnode/mgmt23.sim
......@@ -296,13 +297,9 @@ cd ../../../debug; make
./test.sh -u -f unique/mnode/mgmt34.sim
./test.sh -u -f unique/mnode/mgmtr2.sim
##./test.sh -u -f unique/table/delete_part.sim
#./test.sh -u -f unique/vnode/commit.sim
#./test.sh -u -f unique/vnode/many.sim
#./test.sh -u -f unique/vnode/replica2_basic.sim
./test.sh -u -f unique/vnode/many.sim
./test.sh -u -f unique/vnode/replica2_basic2.sim
#./test.sh -u -f unique/vnode/replica2_repeat.sim
#hongze ./test.sh -u -f unique/vnode/replica3_basic.sim
#./test.sh -u -f unique/vnode/replica3_repeat.sim
#./test.sh -u -f unique/vnode/replica3_vgroup.sim
./test.sh -u -f unique/vnode/replica2_repeat.sim
./test.sh -u -f unique/vnode/replica3_basic.sim
./test.sh -u -f unique/vnode/replica3_repeat.sim
./test.sh -u -f unique/vnode/replica3_vgroup.sim
......@@ -34,13 +34,14 @@ while $i < 2000
$i = $i + 1
endw
sleep 2500
sql show db.vgroups
if $rows != 2 then
return -1
endi
print ======== step2
sleep 1000
sql drop database db
sql show databases
if $rows != 0 then
......
......@@ -45,27 +45,126 @@ begin:
sql create database $db
sql use $db
$x = 0
while $x < 32
$tb = tb . $x
sql create table $tb (ts timestamp, i int)
sql insert into $tb values(now, $x )
$x = $x + 1
endw
sql create table t11 (ts timestamp, i int)
sql insert into t11 values(now, 1 )
sql create table t12 (ts timestamp, i int)
sql insert into t12 values(now, 1 )
sql create table t13 (ts timestamp, i int)
sql insert into t13 values(now, 1 )
sql create table t14 (ts timestamp, i int)
sql insert into t14 values(now, 1 )
sleep 1200
sql create table t21 (ts timestamp, i int)
sql insert into t21 values(now, 1 )
sql create table t22 (ts timestamp, i int)
sql insert into t22 values(now, 1 )
sql create table t23 (ts timestamp, i int)
sql insert into t23 values(now, 1 )
sql create table t24 (ts timestamp, i int)
sql insert into t24 values(now, 1 )
sleep 1200
sql create table t31 (ts timestamp, i int)
sql insert into t31 values(now, 1 )
sql create table t32 (ts timestamp, i int)
sql insert into t32 values(now, 1 )
sql create table t33 (ts timestamp, i int)
sql insert into t33 values(now, 1 )
sql create table t34 (ts timestamp, i int)
sql insert into t34 values(now, 1 )
sleep 1200
sql create table t41 (ts timestamp, i int)
sql insert into t41 values(now, 1 )
sql create table t42 (ts timestamp, i int)
sql insert into t42 values(now, 1 )
sql create table t43 (ts timestamp, i int)
sql insert into t43 values(now, 1 )
sql create table t44 (ts timestamp, i int)
sql insert into t44 values(now, 1 )
sleep 1200
sql create table t51 (ts timestamp, i int)
sql insert into t51 values(now, 1 )
sql create table t52 (ts timestamp, i int)
sql insert into t52 values(now, 1 )
sql create table t53 (ts timestamp, i int)
sql insert into t53 values(now, 1 )
sql create table t54 (ts timestamp, i int)
sql insert into t54 values(now, 1 )
sleep 1200
sql create table t61 (ts timestamp, i int)
sql insert into t61 values(now, 1 )
sql create table t62 (ts timestamp, i int)
sql insert into t62 values(now, 1 )
sql create table t63 (ts timestamp, i int)
sql insert into t63 values(now, 1 )
sql create table t64 (ts timestamp, i int)
sql insert into t64 values(now, 1 )
sleep 1200
sql create table t71 (ts timestamp, i int)
sql insert into t71 values(now, 1 )
sql create table t72 (ts timestamp, i int)
sql insert into t72 values(now, 1 )
sql create table t73 (ts timestamp, i int)
sql insert into t73 values(now, 1 )
sql create table t74 (ts timestamp, i int)
sql insert into t74 values(now, 1 )
sleep 1200
sql create table t81 (ts timestamp, i int)
sql insert into t81 values(now, 1 )
sql create table t82 (ts timestamp, i int)
sql insert into t82 values(now, 1 )
sql create table t83 (ts timestamp, i int)
sql insert into t83 values(now, 1 )
sql create table t84 (ts timestamp, i int)
sql insert into t84 values(now, 1 )
sleep 1200
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 4 then
return -1
endi
if $data2_2 != 4 then
return -1
endi
print ======== step2 $loop
system sh/exec_up.sh -n dnode2 -s stop
sleep 1000
print ==> drop database $db
sql drop database $db
print ======== step3 $loop
sleep 3000
sleep 2000
system sh/exec_up.sh -n dnode2 -s start
sleep 5000
sleep 15000
sql show dnodes
print dnode1 openVnodes $data2_1 $data4_1
print dnode2 openVnodes $data2_2 $data4_2
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 0 then
return -1
endi
if $data4_1 != ready then
return -1
endi
if $data4_2 != ready then
return -1
endi
print ===> test times : $loop
if $loop > 5 then
if $loop > 3 then
return 0
endi
......
......@@ -7,9 +7,9 @@ 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 numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
......
......@@ -204,7 +204,7 @@ system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 134
print $system_content
if $system_content != @{"failed":1,"success":1}@ then
if $system_content != @{"failed":0,"success":2}@ then
return -1
endi
......
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 numOfTotalVnodes -v 4
......@@ -26,7 +23,7 @@ $totalNum = 200
print ============== step1
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
$i = 0
......@@ -81,7 +78,7 @@ if $dnode2Vnodes != NULL then
endi
print =============== step3 start dnode2
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sleep 8000
$x = 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 walLevel -v 0
......@@ -10,12 +7,12 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
$x = 0
createDnode:
......@@ -25,7 +22,7 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
......
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 walLevel -v 0
......@@ -10,11 +7,11 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
$x = 0
createDnode:
......@@ -24,7 +21,7 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
......@@ -76,7 +73,7 @@ endi
sleep 100
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
print =============== step2
sql select count(*) from $mt -x step2
......@@ -87,7 +84,7 @@ sql select count(tbcol) from $mt -x step21
return -1
step21:
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sleep 10000
print =============== step3
......
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
......@@ -15,14 +11,14 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -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/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode3 -s start
$x = 0
createDnode:
......@@ -32,10 +28,10 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
if $data4_192.168.0.3 == offline then
if $data4_3 == offline then
goto createDnode
endi
......
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
......@@ -20,16 +15,16 @@ 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/exec.sh -n dnode1 -s start
system sh/exec_up.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
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode4 -s start
$x = 0
createDnode:
......@@ -39,13 +34,13 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
if $data4_192.168.0.3 == offline then
if $data4_3 == offline then
goto createDnode
endi
if $data4_192.168.0.4 == offline then
if $data4_4 == offline then
goto createDnode
endi
......
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 walLevel -v 0
......@@ -10,11 +7,11 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode2 -s start
$x = 0
createDnode:
......@@ -24,7 +21,7 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
......
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
......@@ -35,7 +27,7 @@ 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
system sh/exec.sh -n dnode1 -s start
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
......@@ -43,11 +35,11 @@ sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname5
sql create dnode $hostname6
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode6 -s start
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode4 -s start
system sh/exec_up.sh -n dnode5 -s start
system sh/exec_up.sh -n dnode6 -s start
$x = 0
createDnode:
......@@ -57,19 +49,19 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
if $data4_192.168.0.3 == offline then
if $data4_3 == offline then
goto createDnode
endi
if $data4_192.168.0.4 == offline then
if $data4_4 == offline then
goto createDnode
endi
if $data4_192.168.0.5 == offline then
if $data4_5 == offline then
goto createDnode
endi
if $data4_192.168.0.6 == offline then
if $data4_6 == offline then
goto createDnode
endi
......
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
......@@ -20,16 +16,16 @@ 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/exec.sh -n dnode1 -s start
system sh/exec_up.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
system sh/exec_up.sh -n dnode2 -s start
system sh/exec_up.sh -n dnode3 -s start
system sh/exec_up.sh -n dnode4 -s start
$x = 0
createDnode:
$x = $x + 1
......@@ -38,13 +34,13 @@ createDnode:
return -1
endi
sql show dnodes;
if $data4_192.168.0.2 == offline then
if $data4_2 == offline then
goto createDnode
endi
if $data4_192.168.0.3 == offline then
if $data4_3 == offline then
goto createDnode
endi
if $data4_192.168.0.4 == offline then
if $data4_4 == offline then
goto createDnode
endi
......@@ -144,6 +140,7 @@ if $rows != 5 then
endi
print =============== step7
print select count(*) from $mt
sql select count(*) from $mt
print ===> $data00
if $data00 != $totalNum then
......@@ -208,7 +205,7 @@ endi
if $rows != 50 then
return -1
endi
return
print =============== clear
sql drop database $db
sql show databases
......
sql connect
$x = 1
begin:
sql insert into db.tb values(now, $x ) -x begin
#print ===> insert successed $x
$x = $x + 1
goto begin
\ 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 walLevel -v 0
system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -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
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql create database dpdb
sql use dpdb
$loop = 0
begin:
print ======== step1
$x = 0
while $x < 16
$tb = tb . $x
sql create table $tb (ts timestamp, i int)
sql insert into $tb values(now, $x )
$x = $x + 1
endw
print ======== step2
system sh/exec.sh -n dnode2 -s stop
$x = 0
while $x < 16
$tb = tb . $x
sql drop table $tb
$x = $x + 1
endw
print ======== step3
sleep 2000
system sh/exec.sh -n dnode2 -s start
sleep 3000
print ===> test times : $loop
if $loop > 20 then
return 0
endi
$loop = $loop + 1
goto begin
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
#################################
run unique/mnode/testSuite.sim
##################################
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 wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numofMpeers -v 3
system sh/cfg.sh -n dnode2 -c numofMpeers -v 3
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec_up.sh -n dnode2 -s start
sleep 3000
print =================== step 1 create db
sql create database c2db replica 2 days 10 keep 50
sql use c2db
sql create table tb (ts timestamp, speed int)
sql insert into tb values(now, 0)
print =================== step2 sleep 2000 and kill dnode2(SIGINT)
sleep 2000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 1000
print =================== step3 insert into dnode1
$x = 1
while $x < 100
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 240
while $x < 400
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 480
while $x < 700
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 720
while $x < 809
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 960
while $x < 1043
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 1200
while $x < 1244
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 1440
while $x < 1677
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
$x = 1680
while $x < 1683
$time = $x . m
sql insert into tb values (now + $time , $x )
$x = $x + 1
endw
print =================== step4
sql select count(*) from tb
print select count(*) from tb ==> $data00 (expect 936)
if $data00 != 936 then
return -1
endi
sql select * from tb order by ts desc
print select * from tb ==> $data00 $data01 $rows
if $data01 != 1682 then
return -1
endi
if $rows != 936 then
return -1
endi
print =================== step5 sleep kill dnode1(SIGINT) then start dnode1
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
print =================== step6 start dnode2 and sleep 10000 (wait sync complete)
system sh/exec_up.sh -n dnode2 -s start
sleep 12000
print =================== step7
sql_error insert into tb values(now + 1000h, 100)
sql select count(*) from tb order by ts desc
print select count(*) from tb ==> $data00 (expect <= 936)
if $data00 != 936 then
return -1
endi
$remainRows = $data00
sql select * from tb order by ts desc
print select * from tb ==> $data00 $data01 $data10 $data11 $rows
if $data11 != 1681 then
return -1
endi
if $rows != $remainRows then
return -1
endi
print =================== step8 kill dnode1(SIGINT) and query
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
sleep 2000
print =================== step9
sql select count(*) from tb order by ts desc
print select count(*) from tb ==> $data00 (expect == $remainRows )
if $data00 > $remainRows then
return -1
endi
if $data00 <= 0 then
return -1
endi
$remainRows = $data00
sql select * from tb order by ts desc
print select * from tb ==> $data00 $data01 $rows
if $rows != $remainRows then
return -1
endi
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
......@@ -53,27 +53,27 @@ sql select count(*) from db4.tb4
$lastRows4 = $rows
print ======== step2
run_back cluster/vnode/back_insert_many.sim
run_back unique/vnode/back_insert_many.sim
sleep 5000
print ======== step3
system sh/exec_up.sh -n dnode2 -s stop
sleep 10000
sleep 5000
$x = 0
loop:
print ======== step4
system sh/exec_up.sh -n dnode2 -s start
sleep 10000
sleep 5000
system sh/exec_up.sh -n dnode3 -s stop
sleep 10000
sleep 5000
print ======== step5
system sh/exec_up.sh -n dnode3 -s start
sleep 10000
sleep 5000
system sh/exec_up.sh -n dnode2 -s stop
sleep 10000
sleep 5000
print ======== step6
sql select count(*) from db1.tb1
......@@ -108,7 +108,7 @@ print ======== step7
print ======== loop Times $x
if $x < 5 then
if $x < 2 then
$x = $x + 1
goto loop
endi
......
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 wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numofMpeers -v 3
system sh/cfg.sh -n dnode2 -c numofMpeers -v 3
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec_up.sh -n dnode2 -s start
sleep 3000
$N = 10
$db = d1
$table = table_r2
print =================== step 1
sql create database $db replica 3
sql use $db
sql create table $table (ts timestamp, speed int) -x error_create
return -1
error_create:
sql drop database $db
print =================== step 2
sql create database $db replica 2
sql use $db
sql create table $table (ts timestamp, speed int)
sleep 1000
print =================== step 3
$x = 1
$y = $x + $N
$expect = $N
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 4
system sh/exec_up.sh -n dnode2 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 2
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 5
system sh/exec_up.sh -n dnode2 -s start
sleep 2000
$y = $x + $N
$expect = $N * 3
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 6
system sh/exec_up.sh -n dnode1 -s stop
sleep 2000
$y = $x + $N
$expect = $N * 4
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 7
system sh/exec_up.sh -n dnode1 -s start
sleep 2000
$y = $x + $N
$expect = $N * 5
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 8
system sh/ip.sh -i 1 -s down
sleep 2000
$y = $x + $N
$expect = $N * 6
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 9
sleep 2000
$y = $x + $N
$expect = $N * 7
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 10
system sh/ip.sh -i 2 -s down
sleep 2000
$y = $x + $N
$expect = $N * 8
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 11
sleep 2000
$y = $x + $N
$expect = $N * 9
while $x < $y
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
sql select * from $table
print sql select * from $table -> $rows points
if $rows != $expect then
return -1
endi
print =================== step 12
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
......@@ -33,7 +33,7 @@ sql select count(*) from db.tb
$lastRows = $rows
print ======== step2
run_back cluster/vnode/back_insert.sim
run_back unique/vnode/back_insert.sim
sleep 3000
print ======== step3
......@@ -66,7 +66,7 @@ print ======== step7
$lastRows = $data00
print ======== loop Times $x
if $x < 5 then
if $x < 2 then
$x = $x + 1
goto loop
endi
......
......@@ -36,7 +36,7 @@ sql select count(*) from db.tb
$lastRows = $rows
print ======== step2
run_back cluster/vnode/back_insert.sim
run_back unique/vnode/back_insert.sim
sleep 3000
print ======== step3
......@@ -75,7 +75,7 @@ print ======== step8
$lastRows = $data00
print ======== loop Times $x
if $x < 5 then
if $x < 2 then
$x = $x + 1
goto loop
endi
......
......@@ -33,7 +33,7 @@ sleep 3001
$tbPre = m
$N = 280
$N = 300
$x = 0
$y = $x + $N
while $x < $y
......@@ -46,20 +46,20 @@ endw
#print =================== step 2
#$x = 1
#$y = $x + $N
#$expect = $N
#while $x < $y
# $ms = $x . m
# sql insert into $table values (now + $ms , $x )
# $x = $x + 1
#endw
$x = -500
$y = $x + $N
while $x < $y
$ms = $x . m
sql insert into $table values (now $ms , $x )
$x = $x + 1
endw
#sql select * from $table
#print sql select * from $table -> $rows points
#if $rows != $expect then
# return -1
#endi
$expect = $N + 1
sql select * from $table
print sql select * from $table -> $rows points expect $expect
if $rows != $expect then
return -1
endi
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
......
run unique/vnode/commit.sim
run unique/vnode/many.sim
run unique/vnode/replica2_basic.sim
run unique/vnode/replica2_basic2.sim
run unique/vnode/replica2_repeat.sim
run unique/vnode/replica3_basic.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册