|
| 1 | +################################################################################ |
| 2 | +# This test will emulate server-side errors on MySQL connections, such as |
| 3 | +# the plugin has an ongoing operation that does not allow connections to |
| 4 | +# be accepted. |
| 5 | +# |
| 6 | +# Test: |
| 7 | +# 0. The test requires two servers: M1 and M2. |
| 8 | +# 1. Bootstrap a group with M1. |
| 9 | +# 2. Enable fail_incoming_connection_ongoing_operation and try to join M2. |
| 10 | +# 3. Join M2 will fail. Assert that the error message exists in the log of M1. |
| 11 | +# 4. Start M2 with the send command |
| 12 | +# 5. Sleep for 10 seconds and then clear |
| 13 | +# fail_incoming_connection_ongoing_operation |
| 14 | +# 6. reap the start command and M2 must be able to join the group. |
| 15 | +# 7. Clean-up |
| 16 | +################################################################################ |
| 17 | +--source include/big_test.inc |
| 18 | +--source include/have_group_replication_mysql_communication_stack.inc |
| 19 | +--source include/have_group_replication_plugin.inc |
| 20 | +--let $rpl_skip_group_replication_start= 1 |
| 21 | +--source include/group_replication.inc |
| 22 | + |
| 23 | +--echo # |
| 24 | +--echo # 1. Bootstrap a group with M1. |
| 25 | +--echo # |
| 26 | +--echo ####### |
| 27 | + |
| 28 | +--let $rpl_connection_name= server1 |
| 29 | +--source include/rpl_connection.inc |
| 30 | +--source include/start_and_bootstrap_group_replication.inc |
| 31 | +--source include/disable_binlog.inc |
| 32 | +call mtr.add_suppression(".*Failed to accept a MySQL connection for Group Replication. Group Replication plugin has an ongoing exclusive operation, like START, STOP or FORCE MEMBERS.*"); |
| 33 | +--source include/restore_binlog.inc |
| 34 | + |
| 35 | +--let $rpl_connection_name= server2 |
| 36 | +--source include/rpl_connection.inc |
| 37 | +--source include/disable_binlog.inc |
| 38 | +call mtr.add_suppression("Timeout on wait for view after joining group"); |
| 39 | +call mtr.add_suppression("Timeout while waiting for the group communication engine to be ready!"); |
| 40 | +call mtr.add_suppression("The group communication engine is not ready for the member to join. Local port: *.*"); |
| 41 | +call mtr.add_suppression("read failed"); |
| 42 | +call mtr.add_suppression("The member was unable to join the group. Local port: *.*"); |
| 43 | +call mtr.add_suppression("Error connecting to all peers. Member join failed. Local port: *.*"); |
| 44 | +--source include/restore_binlog.inc |
| 45 | + |
| 46 | +--echo # |
| 47 | +--echo # 2. Enable fail_incoming_connection_ongoing_operation and try to |
| 48 | +--echo # join M2. |
| 49 | +--echo # |
| 50 | +--echo ####### |
| 51 | + |
| 52 | +--let $rpl_connection_name= server1 |
| 53 | +--source include/rpl_connection.inc |
| 54 | + |
| 55 | +--let $debug_point = fail_incoming_connection_ongoing_operation |
| 56 | +--source include/add_debug_point.inc |
| 57 | + |
| 58 | +--let $rpl_connection_name= server2 |
| 59 | +--source include/rpl_connection.inc |
| 60 | + |
| 61 | +--echo # |
| 62 | +--echo # 3. Join M2 will fail. Assert that the error message exists |
| 63 | +--echo # in the log of M1. |
| 64 | +--echo # |
| 65 | +--echo ####### |
| 66 | + |
| 67 | +--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 68 | +--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 69 | + |
| 70 | +--error ER_GROUP_REPLICATION_CONFIGURATION |
| 71 | +START GROUP_REPLICATION; |
| 72 | + |
| 73 | +--let $rpl_connection_name= server1 |
| 74 | +--source include/rpl_connection.inc |
| 75 | + |
| 76 | +--let $assert_text= 'Failed to accept a MySQL connection for Group Replication. Group Replication plugin has an ongoing exclusive operation, like START, STOP or FORCE MEMBERS.' |
| 77 | +--let $assert_cond= "[SELECT COUNT(*) as count FROM performance_schema.error_log WHERE error_code=\'MY-014081\' AND data LIKE \"%Failed to accept a MySQL connection for Group Replication%\", count, 1]" >= "1" |
| 78 | +--source include/assert.inc |
| 79 | + |
| 80 | +--echo # |
| 81 | +--echo # 4. Start M2 with the send command |
| 82 | +--echo # |
| 83 | +--echo ####### |
| 84 | + |
| 85 | +--let $rpl_connection_name= server2 |
| 86 | +--source include/rpl_connection.inc |
| 87 | + |
| 88 | +--send START GROUP_REPLICATION; |
| 89 | + |
| 90 | +--let $rpl_connection_name= server_1_1 |
| 91 | +--source include/rpl_connection.inc |
| 92 | + |
| 93 | +--echo # |
| 94 | +--echo # 5. Sleep for 10 seconds and then clear |
| 95 | +--echo # fail_incoming_connection_ongoing_operation |
| 96 | +--echo # |
| 97 | +--echo ####### |
| 98 | +--sleep 10 |
| 99 | + |
| 100 | +--let $debug_point = fail_incoming_connection_ongoing_operation |
| 101 | +--source include/remove_debug_point.inc |
| 102 | + |
| 103 | +--echo # |
| 104 | +--echo # 6. reap the start command and M2 must be able to join the group. |
| 105 | +--echo # |
| 106 | +--echo ####### |
| 107 | +--let $rpl_connection_name= server2 |
| 108 | +--source include/rpl_connection.inc |
| 109 | + |
| 110 | +--reap |
| 111 | + |
| 112 | +--echo # |
| 113 | +--echo # 7. Clean-up |
| 114 | +--echo # |
| 115 | +--echo ###### |
| 116 | + |
| 117 | +--let $rpl_connection_name= server1 |
| 118 | +--source include/rpl_connection.inc |
| 119 | + |
| 120 | +--source include/group_replication_end.inc |
| 121 | + |
0 commit comments