File: rpl_semi_sync_master_disable_with_slave.test

package info (click to toggle)
mariadb 1%3A11.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 765,428 kB
  • sloc: ansic: 2,382,827; cpp: 1,803,532; asm: 378,315; perl: 63,176; sh: 46,496; pascal: 40,776; java: 39,363; yacc: 20,428; python: 19,506; sql: 17,864; xml: 12,463; ruby: 8,544; makefile: 6,059; cs: 5,855; ada: 1,700; lex: 1,193; javascript: 1,039; objc: 80; tcl: 73; awk: 46; php: 22
file content (68 lines) | stat: -rw-r--r-- 2,509 bytes parent folder | download | duplicates (2)
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
# MDEV-36359: Master crashes when reverting to async after Semi-Sync disabled.
#
# Assert behavior of turning Semi-Sync off on
# the master when still connected to a slave

--source include/have_binlog_format_mixed.inc # format-agnostic

--echo # Set up Semi-Sync with rpl_semi_sync_master_wait_no_slave=0
--let $rpl_skip_start_slave= 1
--source include/master-slave.inc

--let $orig_master_enabled=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled`
SET @@GLOBAL.rpl_semi_sync_master_enabled= 1;
--let $orig_wait_no_slave=`SELECT @@GLOBAL.rpl_semi_sync_master_wait_no_slave`
SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= 0;

--connection slave
--let $orig_slave_enabled=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled`
SET @@GLOBAL.rpl_semi_sync_slave_enabled= 1;
--source include/start_slave.inc

--connection master
# Make sure Semi-Sync is active
--let $status_var= Rpl_semi_sync_master_status
--let $status_var_value= ON
--source include/wait_for_status_var.inc

--sync_slave_with_master
--connection master

--disable_cursor_protocol
SELECT ID INTO @binlog_dump_tid
  FROM information_schema.PROCESSLIST WHERE COMMAND = 'Binlog Dump';
--enable_cursor_protocol

--echo # Control State
SELECT STATE FROM information_schema.PROCESSLIST WHERE ID = @binlog_dump_tid;
SHOW STATUS LIKE 'Rpl_semi_sync_master_clients';

--echo # Disable Semi-Sync while the dump thread is still connected to its slave
SET @@GLOBAL.rpl_semi_sync_master_enabled = 0;
--let $status_var_value= OFF
--source include/wait_for_status_var.inc

SELECT STATE FROM information_schema.PROCESSLIST WHERE ID = @binlog_dump_tid;
SHOW STATUS LIKE 'Rpl_semi_sync_master_clients';

--echo # Disconnect the slave and wait until the master's dump thread is gone
--connection slave
STOP SLAVE;
# Starting with MDEV-13073,
# Semi-Sync STOP SLAVE also terminates its dump thread on the master.
--connection master

# MDEV-36359: The disconnection would crash the master and leave the wait with
# error 2013 'Lost connection to server during query'
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.PROCESSLIST WHERE ID = @binlog_dump_tid
--source include/wait_condition.inc
SHOW STATUS LIKE 'Rpl_semi_sync_master_clients';

--echo # Cleanup
--eval SET @@GLOBAL.rpl_semi_sync_master_enabled= $orig_master_enabled
--eval SET @@GLOBAL.rpl_semi_sync_master_wait_no_slave= $orig_wait_no_slave
--connection slave
--eval SET @@GLOBAL.rpl_semi_sync_slave_enabled= $orig_slave_enabled

--let $rpl_only_running_threads= 1
--source include/rpl_end.inc