File: rpl_semi_sync_master_disable_with_slave.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (72 lines) | stat: -rw-r--r-- 2,642 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
# 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 # Wait for the Control State
let $wait_condition=
  SELECT STATE LIKE 'Master has sent all binlog to slave%'
    FROM information_schema.PROCESSLIST WHERE ID = @binlog_dump_tid;
--source include/wait_condition.inc
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