File: rpl_semi_sync_shutdown_hang.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 (66 lines) | stat: -rw-r--r-- 2,316 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
###############################################################################
# Bug#17879675:SHUTDOWN HANG IF SEMISYNC IS ENABLED AND SLAVE ABORT
#
# Problem:
# ========
# Step 1. enable semisync and set a big value for
# rpl_semi_sync_source_timeout.
#
# Step 2. kill io thread of slave, so the threads on master will keep on
# WAITING ACK FROM SLAVE.
#
# Step 3.shutdown the master ---hang
#
# Test:
# =====
# Stop IO thread and execute a transaction on master. The transaction thread
# will wait for an ack as IO thread is stopped.  Now shutdown the master the
# shutdown should not hang.  Shutdown should stop the dump thread and the
# dump thread should wakeup the waiting transaction thread and switch off
# semisync as there are no active slaves connected to the server.
###############################################################################
--source include/have_semisync_plugin.inc
--source include/not_group_replication_plugin.inc
# Test script is independent of binlog format.
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
--source include/install_semisync.inc

call mtr.add_suppression("Read semi-sync reply network error");
call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated.");

--source include/rpl_connection_master.inc
SET GLOBAL rpl_semi_sync_source_timeout = 10000000;

--source include/rpl_connection_slave.inc
--source include/stop_slave_io.inc

--source include/rpl_connection_master.inc
--send CREATE TABLE t(f INT) ENGINE=INNODB;

--source include/rpl_connection_master1.inc
--let $status_var= rpl_semi_sync_source_wait_sessions
--let $status_var_value= 1
--source include/wait_for_status_var.inc

--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_result_log
--replace_regex /.*mysqladmin.*: /mysqladmin: /
--exec $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT shutdown 2>&1
--enable_result_log

--source include/rpl_connection_master.inc
--error 0,2013
--reap
--let $rpl_server_number=1
--source include/rpl_start_server.inc

--source include/rpl_connection_slave.inc
--source include/start_slave_io.inc

--source include/rpl_connection_master.inc
DROP TABLE t;
--source include/sync_slave_sql_with_master.inc

--source include/uninstall_semisync.inc
--source include/rpl_end.inc