balance1_bug.sim 15.9 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 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

system sh/cfg.sh -n dnode1 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 3

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

system sh/cfg.sh -n dnode1 -c clog -v 1
system sh/cfg.sh -n dnode2 -c clog -v 1
system sh/cfg.sh -n dnode3 -c clog -v 1
system sh/cfg.sh -n dnode4 -c clog -v 1

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

print ============== step1
print ========= start dnode1
S
scripts  
slguan 已提交
29
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
sql connect

sql create database c_b1_d1 tables 4
sql use c_b1_d1

sql create table c_b1_t1 (t timestamp, i int)
sql insert into c_b1_t1 values(now+1s, 15)
sql insert into c_b1_t1 values(now+2s, 14)
sql insert into c_b1_t1 values(now+2s, 13)
sql insert into c_b1_t1 values(now+3s, 12)
sql insert into c_b1_t1 values(now+4s, 11)

sql create database c_b1_d2 tables 4
sql use c_b1_d2
sql create table c_b1_t2 (t timestamp, i int)
sql insert into c_b1_t2 values(now+1s, 25)
sql insert into c_b1_t2 values(now+2s, 24)
sql insert into c_b1_t2 values(now+3s, 23)
sql insert into c_b1_t2 values(now+4s, 22)
sql insert into c_b1_t2 values(now+5s, 21)

sql show dnodes
S
scripts  
slguan 已提交
52
$dnode1Vnodes = $data2_1
S
slguan 已提交
53
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
54
$dnode2Vnodes = $data2_2
S
slguan 已提交
55
print dnode2 $dnode2Vnodes
S
slguan 已提交
56 57 58 59 60 61 62 63 64 65 66

if $dnode1Vnodes != 2 then
  return -1
endi
if $dnode2Vnodes != null then
  return -1
endi

print ============================== step2
print ========= start dnode2
sleep 2000
S
slguan 已提交
67
sql create dnode $hostname2
S
scripts  
slguan 已提交
68
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
69 70 71 72 73 74 75 76 77 78
sleep 5000

$x = 0
show2: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show2
S
scripts  
slguan 已提交
79
$dnode1Vnodes = $data2_1
S
slguan 已提交
80
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
81
$dnode2Vnodes = $data2_2
S
slguan 已提交
82
print dnode2 $dnode2Vnodes
S
slguan 已提交
83 84 85 86 87 88 89 90 91

if $dnode1Vnodes != 3 then
  goto show2
endi
if $dnode2Vnodes != 3 then
  goto show2
endi

sql show mnodes
S
scripts  
slguan 已提交
92 93 94 95
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
96 97 98 99
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
100 101 102 103 104 105 106 107 108 109 110 111 112 113

print ============================== step3
print ========= add db3
sql create database c_b1_d3 tables 4
sql use c_b1_d3
sql create table c_b1_t3 (t timestamp, i int)
sql insert into c_b1_t3 values(now+1s, 35)
sql insert into c_b1_t3 values(now+2s, 34)
sql insert into c_b1_t3 values(now+3s, 33)
sql insert into c_b1_t3 values(now+4s, 32)
sql insert into c_b1_t3 values(now+5s, 31)

print ============================== step4
print ========= drop dnode2
S
slguan 已提交
114
sql drop dnode $hostname2
S
slguan 已提交
115 116 117 118 119 120 121 122 123 124
sleep 9000

$x = 0
show4: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show4
S
scripts  
slguan 已提交
125
$dnode1Vnodes = $data2_1
S
slguan 已提交
126
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
127
$dnode2Vnodes = $data2_2
S
slguan 已提交
128
print dnode2 $dnode2Vnodes
S
slguan 已提交
129 130 131 132 133 134 135 136 137

if $dnode1Vnodes != 1 then
  goto show4
endi
if $dnode2Vnodes != null then
  goto show4
endi

sql show mnodes
S
scripts  
slguan 已提交
138 139 140 141
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
142 143 144 145
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
146 147 148

print ============================== step5
print ========= add dnode2
S
scripts  
slguan 已提交
149
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
S
slguan 已提交
150
sleep 5000
S
scripts  
slguan 已提交
151
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
152
sql create dnode $hostname2
S
slguan 已提交
153 154 155 156 157 158 159 160 161 162
sleep 9000

$x = 0
show5: 
	$x = $x + 1
	sleep 2000
	if $x == 20 then 
	  return -1
	endi
