delete_part.sim 5.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
system sh/stop_dnodes.sh
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

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

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

system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 0

system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8
system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 8
system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 8
system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 8

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

print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start

$x = 0
step1: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2

if $data4_1 != ready then
  goto step1
endi
if $data4_2 != ready then
  goto step1
endi

$loop = 0
begin:

    $db = db . $loop
	
	print ======== step1 $loop
	sql create database $db
	sql use $db
	
	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 )

	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 )

	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 )

	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 )

	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 )

	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 )

	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 )

	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 )

	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

	print ======== step2 $loop
	
	system sh/exec.sh -n dnode2 -s stop
	print ==> drop database $db 
	sql drop database $db 
	
	print ======== step3 $loop
	sleep 2000
	system sh/exec.sh -n dnode2 -s start


	$x = 0
	step3: 
		$x = $x + 1
		sleep 1000
		if $x == 10 then
			return -1
		endi

	sql show dnodes -x step3
	print dnode1 openVnodes $data2_1 $data4_1
	print dnode2 openVnodes $data2_2 $data4_2
	if $data2_1 != 0 then
		goto step3
	endi
	if $data2_2 != 0 then
		goto step3
	endi
	if $data4_1 != ready then
		goto step3
	endi
	if $data4_2 != ready then
		goto step3
	endi
	
	print ===> test times : $loop
    if $loop > 3 then	  
	  return 0
	endi

	$loop = $loop + 1

	sql reset query cache
	sleep 100
	
goto begin
  
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