Debian Codegraph @

mysql-test/suite/rpl_nogtid/t/rpl_semi_sync_shutdown_hang.test

raw
1 ###############################################################################
2 # Bug#17879675:SHUTDOWN HANG IF SEMISYNC IS ENABLED AND SLAVE ABORT
3 #
4 # Problem:
5 # ========
6 # Step 1. enable semisync and set a big value for
7 # rpl_semi_sync_source_timeout.
8 #
9 # Step 2. kill io thread of slave, so the threads on master will keep on
10 # WAITING ACK FROM SLAVE.
11 #
12 # Step 3.shutdown the master ---hang
13 #
14 # Test:
15 # =====
16 # Stop IO thread and execute a transaction on master. The transaction thread
17 # will wait for an ack as IO thread is stopped. Now shutdown the master the
18 # shutdown should not hang. Shutdown should stop the dump thread and the
19 # dump thread should wakeup the waiting transaction thread and switch off
20 # semisync as there are no active slaves connected to the server.
21 ###############################################################################
22 --source include/have_semisync_plugin.inc
23 --source include/not_group_replication_plugin.inc
24 # Test script is independent of binlog format.
25 --source include/have_binlog_format_mixed.inc
26 --source include/master-slave.inc
27 --source include/install_semisync.inc
28
29 call mtr.add_suppression("Read semi-sync reply network error");
30 call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated.");
31
32 --source include/rpl_connection_master.inc
33 SET GLOBAL rpl_semi_sync_source_timeout = 10000000;
34
35 --source include/rpl_connection_slave.inc
36 --source include/stop_slave_io.inc
37
38 --source include/rpl_connection_master.inc
39 --send CREATE TABLE t(f INT) ENGINE=INNODB;
40
41 --source include/rpl_connection_master1.inc
42 --let $status_var= rpl_semi_sync_source_wait_sessions
43 --let $status_var_value= 1
44 --source include/wait_for_status_var.inc
45
46 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
47 --disable_result_log
48 --replace_regex /.*mysqladmin.*: /mysqladmin: /
49 --exec $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT shutdown 2>&1
50 --enable_result_log
51
52 --source include/rpl_connection_master.inc
53 --error 0,2013
54 --reap
55 --let $rpl_server_number=1
56 --source include/rpl_start_server.inc
57
58 --source include/rpl_connection_slave.inc
59 --source include/start_slave_io.inc
60
61 --source include/rpl_connection_master.inc
62 DROP TABLE t;
63 --source include/sync_slave_sql_with_master.inc
64
65 --source include/uninstall_semisync.inc
66 --source include/rpl_end.inc