From 2ab6298003e6d0904126584bf19f75eec53baf4b Mon Sep 17 00:00:00 2001 From: Hui Li Date: Tue, 16 Jun 2020 19:34:19 +0800 Subject: [PATCH] [modify] --- .../arbitrator/dn2_mn1_cache_file_sync.sim | 77 +++++++++++++++---- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim index cfd992db3a..2620746d38 100644 --- a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim +++ b/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim @@ -1,11 +1,11 @@ # Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode # step 1: start dnode1 # step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode) -# step 3: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841) -# step 4: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc -# step 5: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2 -# step 6: insert two data rows: now-21d, now-41d -# step 7: restart dnode2, waiting sync end +# step 2: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841) +# step 3: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc +# step 4: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2 +# step 5: insert two data rows: now-21d, now-41d +# step 6: restart dnode2, waiting sync end # expect: in dnode2, the files 1837 and 1839 will be removed system sh/stop_dnodes.sh @@ -113,15 +113,15 @@ sql insert into $tb values ( now - 20d , -20 ) sql insert into $tb values ( now - 40d , -40 ) $totalRows = $totalRows + 2 -print ============== step4: stop dnode2, so date rows falling disc, generate two new files in dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT +print ============== step4: stop dnode3, so date rows falling disc, generate two new files in dnode3 +system sh/exec.sh -n dnode3 -s stop -x SIGINT sleep $sleepTimer -wait_dnode2_offline: +wait_dnode3_offline: sql show dnodes if $rows != 3 then sleep 2000 - goto wait_dnode2_offline + goto wait_dnode3_offline endi print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 @@ -135,13 +135,13 @@ $dnode3Status = $data4_3 #$dnode4Status = $data4_4 #$dnode5Status = $data4_5 -if $dnode2Status != offline then +if $dnode3Status != offline then sleep 2000 - goto wait_dnode2_offline + goto wait_dnode3_offline endi -if $dnode3Status != ready then +if $dnode2Status != ready then sleep 2000 - goto wait_dnode2_offline + goto wait_dnode3_offline endi sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3 @@ -152,6 +152,12 @@ if $data00 != $totalRows then return -1 endi +system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l +print ---->dnode3 data files: $system_content , expect is 9 +#if $system_content != @9@ then +# return -1 +#endi + print ============== step5: insert two data rows: now-16d, now+16d, sql insert into $tb values ( now - 21d , -21 ) sql insert into $tb values ( now - 41d , -41 ) @@ -163,4 +169,47 @@ if $data00 != $totalRows then return -1 endi -print ============== step6: please check there should be 3 file in sim/dnode2/data/vnode/vnode2/tsdb/data/, and 1 file sim/dnode3/data/vnode/vnode2/tsdb/data/ +system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l +print ---->dnode2 data files: $system_content , expect is 3 +#if $system_content != @3@ then +# return -1 +#endi + +print ============== step7: restart dnode3, waiting sync end +system sh/exec.sh -n dnode3 -s start +sleep 3000 + +wait_dnode3_ready: +sql show dnodes +if $rows != 3 then + sleep 2000 + goto wait_dnode3_ready +endi +print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 +print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 +print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 +$dnode1Status = $data4_1 +$dnode2Status = $data4_2 +$dnode3Status = $data4_3 + +if $dnode3Status != ready then + sleep 2000 + goto wait_dnode3_ready +endi + +sql select count(*) from $stb +print data00 $data00 +if $data00 != $totalRows then + return -1 +endi + +system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l +print ---->dnode2 data files: $system_content , expect is 3 +#if $system_content != @3@ then +# return -1 +#endi +system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l +print ---->dnode3 data files: $system_content , expect is 3 +#if $system_content != @3@ then +# return -1 +#endi \ No newline at end of file -- GitLab