sql show dnodes -x show5
S
scripts  
slguan 已提交
163
$dnode1Vnodes = $data2_1
S
slguan 已提交
164
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
165
$dnode2Vnodes = $data2_2
S
slguan 已提交
166
print dnode2 $dnode2Vnodes
S
slguan 已提交
167 168 169 170 171 172 173 174 175

if $dnode1Vnodes != 2 then
  goto show5
endi
if $dnode2Vnodes != 3 then
  goto show5
endi

sql show mnodes
S
scripts  
slguan 已提交
176 177 178 179
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
180 181 182 183
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
184 185 186

print ============================== step6
print ========= drop dnode1
S
scripts  
slguan 已提交
187
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
S
slguan 已提交
188 189 190
print stop dnode1 and sleep 10000
sleep 10000

S
slguan 已提交
191
sql drop dnode $hostname1
S
slguan 已提交
192 193 194 195 196 197 198 199 200 201 202
print drop dnode1 and sleep 9000
sleep 9000

$x = 0
show6: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show6
S
scripts  
slguan 已提交
203
$dnode1Vnodes = $data2_1
S
slguan 已提交
204
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
205
$dnode2Vnodes = $data2_2
S
slguan 已提交
206
print dnode2 $dnode2Vnodes
S
slguan 已提交
207 208 209 210 211 212 213 214 215

if $dnode1Vnodes != null then
  goto show6
endi
if $dnode2Vnodes != 1 then
  goto show6
endi

sql show mnodes
S
scripts  
slguan 已提交
216 217 218 219
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
220 221 222 223
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
224 225 226

print ============================== step7
print ========= add dnode1
S
slguan 已提交
227
sql create dnode $hostname1
S
slguan 已提交
228
sleep 23000
S
scripts  
slguan 已提交
229
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
230 231 232 233 234 235 236 237 238 239
sleep 14000

$x = 0
show7: 
	$x = $x + 1
	sleep 2000
	if $x == 20 then 
	  return -1
	endi
sql show dnodes -x show7
S
scripts  
slguan 已提交
240
$dnode1Vnodes = $data2_1
S
slguan 已提交
241
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
242
$dnode2Vnodes = $data2_2
S
slguan 已提交
243
print dnode2 $dnode2Vnodes
S
slguan 已提交
244 245 246 247 248 249 250 251 252

if $dnode1Vnodes != 3 then
  goto show7
endi
if $dnode2Vnodes != 2 then
  goto show7
endi

sql show mnodes
S
scripts  
slguan 已提交
253 254 255 256
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
257 258 259 260
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
261 262 263

print ============================== step8
print ========= drop dnode2
S
scripts  
slguan 已提交
264
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
S
slguan 已提交
265 266
print stop dnode2 and sleep 10000
sleep 20000
S
slguan 已提交
267
sql drop dnode $hostname2
S
slguan 已提交
268 269 270 271 272 273 274 275 276 277 278
print drop dnode2 and sleep 9000
sleep 19000

$x = 0
show8: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show8
S
scripts  
slguan 已提交
279
$dnode1Vnodes = $data2_1
S
slguan 已提交
280
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
281
$dnode2Vnodes = $data2_2
S
slguan 已提交
282
print dnode2 $dnode2Vnodes
S
slguan 已提交
283 284 285 286 287 288 289 290 291

if $dnode1Vnodes != 1 then
  goto show8
endi
if $dnode2Vnodes != null then
  goto show8
endi

sql show mnodes
S
scripts  
slguan 已提交
292 293 294 295
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
296 297 298 299
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
300 301 302 303 304 305 306

if $dnode1Role != master then
  return -1
endi

print ============================== step9
print ========= add dnode2
S
slguan 已提交
307
sql create dnode $hostname2
S
scripts  
slguan 已提交
308
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
309 310 311 312 313 314 315 316 317 318
sleep 9000

$x = 0
show9: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show9
S
scripts  
slguan 已提交
319
$dnode1Vnodes = $data2_1
S
slguan 已提交
320
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
321
$dnode2Vnodes = $data2_2
S
slguan 已提交
322
print dnode2 $dnode2Vnodes
S
slguan 已提交
323 324 325 326 327 328 329 330 331

if $dnode1Vnodes != 2 then
  goto show9
endi
if $dnode2Vnodes != 3 then
  goto show9
