| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Test verifies that there is no deadlock when below threads are executed parallely |
| 4 |
# on a keyring installed slave. |
| 5 |
# |
| 6 |
# 1. Server thread executing start slave. |
| 7 |
# 2. Server thread executing handle_slave_io (child thread of start slave thread). |
| 8 |
# 3. Server thread executing "SET GLOBAL binlog_encryption=ON". |
| 9 |
# |
| 10 |
# ==== Implementation ==== |
| 11 |
# |
| 12 |
# 1. start master slave servers with keyring installed. |
| 13 |
# 2. verify that slave has binlog_encryption = ON. |
| 14 |
# 3. on slave connection server_2_1: |
| 15 |
# a. set debug sync point after_locking_global_sys_var_set_binlog_enc. |
| 16 |
# b. send 'set binlog_encryption=OFF'. |
| 17 |
# 4. wait for 'set binlog_encryption=OFF' executing thread to reach the debug point. |
| 18 |
# 5. on slave connection server_2_2: |
| 19 |
# a. set debug sync point after_locking_channel_map_in_start_replica. |
| 20 |
# b. send 'start slave'. |
| 21 |
# 6. wait for start slave executing thread to reach the debug point, set in 5.(a). |
| 22 |
# 7. signal debug points, one on each threads, set in 3.(a), and 5.(a). |
| 23 |
# 8. reap the commands on connections slave1, and slave2. |
| 24 |
# |
| 25 |
# ==== References ==== |
| 26 |
# |
| 27 |
# BUG#29515210 SLAVE SERVER HANGS WHEN WE CHANGE BINLOG_ENCRYPTION + EXECUTE START SLAVE |
| 28 |
# |
| 29 |
|
| 30 |
# 1. start master slave servers with keyring installed. |
| 31 |
--source include/have_debug.inc |
| 32 |
--source include/have_debug_sync.inc |
| 33 |
--source include/have_binlog_format_row.inc |
| 34 |
--let $rpl_skip_start_slave= 1 |
| 35 |
--let $rpl_extra_connections_per_server= 2 |
| 36 |
--source include/master-slave.inc |
| 37 |
|
| 38 |
# 2. verify that slave has binlog_encryption = ON. |
| 39 |
--source include/rpl_connection_slave.inc |
| 40 |
--let $assert_text=binlog_encryption option shall be ON |
| 41 |
--let $option_value = `SELECT variable_value FROM performance_schema.global_variables WHERE variable_name = "binlog_encryption"` |
| 42 |
--let $assert_cond= "$option_value" = "ON" |
| 43 |
--source include/assert.inc |
| 44 |
|
| 45 |
# 3. on slave connection server_2_1: |
| 46 |
# a. set debug sync point after_locking_global_sys_var_set_binlog_enc. |
| 47 |
# b. send 'set binlog_encryption=OFF'. |
| 48 |
--let $rpl_connection_name= server_2_1 |
| 49 |
--source include/rpl_connection.inc |
| 50 |
SET DEBUG_SYNC='after_locking_global_sys_var_set_binlog_enc SIGNAL sysvar_before_unlock WAIT_FOR cont_set_binlog_enc'; |
| 51 |
--send SET GLOBAL binlog_encryption=OFF |
| 52 |
|
| 53 |
# 4. wait for 'set binlog_encryption=OFF' executing thread to reach the debug point, set in 3.(a). |
| 54 |
# this ensures that thread has locked Lock_global_system_variables. |
| 55 |
--source include/rpl_connection_slave.inc |
| 56 |
SET DEBUG_SYNC='now WAIT_FOR sysvar_before_unlock'; |
| 57 |
|
| 58 |
# 5. on slave connection server_2_2: |
| 59 |
# a. set debug sync point after_locking_channel_map_in_start_replica. |
| 60 |
# b. send 'start slave'. |
| 61 |
--let $rpl_connection_name= server_2_2 |
| 62 |
--source include/rpl_connection.inc |
| 63 |
SET DEBUG_SYNC='after_locking_channel_map_in_start_replica SIGNAL after_channelmap_lock WAIT_FOR cont_start_slave'; |
| 64 |
--send START SLAVE |
| 65 |
|
| 66 |
# 6. wait for start slave executing thread to reach the debug point, set in 5.(a). |
| 67 |
--source include/rpl_connection_slave.inc |
| 68 |
SET DEBUG_SYNC='now WAIT_FOR after_channelmap_lock'; |
| 69 |
|
| 70 |
# 7. signal debug points, one on each threads, set in 3.(a), and 5.(a). |
| 71 |
SET DEBUG_SYNC='now SIGNAL cont_set_binlog_enc'; |
| 72 |
SET DEBUG_SYNC='now SIGNAL cont_start_slave'; |
| 73 |
|
| 74 |
# 8. reap the commands on connections server_2_1, and server_2_2. |
| 75 |
--let $rpl_connection_name= server_2_1 |
| 76 |
--source include/rpl_connection.inc |
| 77 |
--reap |
| 78 |
--let $rpl_connection_name= server_2_2 |
| 79 |
--source include/rpl_connection.inc |
| 80 |
--reap |
| 81 |
|
| 82 |
# restore binlog_encryption. |
| 83 |
--source include/rpl_connection_slave.inc |
| 84 |
SET GLOBAL binlog_encryption=ON; |
| 85 |
|
| 86 |
source include/rpl_end.inc; |