| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Auxiliary file used by rpl_delayed_slave.test. This assumes that an |
| 4 |
# 'INSERT INTO t1...' query has been executed on the master. It does |
| 5 |
# this: |
| 6 |
# |
| 7 |
# - After half the delay, check the status. It should be delaying and |
| 8 |
# the query should not have executed. |
| 9 |
# |
| 10 |
# - After one and a half delay, check the status. It should not be |
| 11 |
# delaying and the query should be executed. |
| 12 |
# |
| 13 |
# |
| 14 |
# ==== Usage ==== |
| 15 |
# |
| 16 |
# --let $query_number= 4 |
| 17 |
# --source suite/rpl/include/delayed_slave_wait_on_query.inc |
| 18 |
# |
| 19 |
# Parameters: |
| 20 |
# $query_number |
| 21 |
# The value of the 'b' column in t1 for the row inserted by the query |
| 22 |
# we are waiting for. |
| 23 |
|
| 24 |
connection master; |
| 25 |
|
| 26 |
--echo [on slave] |
| 27 |
--let $slave_timeout= $time1 |
| 28 |
--source include/sync_slave_io_with_master.inc |
| 29 |
--echo # sleep 1*T |
| 30 |
--sleep $time1 |
| 31 |
|
| 32 |
--let $assert_text= Query $query_number should not be executed |
| 33 |
--let $assert_cond= MAX(b) < $query_number FROM t1 |
| 34 |
--source include/rpl_assert.inc |
| 35 |
|
| 36 |
--let $assert_text= Status should be 'Waiting until MASTER_DELAY...' |
| 37 |
--let $assert_cond= "[SHOW SLAVE STATUS, Slave_SQL_Running_State, 1]" LIKE "Waiting until MASTER_DELAY%" |
| 38 |
--source include/rpl_assert.inc |
| 39 |
|
| 40 |
--echo # sleep 1*T |
| 41 |
--sleep $time1 |
| 42 |
|
| 43 |
--echo # sync with master (with timeout 1*T) |
| 44 |
--source include/sync_with_master.inc |
| 45 |
|
| 46 |
--let $assert_text= Query $query_number should be executed |
| 47 |
--let $assert_cond= MAX(b) = $query_number FROM t1 |
| 48 |
--source include/rpl_assert.inc |
| 49 |
|
| 50 |
--let $assert_text= Status should be 'Has read all relay log...' |
| 51 |
--let $assert_cond= "[SHOW SLAVE STATUS, Slave_SQL_Running_State, 1]" LIKE "Slave has read all relay log%" |
| 52 |
--source include/rpl_assert.inc |
| 53 |
|
| 54 |
|
| 55 |
--source include/check_slave_is_running.inc |