| 1 |
# Wait for node $_ndb_nodeid |
| 2 |
# to be in start phase $_start_phase |
| 3 |
# |
| 4 |
# Extend in future to allow 'or greater' |
| 5 |
--echo Waiting for node $_ndb_nodeid to enter start phase $_start_phase |
| 6 |
|
| 7 |
--let $success = 0 |
| 8 |
--let $tmpfile = $MYSQLTEST_VARDIR/tmp/wait_start_phase.txt |
| 9 |
--let $maxtime = 120 |
| 10 |
|
| 11 |
--disable_query_log |
| 12 |
--disable_result_log |
| 13 |
|
| 14 |
# Use temporary table to avoid problems with needing GSL |
| 15 |
# to create non-temporary table, and GSL being unavailable |
| 16 |
# as cluster is restarting |
| 17 |
# |
| 18 |
create temporary table test.tmpfile (txt varchar(200)); |
| 19 |
|
| 20 |
while (! $success) |
| 21 |
{ |
| 22 |
--exec $NDB_MGM -e "$_ndb_nodeid STATUS" > $tmpfile |
| 23 |
eval LOAD DATA INFILE '$tmpfile' INTO TABLE test.tmpfile; |
| 24 |
# select * from test.tmpfile; |
| 25 |
eval select count(1) from test.tmpfile where txt like "%starting (Last completed phase $_start_phase)%" into @match_count; |
| 26 |
|
| 27 |
--let $success = query_get_value(select @match_count as m, m, 1) |
| 28 |
delete from test.tmpfile; |
| 29 |
--sleep 1 |
| 30 |
--dec $maxtime |
| 31 |
if (!$maxtime) |
| 32 |
{ |
| 33 |
--echo "Timeout waiting for $_ndb_nodeid to enter start phase $_start_phase" |
| 34 |
die "Timeout waiting for startphase"; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
drop table test.tmpfile; |
| 39 |
--remove_file $tmpfile |
| 40 |
|
| 41 |
--enable_query_log |
| 42 |
--enable_result_log |
| 43 |
|