homework-jianmu/tests/script/general/cache/restart_table.sim

57 lines
1.2 KiB
Plaintext

system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rt_db
$tbPrefix = ca_rt_tb
$mtPrefix = ca_rt_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed bool)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
sleep 3000
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step4
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $data01 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT