Debian Codegraph @

mysql-test/suite/group_replication/t/gr_clone_from_unsupported_version.test

raw
1 ################################################################################
2 # Validate that when a member joins a group, and it is missing data that was
3 # purged from group binary logs, the joiner member will proceed by cloning a
4 # a group member. Since cloning will fail, the joiner will error out.
5 #
6 # Test:
7 # 0. The test requires two servers: M1 and M2.
8 # 1. Install clone plugin on server1.
9 # Commit some data and then purge all binary logs.
10 # Bootstrap a group on server1 with version 8.0.36.
11 # 2. Install clone plugin on server2.
12 # Start GR, cloning is the option chosen as recovery
13 # from binary logs is not possible.
14 # Member will move to ERROR state since cloning is not possible from
15 # version 8.0.36
16 # 3. Cleanup
17 #
18
19 --source include/have_debug.inc
20 --source include/have_clone_plugin.inc
21 --source include/have_group_replication_plugin.inc
22 --let $rpl_skip_group_replication_start= 1
23 --source include/group_replication.inc
24
25 # Validate plugins
26 --let plugins = CLONE_PLUGIN,GROUP_REPLICATION
27 --source include/check_plugin_dir.inc
28
29 --echo
30 --echo ############################################################
31 --echo # 1. Install clone plugin on server1.
32 --echo # Commit some data and then purge all binary logs.
33 --echo # Bootstrap a group on server1 with version 8.0.36.
34
35 --let $rpl_connection_name= server1
36 --source include/rpl_connection.inc
37
38 # Install the clone plugin
39 --replace_result $CLONE_PLUGIN CLONE_PLUGIN
40 --eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
41
42 # Add some data for recovery
43 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
44 INSERT INTO t1 VALUES (1);
45 INSERT INTO t1 VALUES (2);
46
47 # Purge binary logs.
48 SET sql_log_bin = 0;
49 --source include/gtid_utils.inc
50 SET sql_log_bin = 1;
51
52 FLUSH BINARY LOGS;
53 --let $server_binlog_file_cur= query_get_value(SHOW MASTER STATUS, File, 1)
54 --replace_result $server_binlog_file_cur CURRENT_BINLOG_FILE
55 --eval PURGE BINARY LOGS TO '$server_binlog_file_cur'
56
57 --let $assert_text = GTID_PURGED must be equal to GTID_EXECUTED
58 --let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_PURGED, @@GLOBAL.GTID_EXECUTED)
59 --source include/assert.inc
60
61 SET @@GLOBAL.DEBUG='+d,group_replication_version_clone_not_supported';
62 --source include/start_and_bootstrap_group_replication.inc
63
64 --echo
65 --echo ############################################################
66 --echo # 2. Install clone plugin on server2.
67 --echo # Start GR, cloning is the option chosen as recovery
68 --echo # from binary logs is not possible.
69 --echo # Member will move to ERROR state since cloning is not possible from
70 --echo # version 8.0.36
71
72 # Install the clone plugin
73 --let $rpl_connection_name= server2
74 --source include/rpl_connection.inc
75
76 --replace_result $CLONE_PLUGIN CLONE_PLUGIN
77 --eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
78
79 SET @gr_recovery_retry_count_save = @@GLOBAL.group_replication_recovery_retry_count;
80 SET GLOBAL group_replication_recovery_retry_count = 1;
81 SET @gr_clone_threshold_save= @@GLOBAL.group_replication_clone_threshold;
82 SET GLOBAL group_replication_clone_threshold= 1;
83
84 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
85 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
86
87 --source include/start_group_replication_command.inc
88
89 --let $group_replication_member_state = ERROR
90 --source include/gr_wait_for_member_state.inc
91
92 SET @@GLOBAL.group_replication_recovery_retry_count = @gr_recovery_retry_count_save;
93 SET @@GLOBAL.group_replication_clone_threshold = @gr_clone_threshold_save;
94 --source include/stop_group_replication.inc
95
96 --echo
97 --echo ############################################################
98 --echo # 3. Cleanup.
99
100 --let $rpl_connection_name= server1
101 --source include/rpl_connection.inc
102 SET SESSION sql_log_bin=0;
103 call mtr.add_suppression("Cannot replicate to server with server_uuid*");
104 SET SESSION sql_log_bin=1;
105
106 DROP TABLE t1;
107 --source include/gtid_utils_end.inc
108
109 UNINSTALL PLUGIN clone;
110 --source include/stop_group_replication.inc
111 SET @@GLOBAL.DEBUG='-d,group_replication_version_clone_not_supported';
112
113 --let $rpl_connection_name= server2
114 --source include/rpl_connection.inc
115
116 UNINSTALL PLUGIN clone;
117
118 SET SESSION sql_log_bin=0;
119 call mtr.add_suppression("Member version is read compatible with the group.");
120 call mtr.add_suppression("Error reading packet from server for channel 'group_replication_recovery'*");
121 call mtr.add_suppression("Replica I/O for channel 'group_replication_recovery': Got fatal error 1236*");
122 call mtr.add_suppression("Error while starting the group replication incremental recovery receiver/applier threads");
123 call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
124 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
125 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
126 call mtr.add_suppression("The server was automatically set into offline mode after an error was detected.");
127 call mtr.add_suppression("Maximum number of retries when trying to connect to a donor reached. Aborting group replication incremental recovery.");
128 call mtr.add_suppression("There was an error when connecting to the donor server.*");
129 call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of Replica I/O for channel group_replication_recovery.");
130 SET SESSION sql_log_bin=1;
131
132 --source include/group_replication_end.inc