提交 768327df 编写于 作者: H Hui Li

[modify sim case]

上级 8b993116
...@@ -93,14 +93,14 @@ if $data00 != $totalRows then ...@@ -93,14 +93,14 @@ if $data00 != $totalRows then
return -1 return -1
endi endi
print ============== step3: stop dnode2, and remove its vnodeX subdirector print ============== step3: stop dnode4, and remove its vnodeX subdirector
system sh/exec.sh -n dnode2 -s stop -x SIGINT system sh/exec.sh -n dnode4 -s stop -x SIGINT
sleep $sleepTimer sleep $sleepTimer
wait_dnode2_offline_0: wait_dnode4_offline_0:
sql show dnodes sql show dnodes
if $rows != 4 then if $rows != 4 then
sleep 2000 sleep 2000
goto wait_dnode2_offline_0 goto wait_dnode4_offline_0
endi endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
...@@ -110,26 +110,49 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 ...@@ -110,26 +110,49 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 #print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1 #$dnode1Status = $data4_1
$dnode2Status = $data4_2 $dnode2Status = $data4_2
#$dnode3Status = $data4_3 $dnode3Status = $data4_3
#$dnode4Status = $data4_4 $dnode4Status = $data4_4
#$dnode5Status = $data4_5 #$dnode5Status = $data4_5
if $dnode2Status != offline then if $dnode4Status != offline then
sleep 2000
goto wait_dnode4_offline_0
endi
wait_dnode4_vgroup_offline:
sql show vgroups
if $rows != 1 then
sleep 2000
goto wait_dnode4_vgroup_offline
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$dnode4Vtatus = $data4_2
$dnode3Vtatus = $data7_2
if $dnode4Vtatus != offline then
sleep 2000
goto wait_dnode4_vgroup_offline
endi
if $dnode3Vtatus != master then
sleep 2000 sleep 2000
goto wait_dnode2_offline_0 goto wait_dnode4_vgroup_offline
endi endi
system rm -rf ../../../sim/dnode2/data/vnode/*
system rm -rf ../../../sim/dnode4/data/vnode/*
sleep 1000 sleep 1000
print ============== step4: restart dnode2, waiting sync end print ============== step4: restart dnode4, waiting sync end
system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode4 -s start
sleep $sleepTimer sleep $sleepTimer
wait_dnode2_reready: wait_dnode4_reready:
sql show dnodes sql show dnodes
if $rows != 4 then if $rows != 4 then
sleep 2000 sleep 2000
goto wait_dnode2_reready goto wait_dnode4_reready
endi endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
...@@ -139,25 +162,49 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 ...@@ -139,25 +162,49 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 #print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1 #$dnode1Status = $data4_1
$dnode2Status = $data4_2 $dnode2Status = $data4_2
#$dnode3Status = $data4_3 $dnode3Status = $data4_3
#$dnode4Status = $data4_4 $dnode4Status = $data4_4
#$dnode5Status = $data4_5 #$dnode5Status = $data4_5
if $dnode2Status != ready then if $dnode4Status != ready then
sleep 2000 sleep 2000
goto wait_dnode2_reready goto wait_dnode4_reready
endi endi
print ============== step5: stop dnode3/dnode4, and check rows wait_dnode4_vgroup_slave:
sql show vgroups
if $rows != 1 then
sleep 2000
goto wait_dnode4_vgroup_slave
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$dnode4Vtatus = $data4_2
$dnode3Vtatus = $data7_2
print dnode4Vtatus: $dnode4Vtatus
print dnode3Vtatus: $dnode3Vtatus
if $dnode4Vtatus != slave then
sleep 2000
goto wait_dnode4_vgroup_slave
endi
if $dnode3Vtatus != master then
sleep 2000
goto wait_dnode4_vgroup_slave
endi
print ============== step5: stop dnode3/dnode2, and check rows
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
sleep $sleepTimer sleep $sleepTimer
wait_dnode34_offline: wait_dnode23_offline:
sql show dnodes sql show dnodes
if $rows != 4 then if $rows != 4 then
sleep 2000 sleep 2000
goto wait_dnode34_offline goto wait_dnode23_offline
endi endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
...@@ -171,17 +218,41 @@ $dnode3Status = $data4_3 ...@@ -171,17 +218,41 @@ $dnode3Status = $data4_3
$dnode4Status = $data4_4 $dnode4Status = $data4_4
#$dnode5Status = $data4_5 #$dnode5Status = $data4_5
if $dnode2Status != ready then if $dnode2Status != offline then
sleep 2000 sleep 2000
goto wait_dnode34_offline goto wait_dnode23_offline
endi endi
if $dnode3Status != offline then if $dnode3Status != offline then
sleep 2000 sleep 2000
goto wait_dnode34_offline goto wait_dnode23_offline
endi endi
if $dnode4Status != offline then if $dnode4Status != ready then
sleep 2000
goto wait_dnode23_offline
endi
wait_dnode4_vgroup_master:
sql show vgroups
if $rows != 1 then
sleep 2000
goto wait_dnode4_vgroup_master
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$dnode4Vtatus = $data4_2
$dnode3Vtatus = $data7_2
print dnode4Vtatus: $dnode4Vtatus
print dnode3Vtatus: $dnode3Vtatus
if $dnode4Vtatus != master then
sleep 2000
goto wait_dnode4_vgroup_master
endi
if $dnode3Vtatus != offline then
sleep 2000 sleep 2000
goto wait_dnode34_offline goto wait_dnode4_vgroup_master
endi endi
# check using select # check using select
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册