File: rpl_show_slave_running.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (79 lines) | stat: -rw-r--r-- 3,275 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# Bug #30703  SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS'
# The test verifies that  SHOW STATUS LIKE 'Slave_running' displays ON
# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and  Slave_SQL_Running
#
--source include/not_group_replication_plugin.inc
source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/master-slave.inc;

connection slave;

SET DEBUG_SYNC= 'RESET';
source include/stop_slave.inc;

--let $debug_point= dbug.before_get_running_status_yes
--source include/add_debug_point.inc

# Test 1. Slave is stopped

--echo Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries

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;

#  Test 2. The slave IO thread is started but not yet got connected to master
#          and SQL thread is not started

start slave io_thread;

#
# Notice a difference between versions in showing p.2: 
# 5.1 has two OFF,ON IO-thread state running state whereas later versions
# have three: OFF,Connecting,ON.
# Hence, 5.1 must display OFF NO NO where as 5.1+ OFF Connecting NO
# (thank you, Andrei for leaving these comments. -- Andrei repl MC at the moment)
#
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF Connecting NO in three following queries

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;

# Test 3. The slave IO thread is started and got connected to master
#         and SQL thread is still not started

SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running'; # unblock IO thread now
let $slave_param= Slave_IO_Running;
let $slave_param_value= YES;
source include/wait_for_slave_param.inc;

--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries

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;

# Test 4. The slave IO thread is started and got connected to master
#         and SQL thread is started

start slave sql_thread;
source include/wait_for_slave_sql_to_start.inc;

--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries

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;

# cleanup

connection master;

# Bug#11765758 - 58754
# @@global.debug is read by the slave threads through dbug-interface. 
# Hence, before a client thread set @@global.debug we have to ensure that:
# (a) the slave threads are stopped, or (b) the slave threads are in
# sync and waiting.
--source include/sync_slave_sql_with_master.inc

--let $debug_point= dbug.before_get_running_status_yes
--source include/remove_debug_point.inc

SET DEBUG_SYNC= 'RESET';
--echo End of tests
--source include/rpl_end.inc