delete_part.sim 5.2 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3 4 5
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
S
slguan 已提交
6

S
scripts  
slguan 已提交
7 8 9 10
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
S
slguan 已提交
11

12 13 14 15
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
S
slguan 已提交
16

S
Shengliang Guan 已提交
17 18 19 20
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
S
slguan 已提交
21 22 23 24 25 26

system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4

S
scripts  
slguan 已提交
27 28 29 30
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
S
slguan 已提交
31 32

print ========= start dnodes
S
Shengliang Guan 已提交
33
system sh/exec.sh -n dnode1 -s start
S
scripts  
Shengliang Guan 已提交
34
sleep 3000
S
slguan 已提交
35
sql connect
S
slguan 已提交
36
sql create dnode $hostname2
S
Shengliang Guan 已提交
37
system sh/exec.sh -n dnode2 -s start
S
slguan 已提交
38 39 40 41 42 43

$loop = 0
begin:

    $db = db . $loop
	
S
scripts  
Shengliang Guan 已提交
44
	print ======== step1 $loop
S
slguan 已提交
45 46 47
	sql create database $db
	sql use $db
	
S
scripts  
Shengliang Guan 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
	sql create table t11 (ts timestamp, i int)
	sql insert into t11 values(now, 1 )
	sql create table t12 (ts timestamp, i int)
	sql insert into t12 values(now, 1 )
	sql create table t13 (ts timestamp, i int)
	sql insert into t13 values(now, 1 )
	sql create table t14 (ts timestamp, i int)
	sql insert into t14 values(now, 1 )
	sleep 1200

	sql create table t21 (ts timestamp, i int)
	sql insert into t21 values(now, 1 )
	sql create table t22 (ts timestamp, i int)
	sql insert into t22 values(now, 1 )
	sql create table t23 (ts timestamp, i int)
	sql insert into t23 values(now, 1 )
	sql create table t24 (ts timestamp, i int)
	sql insert into t24 values(now, 1 )
	sleep 1200

	sql create table t31 (ts timestamp, i int)
	sql insert into t31 values(now, 1 )
	sql create table t32 (ts timestamp, i int)
	sql insert into t32 values(now, 1 )
	sql create table t33 (ts timestamp, i int)
	sql insert into t33 values(now, 1 )
	sql create table t34 (ts timestamp, i int)
	sql insert into t34 values(now, 1 )
	sleep 1200

	sql create table t41 (ts timestamp, i int)
	sql insert into t41 values(now, 1 )
	sql create table t42 (ts timestamp, i int)
	sql insert into t42 values(now, 1 )
	sql create table t43 (ts timestamp, i int)
	sql insert into t43 values(now, 1 )
	sql create table t44 (ts timestamp, i int)
	sql insert into t44 values(now, 1 )
	sleep 1200

	sql create table t51 (ts timestamp, i int)
	sql insert into t51 values(now, 1 )
	sql create table t52 (ts timestamp, i int)
	sql insert into t52 values(now, 1 )
	sql create table t53 (ts timestamp, i int)
	sql insert into t53 values(now, 1 )
	sql create table t54 (ts timestamp, i int)
	sql insert into t54 values(now, 1 )
	sleep 1200

	sql create table t61 (ts timestamp, i int)
	sql insert into t61 values(now, 1 )
	sql create table t62 (ts timestamp, i int)
	sql insert into t62 values(now, 1 )
	sql create table t63 (ts timestamp, i int)
	sql insert into t63 values(now, 1 )
	sql create table t64 (ts timestamp, i int)
	sql insert into t64 values(now, 1 )
	sleep 1200

	sql create table t71 (ts timestamp, i int)
	sql insert into t71 values(now, 1 )
	sql create table t72 (ts timestamp, i int)
	sql insert into t72 values(now, 1 )
	sql create table t73 (ts timestamp, i int)
	sql insert into t73 values(now, 1 )
	sql create table t74 (ts timestamp, i int)
	sql insert into t74 values(now, 1 )
	sleep 1200

	sql create table t81 (ts timestamp, i int)
	sql insert into t81 values(now, 1 )
	sql create table t82 (ts timestamp, i int)
	sql insert into t82 values(now, 1 )
	sql create table t83 (ts timestamp, i int)
	sql insert into t83 values(now, 1 )
	sql create table t84 (ts timestamp, i int)
	sql insert into t84 values(now, 1 )
	sleep 1200

	sql show dnodes
	print dnode1 openVnodes $data2_1
	print dnode2 openVnodes $data2_2
	if $data2_1 != 4 then
		return -1
	endi
	if $data2_2 != 4 then
		return -1
	endi
S
slguan 已提交
137

S
scripts  
Shengliang Guan 已提交
138
	print ======== step2 $loop
S
scripts  
Shengliang Guan 已提交
139
	
S
Shengliang Guan 已提交
140
	system sh/exec.sh -n dnode2 -s stop
S
scripts  
Shengliang Guan 已提交
141
	sleep 1000
S
scripts  
Shengliang Guan 已提交
142
	print ==> drop database $db 
S
slguan 已提交
143 144
	sql drop database $db 
	
S
scripts  
Shengliang Guan 已提交
145
	print ======== step3 $loop
S
scripts  
Shengliang Guan 已提交
146
	sleep 2000
S
Shengliang Guan 已提交
147
	system sh/exec.sh -n dnode2 -s start
S
scripts  
Shengliang Guan 已提交
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
	sleep 15000

	sql show dnodes
	print dnode1 openVnodes $data2_1 $data4_1
	print dnode2 openVnodes $data2_2 $data4_2
	if $data2_1 != 0 then
		return -1
	endi
	if $data2_2 != 0 then
		return -1
	endi
	if $data4_1 != ready then
		return -1
	endi
	if $data4_2 != ready then
		return -1
	endi
S
slguan 已提交
165 166
	
	print ===> test times : $loop
S
scripts  
Shengliang Guan 已提交
167
    if $loop > 3 then	  
S
slguan 已提交
168 169 170 171
	  return 0
	endi

	$loop = $loop + 1
S
scripts  
Shengliang Guan 已提交
172 173 174

	sql reset query cache
	sleep 1000
S
slguan 已提交
175 176 177
	
goto begin
  
S
Shengliang Guan 已提交
178 179 180 181 182 183 184 185
system sh/exec.sh -n dnode1 -s stop  -x SIGINT
system sh/exec.sh -n dnode2 -s stop  -x SIGINT
system sh/exec.sh -n dnode3 -s stop  -x SIGINT
system sh/exec.sh -n dnode4 -s stop  -x SIGINT
system sh/exec.sh -n dnode5 -s stop  -x SIGINT
system sh/exec.sh -n dnode6 -s stop  -x SIGINT
system sh/exec.sh -n dnode7 -s stop  -x SIGINT
system sh/exec.sh -n dnode8 -s stop  -x SIGINT