endi

sql show mnodes
S
scripts  
slguan 已提交
332 333 334 335
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
336 337 338 339
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359

print ============================== step10
print ========= add db4
sql create database c_b1_d4 tables 4
sql use c_b1_d4
sql create table c_b1_t4 (t timestamp, i int)
sql insert into c_b1_t4 values(now+1s, 45)
sql insert into c_b1_t4 values(now+2s, 44)
sql insert into c_b1_t4 values(now+3s, 43)
sql insert into c_b1_t4 values(now+4s, 42)
sql insert into c_b1_t4 values(now+5s, 41)

$x = 0
show10: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show10
S
scripts  
slguan 已提交
360
$dnode1Vnodes = $data2_1
S
slguan 已提交
361
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
362
$dnode2Vnodes = $data2_2
S
slguan 已提交
363
print dnode2 $dnode2Vnodes
S
slguan 已提交
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378

if $dnode1Vnodes != 2 then
   goto show10
endi
if $dnode2Vnodes != 2 then
   goto show10
endi

sql use c_b1_d3
sql insert into c_b1_t3 values(now+1s, 35)

sql use c_b1_d2
sql insert into c_b1_t2 values(now+1s, 25)

sql show mnodes
S
scripts  
slguan 已提交
379 380
$dnode1Role = $data2_1
$dnode2Role = $data2_2
S
slguan 已提交
381 382
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
S
slguan 已提交
383 384 385 386 387 388 389 390

if $dnode1Role != master then
  return -1
endi

print ============================== step11
print ========= drop dnode2
sleep 2000
S
slguan 已提交
391
sql drop dnode $hostname2
S
slguan 已提交
392 393 394 395 396 397 398 399 400 401
sleep 9000

$x = 0
show11: 
	$x = $x + 1
	sleep 2000
	if $x == 20 then 
	  return -1
	endi
sql show dnodes -x show11
S
scripts  
slguan 已提交
402
$dnode1Vnodes = $data2_1
S
slguan 已提交
403
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
404
$dnode2Vnodes = $data2_2
S
slguan 已提交
405
print dnode2 $dnode2Vnodes
S
slguan 已提交
406 407 408 409 410 411 412 413 414

if $dnode1Vnodes != 0 then
   goto show11
endi
if $dnode2Vnodes != null then
   goto show11
endi

sql show mnodes
S
scripts  
slguan 已提交
415 416 417 418
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
419 420 421 422
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
423

S
scripts  
slguan 已提交
424
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
S
slguan 已提交
425 426 427 428 429 430 431 432 433 434 435 436

print ============================== step12
print ========= add db5
sql create database c_b1_d5 tables 4
sql use c_b1_d5
sql create table c_b1_t5 (t timestamp, i int) -x error3
print no enough vnodes, but create success
return -1
error3:

print ============================== step13
print ========= add dnode2
S
slguan 已提交
437
sql create dnode $hostname2
S
scripts  
slguan 已提交
438
system sh/exec_up.sh -n dnode2 -s start
S
slguan 已提交
439 440 441
sleep 9000

sql show mnodes
S
scripts  
slguan 已提交
442 443 444 445
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
446 447 448 449
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482

sql use c_b1_d5;
$x = 0
create5: 
	$x = $x + 1
	sleep 1000
	if $x == 50 then
	  return -1
	endi
sql create table c_b1_t5 (t timestamp, i int) -x create5
sql insert into c_b1_t5 values(now+1s, 55)
sql insert into c_b1_t5 values(now+2s, 54)
sql insert into c_b1_t5 values(now+3s, 53)
sql insert into c_b1_t5 values(now+4s, 52)
sql insert into c_b1_t5 values(now+5s, 51)

sql create database c_b1_d6
sql use c_b1_d6
$x = 0
create6: 
	$x = $x + 1
	sleep 1000
	if $x == 50 then
	  return -1
	endi
sql create table c_b1_t6 (t timestamp, i int)  -x create6
sql insert into c_b1_t6 values(now+1s, 65)
sql insert into c_b1_t6 values(now+2s, 64)
sql insert into c_b1_t6 values(now+3s, 63)
sql insert into c_b1_t6 values(now+4s, 62)
sql insert into c_b1_t6 values(now+5s, 61)

