Debian Codegraph @

mysql-test/suite/rpl/t/rpl_io_thd_blocked_show_slave_status.test

raw
1 # ==== Purpose ====
2 #
3 # Check that the execution of SHOW SLAVE STATUS command is not blocked when IO
4 # thread is blocked writing an event to the relay log.
5 #
6 # ==== Implementation ====
7 #
8 # Simulate a scenario where IO thread is waiting while writing into the relay
9 # log, holding LOCK_log. Execute SHOW SLAVE STATUS command after IO thread is
10 # blocked writing an event. The command should not be blocked.
11 #
12 # ==== References ====
13 #
14 # WL#10406: Improve usability when receiver thread is waiting for disk space
15 # BUG#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR
16 # DISK SPACE
17 # BUG#25609448: STOP SLAVE IS ACQUIRING THE RELAY LOG->LOG_LOCK EVEN TO STOP
18 # ONLY THE SQL THREAD
19 #
20 --source include/have_debug.inc
21 --source include/have_debug_sync.inc
22 --source include/master-slave.inc
23
24 # Generate events to be replicated to the slave
25 CREATE TABLE t1 (c1 INT);
26 INSERT INTO t1 (c1) VALUES (1);
27 --let $master_file= query_get_value(SHOW MASTER STATUS, File, 1)
28 --source include/sync_slave_sql_with_master.inc
29
30 # Suppression of error messages
31 CALL mtr.add_suppression('coordinator and worker threads are stopped');
32
33 # Set the debug option that will simulate I/O thread blocked writing
34 SET @@GLOBAL.debug="+d,pause_on_queue_event_after_write_buffer";
35
36 # Generate events to be replicated to the slave
37 --source include/rpl_connection_master.inc
38 INSERT INTO t1 (c1) VALUES (2);
39
40 --source include/rpl_connection_slave.inc
41 # Wait until IO thread is queuing events from master
42 SET DEBUG_SYNC="now WAIT_FOR receiver_reached_pause_on_queue_event";
43
44 # Notice that this is performed by querying SHOW SLAVE STATUS
45 --let $master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
46 --let $assert_cond= "$master_log_file" = "$master_file"
47 --let $assert_text= Consulting SHOW SLAVE STATUS was successful
48 --source include/assert.inc
49
50 # We can even stop SQL thread
51 --let $slave_sql_errno= convert_error(ER_MTA_INCONSISTENT_DATA)
52 --source include/stop_slave_sql.inc
53
54 # And we also can start SQL thread again
55 --source include/start_slave_sql.inc
56
57 # Remove debug instrumentation and let the I/O thread to continue
58 SET @@GLOBAL.debug="-d,pause_on_queue_event_after_write_buffer";
59 SET DEBUG_SYNC="now SIGNAL receiver_continue_queuing_event";
60
61 # Cleanup
62 --source include/rpl_connection_master.inc
63 DROP TABLE t1;
64 --source include/rpl_end.inc