| 1 |
# |
| 2 |
# Bug #30703 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS' |
| 3 |
# The test verifies that SHOW STATUS LIKE 'Slave_running' displays ON |
| 4 |
# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and Slave_SQL_Running |
| 5 |
# |
| 6 |
--source include/not_group_replication_plugin.inc |
| 7 |
source include/have_debug.inc; |
| 8 |
source include/have_debug_sync.inc; |
| 9 |
source include/master-slave.inc; |
| 10 |
|
| 11 |
connection slave; |
| 12 |
|
| 13 |
SET DEBUG_SYNC= 'RESET'; |
| 14 |
source include/stop_slave.inc; |
| 15 |
|
| 16 |
--let $debug_point= dbug.before_get_running_status_yes |
| 17 |
--source include/add_debug_point.inc |
| 18 |
|
| 19 |
# Test 1. Slave is stopped |
| 20 |
|
| 21 |
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries |
| 22 |
|
| 23 |
select rcs.SERVICE_STATE as Slave_IO_Running, ras.SERVICE_STATE as Slave_SQL_Running from performance_schema.replication_applier_status ras, performance_schema.replication_connection_status rcs; |
| 24 |
|
| 25 |
# Test 2. The slave IO thread is started but not yet got connected to master |
| 26 |
# and SQL thread is not started |
| 27 |
|
| 28 |
start slave io_thread; |
| 29 |
|
| 30 |
# |
| 31 |
# Notice a difference between versions in showing p.2: |
| 32 |
# 5.1 has two OFF,ON IO-thread state running state whereas later versions |
| 33 |
# have three: OFF,Connecting,ON. |
| 34 |
# Hence, 5.1 must display OFF NO NO where as 5.1+ OFF Connecting NO |
| 35 |
# (thank you, Andrei for leaving these comments. -- Andrei repl MC at the moment) |
| 36 |
# |
| 37 |
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF Connecting NO in three following queries |
| 38 |
|
| 39 |
select rcs.SERVICE_STATE as Slave_IO_Running, ras.SERVICE_STATE as Slave_SQL_Running from performance_schema.replication_applier_status ras, performance_schema.replication_connection_status rcs; |
| 40 |
|
| 41 |
# Test 3. The slave IO thread is started and got connected to master |
| 42 |
# and SQL thread is still not started |
| 43 |
|
| 44 |
SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running'; # unblock IO thread now |
| 45 |
let $slave_param= Slave_IO_Running; |
| 46 |
let $slave_param_value= YES; |
| 47 |
source include/wait_for_slave_param.inc; |
| 48 |
|
| 49 |
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries |
| 50 |
|
| 51 |
select rcs.SERVICE_STATE as Slave_IO_Running, ras.SERVICE_STATE as Slave_SQL_Running from performance_schema.replication_applier_status ras, performance_schema.replication_connection_status rcs; |
| 52 |
|
| 53 |
# Test 4. The slave IO thread is started and got connected to master |
| 54 |
# and SQL thread is started |
| 55 |
|
| 56 |
start slave sql_thread; |
| 57 |
source include/wait_for_slave_sql_to_start.inc; |
| 58 |
|
| 59 |
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries |
| 60 |
|
| 61 |
select rcs.SERVICE_STATE as Slave_IO_Running, ras.SERVICE_STATE as Slave_SQL_Running from performance_schema.replication_applier_status ras, performance_schema.replication_connection_status rcs; |
| 62 |
|
| 63 |
# cleanup |
| 64 |
|
| 65 |
connection master; |
| 66 |
|
| 67 |
# Bug#11765758 - 58754 |
| 68 |
# @@global.debug is read by the slave threads through dbug-interface. |
| 69 |
# Hence, before a client thread set @@global.debug we have to ensure that: |
| 70 |
# (a) the slave threads are stopped, or (b) the slave threads are in |
| 71 |
# sync and waiting. |
| 72 |
--source include/sync_slave_sql_with_master.inc |
| 73 |
|
| 74 |
--let $debug_point= dbug.before_get_running_status_yes |
| 75 |
--source include/remove_debug_point.inc |
| 76 |
|
| 77 |
SET DEBUG_SYNC= 'RESET'; |
| 78 |
--echo End of tests |
| 79 |
--source include/rpl_end.inc |