TDengine/tests/script/unique/vnode/replica3_vgroup.sim

71 lines
1.7 KiB
Text
Raw Normal View History

2020-04-19 15:28:22 +00:00
system sh/stop_dnodes.sh
2020-04-29 09:30:03 +00:00
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
2020-05-07 08:08:51 +00:00
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
2020-04-19 15:28:22 +00:00
2020-06-01 05:29:35 +00:00
system sh/exec.sh -n dnode1 -s start
2020-04-19 15:28:22 +00:00
sql connect
2020-05-01 07:22:27 +00:00
sql create dnode $hostname2
sql create dnode $hostname3
2020-06-01 05:29:35 +00:00
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
2021-01-20 05:43:54 +00:00
sleep 2000
2020-04-19 15:28:22 +00:00
$N = 10
$table = table_r3
$db = db1
2021-01-20 05:43:54 +00:00
sleep 2000
2020-04-19 15:28:22 +00:00
print =================== step 1
2020-09-07 07:25:01 +00:00
sql create database $db replica 3
2020-04-19 15:28:22 +00:00
sql use $db
sql create table st (ts timestamp, speed int) tags (t1 int)
sleep 3001
$tbPre = m
2020-05-15 04:00:56 +00:00
$N = 300
2020-04-19 15:28:22 +00:00
$x = 0
$y = $x + $N
while $x < $y
$table = $tbPre . $x
sql create table $table using st tags ( $x )
$ms = $x . m
sql insert into $table values (now + $ms , $x )
$x = $x + 1
endw
#print =================== step 2
2020-05-15 04:00:56 +00:00
$x = -500
$y = $x + $N
while $x < $y
$ms = $x . m
sql insert into $table values (now $ms , $x )
$x = $x + 1
endw
2020-04-19 15:28:22 +00:00
2020-05-15 04:00:56 +00:00
$expect = $N + 1
sql select * from $table
print sql select * from $table -> $rows points expect $expect
if $rows != $expect then
return -1
endi
2020-04-19 15:28:22 +00:00
2020-06-01 05:29:35 +00:00
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