sql show dnodes
S
scripts  
slguan 已提交
483
$dnode1Vnodes = $data2_1
S
slguan 已提交
484
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
485
$dnode2Vnodes = $data2_2
S
slguan 已提交
486
print dnode2 $dnode2Vnodes
S
slguan 已提交
487 488 489 490 491 492 493 494 495 496 497 498

#if $dnode1Vnodes != 1 then
#  return -1
#endi
#if $dnode2Vnodes != 1 then
#  return -1
#endi

print ============================== step14
print ========= add dnode3

sql show mnodes
S
scripts  
slguan 已提交
499 500 501 502
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
503 504 505 506
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
507 508

sleep 2000
S
slguan 已提交
509
sql create dnode $hostname3
S
scripts  
slguan 已提交
510
system sh/exec_up.sh -n dnode3 -s start
S
slguan 已提交
511 512 513 514 515 516 517 518 519 520
sleep 15000

$x = 0
show14: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show14
S
scripts  
slguan 已提交
521
$dnode1Vnodes = $data2_1
S
slguan 已提交
522
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
523
$dnode2Vnodes = $data2_2
S
slguan 已提交
524
print dnode2 $dnode2Vnodes
S
scripts  
slguan 已提交
525
$dnode3Vnodes = $data2_3
S
slguan 已提交
526
print dnode3 $dnode3Vnodes
S
slguan 已提交
527 528 529 530 531 532 533 534 535 536 537 538

if $dnode1Vnodes != 2 then
  goto show14
endi
if $dnode2Vnodes != 2 then
  goto show14
endi
if $dnode3Vnodes != 2 then
  goto show14
endi

sql show mnodes
S
scripts  
slguan 已提交
539 540 541
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
S
slguan 已提交
542 543 544
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
S
slguan 已提交
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567

print ============================== step15
print ========= create db7 db8

sql create database c_b1_d7 tables 4
sql use c_b1_d7
sql create table c_b1_t7 (t timestamp, i int)
sql insert into c_b1_t7 values(now+1s, 75)
sql insert into c_b1_t7 values(now+2s, 74)
sql insert into c_b1_t7 values(now+3s, 73)
sql insert into c_b1_t7 values(now+4s, 72)
sql insert into c_b1_t7 values(now+5s, 71)

sql create database c_b1_d8
sql use c_b1_d8
sql create table c_b1_t8 (t timestamp, i int)
sql insert into c_b1_t8 values(now+1s, 85)
sql insert into c_b1_t8 values(now+2s, 84)
sql insert into c_b1_t8 values(now+3s, 83)
sql insert into c_b1_t8 values(now+4s, 82)
sql insert into c_b1_t8 values(now+5s, 81)

sql show mnodes
S
scripts  
slguan 已提交
568 569 570 571
$dnode1Role = $data2_1
$dnode2Role = $data2_2
$dnode3Role = $data2_3
$dnode4Role = $data2_4
S
slguan 已提交
572 573 574 575
print dnode1 ==> $dnode1Role
print dnode2 ==> $dnode2Role
print dnode3 ==> $dnode3Role
print dnode4 ==> $dnode4Role
S
slguan 已提交
576 577 578

print ========== add dnode4
sleep 2000
S
slguan 已提交
579 580
sql create dnode $hostname4
print sql create dnode $hostname4 over
S
scripts  
slguan 已提交
581
system sh/exec_up.sh -n dnode4 -s start
S
slguan 已提交
582 583 584 585 586 587 588 589 590 591 592 593
print sleep 12000
sleep 12000
print sleep 12000 over

$x = 0
show15: 
	$x = $x + 1
	sleep 2000
	if $x == 15 then 
	  return -1
	endi
sql show dnodes -x show15
S
scripts  
slguan 已提交
594
$dnode1Vnodes = $data2_1
S
slguan 已提交
595
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
596
$dnode2Vnodes = $data2_2
S
slguan 已提交
597
print dnode2 $dnode2Vnodes
S
scripts  
slguan 已提交
598
$dnode3Vnodes = $data2_3
S
slguan 已提交
599
print dnode3 $dnode3Vnodes
S
scripts  
slguan 已提交
600
$dnode4Vnodes = $data2_4
S
slguan 已提交
601
print dnode4 $dnode4Vnodes
S
slguan 已提交
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618

if $dnode1Vnodes != 2 then
  goto show15
endi
if $dnode2Vnodes != 2 then
  goto show15
endi
if $dnode3Vnodes != 2 then
  goto show15
