提交 12dffbc7 编写于 作者: H Hui Li

[add sim cases]

上级 8e410b8a
# create database db1
# create table tb ()
# loop insert seq data
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$preBinary = ' . client-01-
###############################################################
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$totalRows = 0
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
$loop_cnt = 0
loop_run:
print ================ client-01 start loop insert data ( loop_cnt: $loop_cnt )
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $preBinary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
$x = $x + 20
$ts = $ts + 40a
endw
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tb
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-01 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loop_cnt = $loop_cnt + 1
goto loop_run
# create database db1
# create table tb ()
# loop insert disorder data
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-02-
###############################################################
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$totalRows = 0
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
loop_run:
print ================ client-02 start loop insert data
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-02 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
goto loop_run
# create database db1
# create table stb ()
# loop dynamic create sub table and insert disorder data
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-03-
$t2Binary = ' . client-03-
###############################################################
sql connect
print ================ create db and super-table
$db = db
$stb = stb
sql create database if not exists $db replica 2
sql use $db
sql create table if not exists $stb ( ts timestamp , c1 int , c2 binary(16) ) tags ( t1 int , t2 binary(16) )
#print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
#$i = $tblStart
#while $i < $tblEnd
# $tb = tb . $i
## print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
# sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
# $i = $i + 1
#endw
$totalRows = 0
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
loop_run:
print ================ client-03 start loop insert data
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$t2Binary = ' . $i
$t2Binary = $t2Binary . '
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb using $stb tags ( $i , $t2Binary ) values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb using $stb tags ( $i , $t2Binary ) values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ****** client-3 insert data into $tblStart error ***
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
sql select count(*) from $stb
if $data00 != $totalRows then
print data00 $data00 totalRows $totalRows
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ***** client-3 insert data into $stbl error ********
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
goto loop_run
# create database db1
# create table tb ()
# loop insert disorder data, drop database, sleep ,
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-04-
###############################################################
$totalRows = 0
sql connect
init_lable:
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
$loopCnt = 0
loop_run:
print ================ client-04 start loop insert data
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-04 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loopCnt = $loopCnt + 1
if $loopCnt > 100 then
sql drop database if exists $db
sleep 20000
$totalRows = 0
goto init_lable
endi
goto loop_run
# create database db1
# loop create table , insert disorder data, drop table, sleep ,
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-05-
###############################################################
$totalRows = 0
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
init_lable:
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
$loopCnt = 0
loop_run:
print ================ client-05 start loop insert data
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-05 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loopCnt = $loopCnt + 1
if $loopCnt > 100 then
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
sql drop table if exists $tb
$i = $i + 1
$totalRows = $totalRows - $rowsPerTbl
endw
sleep 20000
goto init_lable
endi
goto loop_run
# create database db1
# create table tb ()
# loop insert disorder data, drop some tables and create new tables, sleep ,
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-06-
$numPerUpdateTbl = 2000
###############################################################
$totalRows = 0
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
init_lable:
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$dropTblStart = $tblStart
$dropTblEnd = $tblStart + $numPerUpdateTbl
$tblStart = $tblEnd
$tblEnd = $tblEnd + $numPerUpdateTbl
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
$loopCnt = 0
loop_run:
print ================ client-06 start loop insert data
$i = $dropTblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-06 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loopCnt = $loopCnt + 1
if $loopCnt > 100 then
$i = $dropTblStart
while $i < $dropTblEnd
$tb = tb . $i
sql drop table if exists $tb
$i = $i + 1
$totalRows = $totalRows - $rowsPerTbl
endw
sleep 20000
goto init_lable
endi
goto loop_run
# create database db1
# loop create table , insert disorder data, drop table, sleep ,
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-07-
###############################################################
$totalRows = 0
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
init_lable:
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 160
$loopCnt = 0
loop_run:
print ================ client-07 start loop insert data
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-07 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loopCnt = $loopCnt + 1
if $loopCnt > 100 then
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
sql alter table $tb add column c3 double
sql alter table $tb add column c4 binary( 16 )
sql alter table $tb drop column c1
sql alter table $tb drop column c2
$i = $i + 1
endw
sleep 20000
goto init_lable
endi
goto loop_run
# create database db1
# create table tb ()
# loop insert disorder data, drop some tables and create new tables, sleep ,
###############################################################
################ set script parameters ################
$tblStart = 0
$tblEnd = 10000
$tsStart = 1325347200000 # 2012-01-01 00:00:00.000
$c2Binary = ' . client-06-
$numPerUpdateTbl = 2000
###############################################################
$totalRows = 0
sql connect
print ================ create db
$db = db
sql create database if not exists $db replica 2
sql use $db
init_lable:
print ================ create table $tb (ts timestamp, c1 int, c2 binary(16))
$i = $tblStart
while $i < $tblEnd
$tb = tb . $i
# print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) )
$i = $i + 1
endw
$dropTblStart = $tblStart
$dropTblEnd = $tblStart + $numPerUpdateTbl
$tblStart = $tblEnd
$tblEnd = $tblEnd + $numPerUpdateTbl
$rowsPerTbl = 0
$ts = $tsStart
$rowsPerLoop = 40
$loopCnt = 0
loop_run:
print ================ client-06 start loop insert data
$i = $dropTblStart
while $i < $tblEnd
$tb = tb . $i
$c2Binary = $c2Binary . $i
$c2Binary = $c2Binary . '
$x = 0
while $x < $rowsPerLoop
sql insert into $tb values ( $ts + 0a , $x , $c2Binary ) ( $ts + 2a , $x , $c2Binary ) ( $ts + 4a , $x , $c2Binary ) ( $ts + 6a , $x , $c2Binary ) ( $ts + 8a , $x , $c2Binary ) ( $ts + 10a , $x , $c2Binary ) ( $ts + 12a , $x , $c2Binary ) ( $ts + 14a , $x , $c2Binary ) ( $ts + 16a , $x , $c2Binary ) ( $ts + 18a , $x , $c2Binary ) ( $ts + 20a , $x , $c2Binary ) ( $ts + 22a , $x , $c2Binary ) ( $ts + 24a , $x , $c2Binary ) ( $ts + 26a , $x , $c2Binary ) ( $ts + 28a , $x , $c2Binary ) ( $ts + 30a , $x , $c2Binary ) ( $ts + 32a , $x , $c2Binary ) ( $ts + 34a , $x , $c2Binary ) ( $ts + 36a , $x , $c2Binary ) ( $ts + 38a , $x , $c2Binary )
sql insert into $tb values ( $ts + 1a , $x , $c2Binary ) ( $ts + 3a , $x , $c2Binary ) ( $ts + 5a , $x , $c2Binary ) ( $ts + 7a , $x , $c2Binary ) ( $ts + 9a , $x , $c2Binary ) ( $ts + 11a , $x , $c2Binary ) ( $ts + 13a , $x , $c2Binary ) ( $ts + 15a , $x , $c2Binary ) ( $ts + 17a , $x , $c2Binary ) ( $ts + 19a , $x , $c2Binary ) ( $ts + 21a , $x , $c2Binary ) ( $ts + 23a , $x , $c2Binary ) ( $ts + 25a , $x , $c2Binary ) ( $ts + 27a , $x , $c2Binary ) ( $ts + 29a , $x , $c2Binary ) ( $ts + 31a , $x , $c2Binary ) ( $ts + 33a , $x , $c2Binary ) ( $ts + 35a , $x , $c2Binary ) ( $ts + 37a , $x , $c2Binary ) ( $ts + 39a , $x , $c2Binary )
$x = $x + 40
$ts = $ts + 40a
if $i == $tblStart then
$rowsPerTbl = $rowsPerTbl + $x
endi
endw
$totalRows = $totalRows + $x
$i = $i + 1
endw
sql select count(*) from $tblStart
if $data00 != $rowsPerTbl then
print data00 $data00 rowsPerTbl $rowsPerTbl
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print ************ client-06 insert data error ***** *****
print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return -1
endi
$loopCnt = $loopCnt + 1
#if $loopCnt > 100 then
$i = $dropTblStart
while $i < $dropTblEnd
$tb = tb . $i
sql drop table if exists $tb
$i = $i + 1
$totalRows = $totalRows - $rowsPerTbl
endw
sleep 20000
goto init_lable
#endi
goto loop_run
# scp -r root@114.116.252.220:/home/ubuntu/clusterSimCase unique/.
#taos> show dnodes;
# id | end_point | vnodes | cores | status | role | create_time |
#==================================================================================================================
# 1 | ubuntu-OptiPlex-7060:7100 | 0 | 12 | ready | mnode | 2020-07-22 06:25:31.677 |
# 2 | ubuntu-OptiPlex-7060:7200 | 4 | 12 | ready | vnode | 2020-07-22 06:25:34.795 |
# 3 | ubuntu-OptiPlex-7060:7300 | 4 | 12 | ready | vnode | 2020-07-22 06:25:34.803 |
#Query OK, 3 row(s) in set (0.002448s)
#taos> show vgroups;
# vgId | tables | status | onlineVnodes | dnode | vstatus | dnode | vstatus |
#======================================================================================================
# 2 | 1024 | ready | 2 | 3 | master | 2 | slave |
# 3 | 1024 | ready | 2 | 3 | master | 2 | slave |
# 4 | 1024 | ready | 2 | 3 | master | 2 | slave |
# 5 | 718 | ready | 2 | 3 | master | 2 | slave |
#Query OK, 4 row(s) in set (0.002749s)
#
#taos> show mnodes
# -> ;
# id | end_point | role | create_time |
#=====================================================================================
# 1 | ubuntu-OptiPlex-7060:7100 | master | 2020-07-22 06:25:31.677 |
#Query OK, 1 row(s) in set (0.002126s)
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c 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 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 dnode1 -c numOfTotalVnodes -v 256
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 256
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 256
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 256
#system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
#system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1
#system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1
#system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1
#system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 256
#system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 256
#system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 256
#system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 256
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 2
system sh/cfg.sh -n dnode4 -c role -v 2
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5000
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 5000
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 5000
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 5000
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator
print ============== step0: start tarbitrator and dnode1
system sh/exec_tarbitrator.sh -s start
system sh/exec.sh -n dnode1 -s start
print ============== step2: start dnode2/dnode3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep 1000
sql connect
print ============== step1: add dnode2/dnode3 into cluster
sql create dnode $hostname2
sql create dnode $hostname3
sleep 3000
sleep 3000
print ============== step3: start back client-01.sim
run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
#run_back unique/clusterSimCase/client-01.sim
sleep 20000
$db = db
sql use $db
$loop_cnt = 0
loop_cluster_do:
print **** **** **** START loop cluster do (loop_cnt: $loop_cnt )**** **** **** ****
print ============== step4: stop dnode3
system sh/exec.sh -n dnode3 -s stop -x SIGINT
$checkCnt = 0
wait_vgroup_chang_0:
$checkCnt = $checkCnt + 1
if $loopCnt == 10 then
return -1
endi
print show vgroups
sql show vgroups
#if $rows != 4 then
# print rows: $rows
# sleep 2000
# goto wait_vgroup_chang_0
#endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$vg2Dnode3Status = $data5_2
$vg2Dnode2Status = $data7_2
if $vg2Dnode3Status != offline then
sleep 2000
goto wait_vgroup_chang_0
endi
if $vg2Dnode2Status != master then
sleep 2000
goto wait_vgroup_chang_0
endi
sleep 3000
print ============== step3: restart dnode3
system sh/exec.sh -n dnode3 -s start
$checkCnt = 0
wait_vgroup_chang_1:
$checkCnt = $checkCnt + 1
if $loopCnt == 10 then
return -1
endi
print show vgroups
sql show vgroups
#if $rows != 4 then
# print rows: $rows
# sleep 2000
# goto wait_vgroup_chang_1
#endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$vg2Dnode3Status = $data5_2
$vg2Dnode2Status = $data7_2
if $vg2Dnode3Status != slave then
sleep 2000
goto wait_vgroup_chang_1
endi
if $vg2Dnode2Status != master then
sleep 2000
goto wait_vgroup_chang_1
endi
sleep 3000
print ============== step4: stop dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
$checkCnt = 0
wait_vgroup_chang_2:
$checkCnt = $checkCnt + 1
if $loopCnt == 10 then
return -1
endi
print show vgroups
sql show vgroups
#if $rows != 4 then
# print rows: $rows
# sleep 2000
# goto wait_vgroup_chang_2
#endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$vg2Dnode3Status = $data5_2
$vg2Dnode2Status = $data7_2
if $vg2Dnode3Status != master then
sleep 2000
goto wait_vgroup_chang_2
endi
if $vg2Dnode2Status != offline then
sleep 2000
goto wait_vgroup_chang_2
endi
sleep 3000
print ============== step5: restart dnode2
system sh/exec.sh -n dnode2 -s start
$checkCnt = 0
wait_vgroup_chang_3:
$checkCnt = $checkCnt + 1
if $loopCnt == 10 then
return -1
endi
print show vgroups
sql show vgroups
#if $rows != 4 then
# print rows: $rows
# sleep 2000
# goto wait_vgroup_chang_3
#endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$vg2Dnode3Status = $data5_2
$vg2Dnode2Status = $data7_2
if $vg2Dnode2Status != slave then
sleep 2000
goto wait_vgroup_chang_3
endi
if $vg2Dnode3Status != master then
sleep 2000
goto wait_vgroup_chang_3
endi
sleep 3000
print **** **** **** (loop_cnt: $loop_cnt ) end, continue...... **** **** **** ****
$loop_cnt = $loop_cnt + 1
goto loop_cluster_do
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册