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 ==== # ==== Purpose ====
# #
# Several test primitives from mysql-test/extra/rpl_tests # Several test primitives from mysql-test/extra/rpl_tests
# shared for test cases for MyISAM, InnoDB, NDB and other # are shared for test cases for MyISAM, InnoDB, NDB and
# engines. But for NDB all events will be added by NDB # other engines.
# injector and now there are no way to detect the state of # For NDB engine all events will be added by NDB injector
# NDB injector therefore this primitive waits 5 sec # so tests only can continue after injector is ready,
# if engine type is NDB. # this test waits for proper injector thread state.
# In future that should be fixed by waiting of proper
# state of NDB injector.
# #
# ==== Usage ==== # ==== Usage ====
# #
...@@ -17,25 +15,12 @@ ...@@ -17,25 +15,12 @@
# ==== Parameters ===== # ==== Parameters =====
# #
# $engine_type # $engine_type
# Type of engine. If type is NDB then it waits $wait_time sec # Type of engine. If type is NDB then it waits for injector
# # thread proper state.
# $wait_time
# Test will wait $wait_time seconds
let $_wait_time= 5;
if (!$wait_time) {
let $_wait_time= $wait_time;
}
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
while (!$_wait_time) { let $show_statement= SHOW PROCESSLIST;
let $_wait_time_internal= 10; let $field= State;
while (!$_wait_time_internal) { let $condition= = 'Waiting for event from ndbcluster';
sleep 0.1; source include/wait_show_condition.inc;
dec $_wait_time_internal;
}
dec $_wait_time;
}
} }
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