endi
if $dnode4Vnodes != 2 then
  goto show15
endi

print ============================== step16
print ========= drop dnode4, create db9

S
slguan 已提交
619
sql drop dnode $hostname4
S
slguan 已提交
620 621 622 623 624 625 626 627 628 629
sleep 10000
sql create database c_b1_d9 tables 4
sql use c_b1_d9
sql create table c_b1_t9 (t timestamp, i int)
sql insert into c_b1_t9 values(now+1s, 95)
sql insert into c_b1_t9 values(now+2s, 94)
sql insert into c_b1_t9 values(now+3s, 93)
sql insert into c_b1_t9 values(now+4s, 92)
sql insert into c_b1_t9 values(now+5s, 91)

S
scripts  
slguan 已提交
630
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
S
slguan 已提交
631 632 633 634 635 636 637 638 639

$x = 0
show16: 
	$x = $x + 1
	sleep 2000
	if $x == 30 then
	  return -1
	endi
sql show dnodes -x show16
S
scripts  
slguan 已提交
640
$dnode1Vnodes = $data2_1
S
slguan 已提交
641
print dnode1 $dnode1Vnodes
S
scripts  
slguan 已提交
642
$dnode2Vnodes = $data2_2
S
slguan 已提交
643
print dnode2 $dnode2Vnodes
S
scripts  
slguan 已提交
644
$dnode3Vnodes = $data2_3
S
slguan 已提交
645
print dnode3 $dnode3Vnodes
S
slguan 已提交
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782

if $dnode1Vnodes != 1 then
  goto show16
endi
if $dnode2Vnodes != 1 then
  goto show16
endi
if $dnode3Vnodes != 1 then
  goto show16
endi

print ============================== step17
print ========= check data

sleep 2000

sql use c_b1_d1
sql select * from c_b1_t1 order by t desc -x s1
s1:

sql use c_b1_d2
sql select * from c_b1_t2 order by t desc -x s2
print $data01 $data11 $data21 $data31 $data41

if $data01 != 25 then
  return -1
endi

if $data11 != 21 then
  return -1
endi
if $data21 != 22 then
  return -1
endi
if $data31 != 23 then
  return -1
endi
if $data41 != 24 then
  return -1
endi
s2:

sql use c_b1_d3
sql select * from c_b1_t3 order by t desc -x s3
print $data01 $data11 $data21 $data31 $data41
if $data01 != 35 then
  return -1
endi
s3:

sql use c_b1_d4
sql select * from c_b1_d4.c_b1_t4 order by t desc -x s4
print $data01 $data11 $data21 $data31 $data41
s4:


sql use c_b1_d5
sql select * from c_b1_d5.c_b1_t5 order by t desc -x s5
print $data01 $data11 $data21 $data31 $data41
if $data01 != 51 then
  return -1
endi
if $data11 != 52 then
  return -1
endi
if $data21 != 53 then
  return -1
endi
if $data31 != 54 then
  return -1
endi
if $data41 != 55 then
  return -1
endi
s5:

sql use c_b1_d6
sql select * from c_b1_d6.c_b1_t6 order by t desc -x s6
print $data01 $data11 $data21 $data31 $data41
if $data01 != 61 then
  return -1
endi
if $data11 != 62 then
  return -1
endi
if $data21 != 63 then
  return -1
endi
if $data31 != 64 then
  return -1
endi
if $data41 != 65 then
  return -1
endi
s6:

sql use c_b1_d7
sql select * from c_b1_d7.c_b1_t7 order by t desc -x s7
print $data01 $data11 $data21 $data31 $data41
if $data01 != 71 then
  return -1
endi
if $data11 != 72 then
  return -1
endi
if $data21 != 73 then
  return -1
endi
if $data31 != 74 then
  return -1
endi
if $data41 != 75 then
  return -1
endi
s7:

sql use c_b1_d9
sql select * from c_b1_t9 order by t desc -x s8
print $data01 $data11 $data21 $data31 $data41
if $data01 != 91 then
  return -1
endi
if $data11 != 92 then
  return -1
endi
if $data21 != 93 then
  return -1
endi
if $data31 != 94 then
  return -1
endi
if $data41 != 95 then
  return -1
endi
s8:

print ============================================ over
S
scripts  
slguan 已提交
783 784 785 786
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
S
slguan 已提交
787 788 789