Merge pull request #19663 from taosdata/fix/TD-21873-3.0
test: check result after reboot without commit for tsma/rsma
This commit is contained in:
commit
6316a98435
|
@ -81,8 +81,60 @@ if $data01 != 10 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#===================================================================
|
#===================================================================
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
print =============== wait maxdelay 15+2 seconds for results after reboot
|
||||||
|
sleep 17000
|
||||||
|
|
||||||
#==================== reboot to trigger commit data to file
|
print =============== select * from retention level 2 from memory after reboot
|
||||||
|
sql select * from ct1;
|
||||||
|
print $data00 $data01
|
||||||
|
if $rows > 2 then
|
||||||
|
print retention level 2 file rows $rows > 2
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
if $data01 != 1 then
|
||||||
|
if $data01 != 10 then
|
||||||
|
print =============> $data01
|
||||||
|
print retention level 2 file result $data01 != 1 or 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from retention level 1 from memory after reboot
|
||||||
|
sql select * from ct1 where ts > now-8d;
|
||||||
|
print $data00 $data01
|
||||||
|
if $rows > 2 then
|
||||||
|
print retention level 1 file rows $rows > 2
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 1 then
|
||||||
|
if $data01 != 10 then
|
||||||
|
print retention level 1 file result $data01 != 1 or 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from retention level 0 from memory after reboot
|
||||||
|
sql select * from ct1 where ts > now-3d;
|
||||||
|
print $data00 $data01
|
||||||
|
print $data10 $data11
|
||||||
|
print $data20 $data21
|
||||||
|
|
||||||
|
if $rows < 1 then
|
||||||
|
print retention level 0 file rows $rows < 1
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 10 then
|
||||||
|
print retention level 0 file result $data01 != 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
#==================== flush database to trigger commit data to file
|
||||||
sql flush database d0;
|
sql flush database d0;
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
|
@ -82,9 +82,62 @@ if $data01 != 10 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#===================================================================
|
#===================================================================
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
print =============== wait maxdelay 5+2 seconds for results after reboot
|
||||||
|
sleep 7000
|
||||||
|
|
||||||
|
print =============== select * from retention level 2 from memory after reboot
|
||||||
|
sql select * from ct1;
|
||||||
|
print $data00 $data01 $data02
|
||||||
|
print $data10 $data11 $data12
|
||||||
|
if $rows > 2 then
|
||||||
|
print retention level 2 file rows $rows > 2
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
#==================== reboot to trigger commit data to file
|
if $data01 != 100 then
|
||||||
|
if $data01 != 10 then
|
||||||
|
print retention level 2 file result $data01 != 100 or 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from retention level 1 from memory after reboot
|
||||||
|
sql select * from ct1 where ts > now-8d;
|
||||||
|
print $data00 $data01 $data02
|
||||||
|
print $data10 $data11 $data12
|
||||||
|
if $rows > 2 then
|
||||||
|
print retention level 1 file rows $rows > 2
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 100 then
|
||||||
|
if $data01 != 10 then
|
||||||
|
print retention level 1 file result $data01 != 100 or 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from retention level 0 from memory after reboot
|
||||||
|
sql select * from ct1 where ts > now-3d;
|
||||||
|
print $data00 $data01 $data02
|
||||||
|
print $data10 $data11 $data12
|
||||||
|
print $data20 $data21 $data22
|
||||||
|
|
||||||
|
if $rows < 1 then
|
||||||
|
print retention level 0 file rows $rows < 1
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data01 != 10 then
|
||||||
|
print retention level 0 file result $data01 != 10
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
#==================== flush database to trigger commit data to file
|
||||||
sql flush database d0;
|
sql flush database d0;
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
|
@ -136,7 +136,76 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 50
|
sleep 50
|
||||||
|
|
||||||
|
print =============== select * from ct1 from memory after reboot
|
||||||
|
sql select * from ct1;
|
||||||
|
print $data00 $data01 $data02 $data03
|
||||||
|
print $data10 $data11 $data12 $data13
|
||||||
|
print $data20 $data21 $data22 $data23
|
||||||
|
print $data30 $data31 $data32 $data33
|
||||||
|
print $data40 $data41 $data42 $data43
|
||||||
|
if $rows != 5 then
|
||||||
|
print rows $rows != 5
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from stb from memory in designated vgroup after reboot
|
||||||
|
sql select _wstart, _wend, min(c1),max(c2),max(c1) from stb interval(5m,10s) sliding(5m);
|
||||||
|
print $data00 $data01 $data02 $data03 $data04
|
||||||
|
print $data10 $data11 $data12 $data13 $data14
|
||||||
|
if $rows != 1 then
|
||||||
|
print rows $rows != 1
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data02 != -13 then
|
||||||
|
print data02 $data02 != -13
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data03 != 20.00000 then
|
||||||
|
print data03 $data03 != 20.00000
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data04 != 20 then
|
||||||
|
print data04 $data04 != 20
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== select * from stb from memory in common vgroups after reboot
|
||||||
|
sql select _wstart, _wend, min(c1),max(c2),max(c1),max(c3) from stb interval(5m,10s) sliding(5m);
|
||||||
|
print $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
|
if $rows != 1 then
|
||||||
|
print rows $rows != 1
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data02 != -13 then
|
||||||
|
print data02 $data02 != -13
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data03 != 20.00000 then
|
||||||
|
print data03 $data03 != 20.00000
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data04 != 20 then
|
||||||
|
print data04 $data04 != 20
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data05 != 30.000000000 then
|
||||||
|
print data05 $data05 != 30.000000000
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
#==================== flush database to trigger commit data to file
|
||||||
|
sql flush database d1;
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sleep 50
|
||||||
print =============== select * from ct1 from file
|
print =============== select * from ct1 from file
|
||||||
sql select * from ct1;
|
sql select * from ct1;
|
||||||
print $data00 $data01 $data02 $data03
|
print $data00 $data01 $data02 $data03
|
||||||
|
|
Loading…
Reference in New Issue