| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# The purpose of this script is to test that if correctly configured |
| 4 |
# we can clone a replica and it will start replicating on server start. |
| 5 |
# This is still true if the channel is configured with GTID_ONLY=1 |
| 6 |
# |
| 7 |
# ==== Requirements ==== |
| 8 |
# |
| 9 |
# R1. Cloning a server that has a channel with GTID_ONLY = 1 works correctly |
| 10 |
# |
| 11 |
# ==== Implementation ==== |
| 12 |
# |
| 13 |
# 1. Set up a replication connection from server 1 to server 2 |
| 14 |
# 2. Create a table for testing |
| 15 |
# 3. Install clone on server 2 |
| 16 |
# Configure server 3 to invoke clone |
| 17 |
# 4. Execute a transaction on server 1, check 3 received it |
| 18 |
# 4.1 Check that the replica only retrieves the missing transaction |
| 19 |
# 5. Cleanup |
| 20 |
# |
| 21 |
# ==== References ==== |
| 22 |
# |
| 23 |
# WL#7491: GTID-based replication applier recovery and positioning |
| 24 |
# |
| 25 |
|
| 26 |
--source include/have_binlog_format_row.inc |
| 27 |
--source include/have_mysqld_monitoring_process.inc |
| 28 |
--source include/have_clone_plugin.inc |
| 29 |
# Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE |
| 30 |
--source include/have_slave_repository_type_table.inc |
| 31 |
--let $rpl_skip_start_slave= 1 |
| 32 |
--source include/master-slave.inc |
| 33 |
|
| 34 |
|
| 35 |
# Configure the channel to use GTID_ONLY |
| 36 |
|
| 37 |
--source include/rpl_connection_slave.inc |
| 38 |
|
| 39 |
CHANGE REPLICATION SOURCE TO GTID_ONLY = 1, REQUIRE_ROW_FORMAT=1; |
| 40 |
|
| 41 |
--source include/start_slave.inc |
| 42 |
|
| 43 |
--source include/rpl_connection_master.inc |
| 44 |
|
| 45 |
--source extra/rpl_tests/rpl_replica_start_after_clone.inc |
| 46 |
|
| 47 |
--echo # |
| 48 |
--echo # 4.1 Check that the replica only retrieves the missing transaction |
| 49 |
|
| 50 |
USE test; |
| 51 |
--source include/gtid_utils.inc |
| 52 |
|
| 53 |
--let $local_gtid_set= query_get_value(SHOW REPLICA STATUS, Retrieved_Gtid_Set, 1) |
| 54 |
--let $assert_text= Exactly 1 GTIDs should have been retrieved since last invocation |
| 55 |
--let $assert_cond= `SELECT GTID_COUNT("$local_gtid_set") = 1` |
| 56 |
--source include/assert.inc |
| 57 |
|
| 58 |
--source include/gtid_utils_end.inc |
| 59 |
|
| 60 |
# Cleanup |
| 61 |
|
| 62 |
--source extra/rpl_tests/rpl_replica_start_after_clone_cleanup.inc |
| 63 |
|
| 64 |
--source include/rpl_connection_slave.inc |
| 65 |
|
| 66 |
--source include/stop_slave.inc |
| 67 |
|
| 68 |
CHANGE REPLICATION SOURCE TO GTID_ONLY = 0, REQUIRE_ROW_FORMAT=0; |
| 69 |
|
| 70 |
--source include/start_slave.inc |
| 71 |
|
| 72 |
--source include/rpl_end.inc |