system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start sql connect print =============== create database sql create database db duration 300 keep 365000d,365000d,365000d sql show databases if $rows != 3 then return -1 endi print $data00 $data01 $data02 sql use db sql create table stb1(ts timestamp, c6 double) tags (t1 int); sql create table ct1 using stb1 tags ( 1 ); sql create table ct2 using stb1 tags ( 2 ); sql create table ct3 using stb1 tags ( 3 ); sql create table ct4 using stb1 tags ( 4 ); sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0); sql insert into ct4 values ('2022-04-28 18:30:27.002', 0.0); sql insert into ct1 values ('2022-05-01 18:30:17.003', 11.11); sql insert into ct4 values ('2022-02-01 18:30:27.004', 11.11); sql insert into ct1 values ('2022-05-01 18:30:07.005', 22.22); sql insert into ct4 values ('2021-11-01 18:30:27.006', 22.22); sql insert into ct1 values ('2022-05-01 18:29:27.007', 33.33); sql insert into ct4 values ('2022-08-01 18:30:27.008', 33.33); sql insert into ct1 values ('2022-05-01 18:20:27.009', 44.44); sql insert into ct4 values ('2021-05-01 18:30:27.010', 44.44); sql insert into ct1 values ('2022-05-01 18:21:27.011', 55.55); sql insert into ct4 values ('2021-01-01 18:30:27.012', 55.55); sql insert into ct1 values ('2022-05-01 18:22:27.013', 66.66); sql insert into ct4 values ('2020-06-01 18:30:27.014', 66.66); sql insert into ct1 values ('2022-05-01 18:28:37.015', 77.77); sql insert into ct4 values ('2020-05-01 18:30:27.016', 77.77); sql insert into ct1 values ('2022-05-01 18:29:17.017', 88.88); sql insert into ct4 values ('2019-05-01 18:30:27.018', 88.88); sql insert into ct1 values ('2022-05-01 18:30:20.019', 0); sql insert into ct1 values ('2022-05-01 18:30:47.020', -99.99); sql insert into ct1 values ('2022-05-01 18:30:49.021', NULL); sql insert into ct1 values ('2022-05-01 18:30:51.022', -99.99); sql insert into ct4 values ('2018-05-01 18:30:27.023', NULL) ; sql insert into ct4 values ('2021-03-01 18:30:27.024', NULL) ; sql insert into ct4 values ('2022-08-01 18:30:27.025', NULL) ; print =============== select * from ct1 - memory sql select * from stb1; if $rows != 25 then print rows = $rows != 25 return -1 endi print =============== stop and restart taosd $reboot_max = 10; $reboot_cnt = 0 reboot_and_check: system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt sql use db sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0); sql insert into ct4 values ('2022-04-28 18:30:27.002', 0.0); sql insert into ct1 values ('2022-05-01 18:30:17.003', 11.11); sql insert into ct4 values ('2022-02-01 18:30:27.004', 11.11); sql insert into ct1 values ('2022-05-01 18:30:07.005', 22.22); sql insert into ct4 values ('2021-11-01 18:30:27.006', 22.22); sql insert into ct1 values ('2022-05-01 18:29:27.007', 33.33); sql insert into ct4 values ('2022-08-01 18:30:27.008', 33.33); sql insert into ct1 values ('2022-05-01 18:20:27.009', 44.44); sql insert into ct4 values ('2021-05-01 18:30:27.010', 44.44); sql insert into ct1 values ('2022-05-01 18:21:27.011', 55.55); sql insert into ct4 values ('2021-01-01 18:30:27.012', 55.55); sql insert into ct1 values ('2022-05-01 18:22:27.013', 66.66); sql insert into ct4 values ('2020-06-01 18:30:27.014', 66.66); sql insert into ct1 values ('2022-05-01 18:28:37.015', 77.77); sql insert into ct4 values ('2020-05-01 18:30:27.016', 77.77); sql insert into ct1 values ('2022-05-01 18:29:17.017', 88.88); sql insert into ct4 values ('2019-05-01 18:30:27.018', 88.88); sql insert into ct1 values ('2022-05-01 18:30:20.019', 0); sql insert into ct1 values ('2022-05-01 18:30:47.020', -99.99); sql insert into ct1 values ('2022-05-01 18:30:49.021', NULL); sql insert into ct1 values ('2022-05-01 18:30:51.022', -99.99); sql insert into ct4 values ('2018-05-01 18:30:27.023', NULL) ; sql insert into ct4 values ('2021-03-01 18:30:27.024', NULL) ; sql insert into ct4 values ('2022-08-01 18:30:27.025', NULL) ; print =============== select * from ct1 - merge memory and file - loop $reboot_max - $reboot_cnt sql select * from ct1; if $rows != 13 then print rows = $rows != 13 return -1 endi print $data[0][0] $data[0][1] print $data[1][0] $data[1][1] print $data[2][0] $data[2][1] print $data[3][0] $data[3][1] print $data[4][0] $data[4][1] print $data[5][0] $data[5][1] print $data[6][0] $data[6][1] print $data[7][0] $data[7][1] print $data[8][0] $data[8][1] print $data[9][0] $data[9][1] print $data[10][0] $data[10][1] print $data[11][0] $data[11][1] print $data[12][0] $data[12][1] if $data[0][1] != 44.440000000 then print $data[0][1] != 44.440000000 return -1 endi if $data[1][1] != 55.550000000 then print $data[1][1] != 55.550000000 return -1 endi if $data[2][1] != 66.660000000 then print $data[2][1] != 66.660000000 return -1 endi if $data[3][1] != 77.770000000 then print $data[3][1] != 77.770000000 return -1 endi if $data[4][1] != 88.880000000 then print $data[4][1] != 88.880000000 return -1 endi if $data[5][1] != 33.330000000 then print $data[5][1] != 33.330000000 return -1 endi if $data[6][1] != 22.220000000 then print $data[6][1] != 22.220000000 return -1 endi if $data[7][1] != 11.110000000 then print $data[7][1] != 11.110000000 return -1 endi if $data[8][1] != 0.000000000 then print $data[8][1] != 0.000000000 return -1 endi if $data[9][1] != 0.000000000 then print $data[9][1] != 0.000000000 return -1 endi if $data[10][1] != -99.990000000 then print $data[10][1] != -99.990000000 return -1 endi if $data[11][1] != NULL then print $data[11][1] != NULL return -1 endi if $data[12][1] != -99.990000000 then print $data[12][1] != -99.990000000 return -1 endi print =============== select * from ct4 - merge memory and file - loop $reboot_max - $reboot_cnt sql select * from ct4; if $rows != 12 then print rows = $rows != 12 return -1 endi print $data[0][0] $data[0][1] print $data[1][0] $data[1][1] print $data[2][0] $data[2][1] print $data[3][0] $data[3][1] print $data[4][0] $data[4][1] print $data[5][0] $data[5][1] print $data[6][0] $data[6][1] print $data[7][0] $data[7][1] print $data[8][0] $data[8][1] print $data[9][0] $data[9][1] print $data[10][0] $data[10][1] print $data[11][0] $data[11][1] if $data[0][1] != NULL then print $data[0][1] != NULL return -1 endi if $data[1][1] != 88.880000000 then print $data[1][1] != 88.880000000 return -1 endi if $data[2][1] != 77.770000000 then print $data[2][1] != 77.770000000 return -1 endi if $data[3][1] != 66.660000000 then print $data[3][1] != 66.660000000 return -1 endi if $data[4][1] != 55.550000000 then print $data[4][1] != 55.550000000 return -1 endi if $data[5][1] != NULL then print $data[5][1] != NULL return -1 endi if $data[6][1] != 44.440000000 then print $data[6][1] != 44.440000000 return -1 endi if $data[7][1] != 22.220000000 then print $data[7][1] != 22.220000000 return -1 endi if $data[8][1] != 11.110000000 then print $data[8][1] != 11.110000000 return -1 endi if $data[9][1] != 0.000000000 then print $data[9][1] != 0.000000000 return -1 endi if $data[10][1] != 33.330000000 then print $data[10][1] != 33.330000000 return -1 endi if $data[11][1] != NULL then print $data[11][1] != NULL return -1 endi if $reboot_cnt > $reboot_max then print reboot_cnt $reboot_cnt > reboot_max $reboot_max return 0 else print reboot_cnt $reboot_cnt <= reboot_max $reboot_max $reboot_cnt = $reboot_cnt + 1 goto reboot_and_check endi