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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
################################################################################
#
# Test validates that all members use same UUID on View log event configured on
# group_replication_view_change_uuid.
#
# Test:
# 0. This test requires 3 servers to create a Group Replication setup
# 1. Start server 1 and assert it only has one transaction
# 2. Start server 2 and assert it has two transactions
# 3. Confirm server 1 has same GTID_EXECUTED as server 2
# 4. Start server 3 and assert it has three transactions
# 5. Confirm server 1 has same GTID_EXECUTED than server 3
# 6. Confirm server 2 has same GTID_EXECUTED than server 3
# 7. Stop server 3 and assert it has three transactions
# 8. Stop server 2 and assert it has three transactions
# 9. Start server 2 and assert it has 4 transactions
# 10. Confirm server 1 has same GTID_EXECUTED as server 2
# 11. Start server 3 and assert it has 5 transactions
# 12. Confirm server 1 has same GTID_EXECUTED than server 3
# 13. Confirm server 2 has same GTID_EXECUTED than server 3
# 14. Cleanup
#
################################################################################
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3
--source include/group_replication.inc
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Load GTID functions (GTID_IS_EQUAL)
SET sql_log_bin = 0;
--source include/gtid_utils.inc
SET sql_log_bin = 1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET sql_log_bin = 0;
--source include/gtid_utils.inc
SET sql_log_bin = 1;
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
SET sql_log_bin = 0;
--source include/gtid_utils.inc
SET sql_log_bin = 1;
--echo
--echo ############################################################
--echo # 1. Start server 1 and assert it only has one transaction
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @group_replication_view_change_uuid_save= @@GLOBAL.group_replication_view_change_uuid;
--let $view_change_uuid = c0dec0de-c0de-c0de-c0de-c0dec0dec0de
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid"
--source include/start_and_bootstrap_group_replication.inc
--let $assert_text = GTID_EXECUTED must have one transaction of view change
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 2. Start server 2 and assert it has two transactions
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET @group_replication_view_change_uuid_save= @@GLOBAL.group_replication_view_change_uuid;
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid"
--source include/start_group_replication.inc
--let $assert_text = GTID_EXECUTED must have two transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-2")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 3. Confirm server 1 has same GTID_EXECUTED as server 2
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have two transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-2")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 4. Start server 3 and assert it has three transactions
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
SET @group_replication_view_change_uuid_save= @@GLOBAL.group_replication_view_change_uuid;
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid"
--source include/start_group_replication.inc
--let $assert_text = GTID_EXECUTED must have three transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-3")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 5. Confirm server 1 has same GTID_EXECUTED than server 3
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have three transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-3")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo ############################################################
--echo # 6. Confirm server 2 has same GTID_EXECUTED than server 3
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have three transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-3")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 7. Stop server 3 and assert it has three transactions
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
--let $assert_text = GTID_EXECUTED must have three transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-3")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 8. Stop server 2 and assert it has three transactions
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
--let $assert_text = GTID_EXECUTED must have three transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-3")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 9. Start server 2 and assert it has 4 transactions
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/start_group_replication.inc
--let $assert_text = GTID_EXECUTED must have four transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-4")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 10. Confirm server 1 has same GTID_EXECUTED as server 2
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have four transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-4")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 11. Start server 3 and assert it has 5 transactions
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
--source include/start_group_replication.inc
--let $assert_text = GTID_EXECUTED must have five transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-5")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo ############################################################
--echo # 12. Confirm server 1 has same GTID_EXECUTED than server 3
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have five transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-5")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo ############################################################
--echo # 13. Confirm server 2 has same GTID_EXECUTED than server 3
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $assert_text = GTID_EXECUTED must have five transactions of view changes
--let $assert_cond = GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$view_change_uuid:1-5")
--source include/assert.inc
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc
--echo
--echo ############################################################
--echo # 14. Cleanup
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET sql_log_bin = 0;
--source include/gtid_utils_end.inc
SET sql_log_bin = 1;
--source include/stop_group_replication.inc
SET @@GLOBAL.group_replication_view_change_uuid= @group_replication_view_change_uuid_save;
SET GLOBAL group_replication_view_change_uuid = "AUTOMATIC";
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET sql_log_bin = 0;
--source include/gtid_utils_end.inc
SET sql_log_bin = 1;
--source include/stop_group_replication.inc
SET @@GLOBAL.group_replication_view_change_uuid= @group_replication_view_change_uuid_save;
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
SET sql_log_bin = 0;
--source include/gtid_utils_end.inc
SET sql_log_bin = 1;
--source include/stop_group_replication.inc
SET @@GLOBAL.group_replication_view_change_uuid= @group_replication_view_change_uuid_save;
--source include/group_replication_end.inc
|