| 1 |
############################################################################## |
| 2 |
# ==== Purpose ==== |
| 3 |
# The purpose of this test is to verify that, in GR the new joiner node |
| 4 |
# correctly chooses CLONE instead of GR Recovery channel when the joiner is |
| 5 |
# very far from the group. |
| 6 |
# |
| 7 |
# ==== Requirements ==== |
| 8 |
# If the number of missing transactions for a member joining is above the |
| 9 |
# threshold, it should use clone to recover, even if the number of missing |
| 10 |
# transactions would wrap and become a small number when casting it into a |
| 11 |
# 64 bit integer. |
| 12 |
# |
| 13 |
# ==== Implementation ==== |
| 14 |
# - The test requires two servers: M1 and M2. |
| 15 |
# - Start M1. |
| 16 |
# - Set a large number of GTIDs as purged so that new members joining will be |
| 17 |
# very far from the group. |
| 18 |
# - Bootstrap group with M1. |
| 19 |
# - Start GR on M2. |
| 20 |
# - Verify that M2 chooses distributed recovery using clone by checking message |
| 21 |
# in the error log. |
| 22 |
# - Clean up. |
| 23 |
|
| 24 |
# ==== References ==== |
| 25 |
# Bug#:32086209: INCORRECT DECISION TO CLONE OR RECOVER WHEN GTID |
| 26 |
# DIFFERENCE IS HUGE |
| 27 |
# |
| 28 |
############################################################################### |
| 29 |
--source include/have_group_replication_plugin.inc |
| 30 |
--let $rpl_skip_group_replication_start= 1 |
| 31 |
--let $rpl_server_count= 2 |
| 32 |
--source include/group_replication.inc |
| 33 |
|
| 34 |
SET SESSION sql_log_bin = 0; |
| 35 |
call mtr.add_suppression("The integer component of the GTID number is high"); |
| 36 |
SET SESSION sql_log_bin = 1; |
| 37 |
|
| 38 |
--let $dummy_server_id1= cccccccc-cccc-cccc-cccc-cccccccccccc |
| 39 |
--let $dummy_server_id2= dddddddd-dddd-dddd-dddd-dddddddddddd |
| 40 |
--let $dummy_server_id3= eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee |
| 41 |
|
| 42 |
--echo |
| 43 |
--echo ############################################################ |
| 44 |
--echo # Start server1 |
| 45 |
--let $rpl_connection_name= server1 |
| 46 |
--source include/rpl_connection.inc |
| 47 |
|
| 48 |
--eval SET GLOBAL gtid_purged = CONCAT('$dummy_server_id1:1-', (1 << 63) - 10) |
| 49 |
--eval SET GLOBAL gtid_purged = CONCAT('+$dummy_server_id2:1-', (1 << 63) - 10) |
| 50 |
--eval SET GLOBAL gtid_purged = CONCAT('+$dummy_server_id3:1-25') |
| 51 |
--source include/start_and_bootstrap_group_replication.inc |
| 52 |
|
| 53 |
--echo |
| 54 |
--echo ############################################################ |
| 55 |
--echo # Start server2 |
| 56 |
--let $rpl_connection_name= server2 |
| 57 |
--source include/rpl_connection.inc |
| 58 |
|
| 59 |
SET SESSION sql_log_bin = 0; |
| 60 |
call mtr.add_suppression("Plugin group_replication reported.*"); |
| 61 |
SET SESSION sql_log_bin = 1; |
| 62 |
|
| 63 |
SET @saved_exit_state_action = @@GLOBAL.group_replication_exit_state_action; |
| 64 |
SET @@GLOBAL.group_replication_exit_state_action = OFFLINE_MODE; |
| 65 |
|
| 66 |
# Clone plugin is not installed, as such the member will error |
| 67 |
# during recovery. |
| 68 |
--let $group_replication_start_member_state= ERROR |
| 69 |
--source include/start_group_replication.inc |
| 70 |
|
| 71 |
--let $assert_text= P_S table replication_group_members must only contain 1 member |
| 72 |
--let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.replication_group_members]" = 1 |
| 73 |
--source include/assert.inc |
| 74 |
|
| 75 |
--source include/assert_and_disable_offline_mode.inc |
| 76 |
|
| 77 |
# Assert that recovery using clone is logged to the server error log. |
| 78 |
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 79 |
--let $assert_select = This member will start distributed recovery using clone. It is due to the number of missing transactions being higher than the configured threshold |
| 80 |
--let $assert_count = 1 |
| 81 |
--let $assert_text = ER_GRP_RPL_RECOVERY_STRAT_CLONE_THRESHOLD found in server error log |
| 82 |
--source include/assert_grep.inc |
| 83 |
|
| 84 |
--echo # |
| 85 |
--echo # Cleaning up |
| 86 |
--echo # |
| 87 |
--source include/stop_group_replication.inc |
| 88 |
SET @@GLOBAL.group_replication_exit_state_action = @saved_exit_state_action; |
| 89 |
--source include/group_replication_end.inc |