Commit 5b226ab4 authored by Nuno Carvalho's avatar Nuno Carvalho

BUG#12364404 - UNDETERMINISTIC WAIT LOOP IN WAIT_FOR_NDB_TO_BINLOG.INC

The wait_for_ndb_to_binlog.inc include file used by the blow rpl_tests
common for rpl and rpl_ndb suite is simply doing a "sleep 5", this is
not deterministic and wastes lot of test time uneccessarily. The test
should be rewritten to check if the condition it wait for has been
reached or not.

For NDB engine all events will be added by NDB injector so tests only 
can continue after injector is ready, this test waits for proper
injector thread state.
parent 23f4438e
# ==== Purpose ====
#
# Several test primitives from mysql-test/extra/rpl_tests
# shared for test cases for MyISAM, InnoDB, NDB and other
# engines. But for NDB all events will be added by NDB
# injector and now there are no way to detect the state of
# NDB injector therefore this primitive waits 5 sec
# if engine type is NDB.
# In future that should be fixed by waiting of proper
# state of NDB injector.
# Several test primitives from mysql-test/extra/rpl_tests
# are shared for test cases for MyISAM, InnoDB, NDB and
# other engines.
# For NDB engine all events will be added by NDB injector
# so tests only can continue after injector is ready,
# this test waits for proper injector thread state.
#
# ==== Usage ====
#
......@@ -17,25 +15,12 @@
# ==== Parameters =====
#
# $engine_type
# Type of engine. If type is NDB then it waits $wait_time sec
#
# $wait_time
# Test will wait $wait_time seconds
let $_wait_time= 5;
if (!$wait_time) {
let $_wait_time= $wait_time;
}
# Type of engine. If type is NDB then it waits for injector
# thread proper state.
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
while (!$_wait_time) {
let $_wait_time_internal= 10;
while (!$_wait_time_internal) {
sleep 0.1;
dec $_wait_time_internal;
}
dec $_wait_time;
}
let $show_statement= SHOW PROCESSLIST;
let $field= State;
let $condition= = 'Waiting for event from ndbcluster';
source include/wait_show_condition.inc;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment