File: rpl_deadlock_globalsystemvariable_channelmap.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 (86 lines) | stat: -rw-r--r-- 3,509 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# ==== Purpose ====
#
# Test verifies that there is no deadlock when below threads are executed parallely
# on a keyring installed slave.
#
# 1. Server thread executing start slave.
# 2. Server thread executing handle_slave_io (child thread of start slave thread).
# 3. Server thread executing "SET GLOBAL binlog_encryption=ON".
#
# ==== Implementation ====
#
# 1. start master slave servers with keyring installed.
# 2. verify that slave has binlog_encryption = ON.
# 3. on slave connection server_2_1:
#   a. set debug sync point after_locking_global_sys_var_set_binlog_enc.
#   b. send 'set binlog_encryption=OFF'.
# 4. wait for 'set binlog_encryption=OFF' executing thread to reach the debug point.
# 5. on slave connection server_2_2:
#   a. set debug sync point after_locking_channel_map_in_start_replica.
#   b. send 'start slave'.
# 6. wait for start slave executing thread to reach the debug point, set in 5.(a).
# 7. signal debug points, one on each threads, set in 3.(a), and 5.(a).
# 8. reap the commands on connections slave1, and slave2.
#
# ==== References ====
#
# BUG#29515210  SLAVE SERVER HANGS WHEN WE CHANGE BINLOG_ENCRYPTION + EXECUTE START SLAVE
#

# 1. start master slave servers with keyring installed.
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_row.inc
--let $rpl_skip_start_slave= 1
--let $rpl_extra_connections_per_server= 2
--source include/master-slave.inc

# 2. verify that slave has binlog_encryption = ON.
--source include/rpl_connection_slave.inc
--let $assert_text=binlog_encryption option shall be ON
--let $option_value = `SELECT variable_value FROM performance_schema.global_variables WHERE variable_name = "binlog_encryption"`
--let $assert_cond= "$option_value" = "ON"
--source include/assert.inc

# 3. on slave connection server_2_1:
#   a. set debug sync point after_locking_global_sys_var_set_binlog_enc.
#   b. send 'set binlog_encryption=OFF'.
--let $rpl_connection_name= server_2_1
--source include/rpl_connection.inc
SET DEBUG_SYNC='after_locking_global_sys_var_set_binlog_enc SIGNAL sysvar_before_unlock WAIT_FOR cont_set_binlog_enc';
--send SET GLOBAL binlog_encryption=OFF

# 4. wait for 'set binlog_encryption=OFF' executing thread to reach the debug point, set in 3.(a).
#    this ensures that thread has locked Lock_global_system_variables.
--source include/rpl_connection_slave.inc
SET DEBUG_SYNC='now WAIT_FOR sysvar_before_unlock';

# 5. on slave connection server_2_2:
#   a. set debug sync point after_locking_channel_map_in_start_replica.
#   b. send 'start slave'.
--let $rpl_connection_name= server_2_2
--source include/rpl_connection.inc
SET DEBUG_SYNC='after_locking_channel_map_in_start_replica SIGNAL after_channelmap_lock WAIT_FOR cont_start_slave';
--send START SLAVE

# 6. wait for start slave executing thread to reach the debug point, set in 5.(a).
--source include/rpl_connection_slave.inc
SET DEBUG_SYNC='now WAIT_FOR after_channelmap_lock';

# 7. signal debug points, one on each threads, set in 3.(a), and 5.(a).
SET DEBUG_SYNC='now SIGNAL cont_set_binlog_enc';
SET DEBUG_SYNC='now SIGNAL cont_start_slave';

# 8. reap the commands on connections server_2_1, and server_2_2.
--let $rpl_connection_name= server_2_1
--source include/rpl_connection.inc
--reap
--let $rpl_connection_name= server_2_2
--source include/rpl_connection.inc
--reap

# restore binlog_encryption.
--source include/rpl_connection_slave.inc
SET GLOBAL binlog_encryption=ON;

source include/rpl_end.inc;