| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
# |
| 4 |
# Slave default configuration should be Slave_Pos |
| 5 |
connection slave; |
| 6 |
# |
| 7 |
# Ensure that a slave configured with Using_Gtid=Slave_Pos will remain |
| 8 |
# as Slave_Pos after RESET SLAVE |
| 9 |
include/stop_slave.inc |
| 10 |
RESET SLAVE; |
| 11 |
# No warning should be given because Slave_Pos never changed |
| 12 |
SHOW WARNINGS; |
| 13 |
Level Code Message |
| 14 |
include/start_slave.inc |
| 15 |
# |
| 16 |
# Ensure that a slave configured with Using_Gtid=No will revert to its |
| 17 |
# default of Slave_Pos after RESET SLAVE for a master which supports |
| 18 |
# GTIDs |
| 19 |
include/stop_slave.inc |
| 20 |
CHANGE MASTER TO MASTER_USE_GTID=NO; |
| 21 |
include/start_slave.inc |
| 22 |
include/stop_slave.inc |
| 23 |
RESET SLAVE; |
| 24 |
Warnings: |
| 25 |
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' |
| 26 |
# A notification that Using_Gtid was reverted should exist |
| 27 |
SHOW WARNINGS; |
| 28 |
Level Code Message |
| 29 |
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' |
| 30 |
include/start_slave.inc |
| 31 |
# Clear SHOW WARNINGS |
| 32 |
# |
| 33 |
# If the primary does not support GTIDs (version < 10), the replica |
| 34 |
# should fall back to Using_Gtid=No on slave start, and should not |
| 35 |
# revert Using_Gtid to Slave_Pos after RESET SLAVE |
| 36 |
include/stop_slave.inc |
| 37 |
RESET SLAVE ALL; |
| 38 |
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=1; |
| 39 |
SET @saved_dbug= @@GLOBAL.debug_dbug; |
| 40 |
set @@global.debug_dbug= "d,mock_mariadb_primary_v5_in_get_master_version"; |
| 41 |
include/start_slave.inc |
| 42 |
# Replica should detect at start that the primary does not support GTIDs |
| 43 |
# and fall-back to Using_Gtid=No |
| 44 |
# Replica should have an informational message stating it is falling |
| 45 |
# back to Using_Gtid=No |
| 46 |
FOUND 1 /Falling back to Using_Gtid=No because master does not support GTIDs/ in mysqld.2.err |
| 47 |
include/stop_slave.inc |
| 48 |
RESET SLAVE; |
| 49 |
# Replica should know that the primary does not support GTIDs and |
| 50 |
# preserve Using_Gtid=No |
| 51 |
# 'No' was not reverted and therefore no note should be added |
| 52 |
SHOW WARNINGS; |
| 53 |
Level Code Message |
| 54 |
set @@global.debug_dbug= @saved_dbug; |
| 55 |
include/start_slave.inc |
| 56 |
# |
| 57 |
# Ensure that a slave configured with Using_Gtid=Current_Pos will revert |
| 58 |
# to its default of Slave_Pos after RESET SLAVE. |
| 59 |
include/stop_slave.inc |
| 60 |
CHANGE MASTER TO MASTER_USE_GTID=Current_Pos; |
| 61 |
include/start_slave.inc |
| 62 |
include/stop_slave.inc |
| 63 |
RESET SLAVE; |
| 64 |
Warnings: |
| 65 |
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' |
| 66 |
# A notification that Using_Gtid was reverted should exist |
| 67 |
SHOW WARNINGS; |
| 68 |
Level Code Message |
| 69 |
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'Current_Pos' to 'Slave_Pos' |
| 70 |
include/start_slave.inc |
| 71 |
# Clear SHOW WARNINGS |
| 72 |
# The MTR include file rpl_change_topology.inc should implicitly set |
| 73 |
# MASTER_USE_GTID=NO when provided with $rpl_master_log_file. Note that |
| 74 |
# this will switch master and slave roles. |
| 75 |
connection slave; |
| 76 |
include/stop_slave.inc |
| 77 |
include/rpl_change_topology.inc [new topology=2->1] |
| 78 |
# connection 'master' is the slave in this comparison |
| 79 |
connection master; |
| 80 |
# Validating Using_Gtid=No.. |
| 81 |
# ..success |
| 82 |
include/rpl_change_topology.inc [new topology=1->2] |
| 83 |
# connection 'slave' is back to slave role |
| 84 |
connection slave; |
| 85 |
# Validating Using_Gtid=Slave_Pos.. |
| 86 |
# ..success |
| 87 |
include/start_slave.inc |
| 88 |
# |
| 89 |
# The MTR include file reset_slave.inc should keep/delete GTID state |
| 90 |
# when reset_slave_keep_gtid_state is set, respectively. |
| 91 |
# |
| 92 |
connection master; |
| 93 |
CREATE TABLE t1 (a INT); |
| 94 |
INSERT INTO t1 VALUES (1); |
| 95 |
DROP TABLE t1; |
| 96 |
include/save_master_gtid.inc |
| 97 |
connection slave; |
| 98 |
include/sync_with_master_gtid.inc |
| 99 |
include/stop_slave.inc |
| 100 |
# Tagging gtid_slave_pos before reset_slave.inc as old_slave_pos |
| 101 |
# Using reset_slave_keep_gtid_state=1 should preserve GTID state |
| 102 |
include/reset_slave.inc |
| 103 |
# Tagging gtid_slave_pos after reset_slave.inc as new_slave_pos |
| 104 |
# Validating old_slave_pos == new_slave_pos.. |
| 105 |
# ..success |
| 106 |
# Using reset_slave_keep_gtid_state=0 should empty GTID state |
| 107 |
include/reset_slave.inc |
| 108 |
# Tagging gtid_slave_pos as new_slave_pos |
| 109 |
# Validating new_slave_pos is empty.. |
| 110 |
# ..success |
| 111 |
set global gtid_slave_pos="old_slave_pos"; |
| 112 |
include/start_slave.inc |
| 113 |
# |
| 114 |
# A replica issued CHANGE MASTER TO specified with log coordinates but |
| 115 |
# not master_use_gtid=no should warn the user that Using_Gtid is being |
| 116 |
# changed to No. |
| 117 |
# |
| 118 |
connection master; |
| 119 |
include/save_master_pos.inc |
| 120 |
connection slave; |
| 121 |
include/sync_io_with_master.inc |
| 122 |
include/stop_slave.inc |
| 123 |
CHANGE MASTER TO master_log_pos=io_log_pos, master_log_file='io_log_file'; |
| 124 |
Warnings: |
| 125 |
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No' |
| 126 |
include/start_slave.inc |
| 127 |
# |
| 128 |
# A replica issued CHANGE MASTER TO specified with log coordinates and |
| 129 |
# master_use_gtid=Slave_Pos should warn the user that the log |
| 130 |
# coordinates will be ignored. |
| 131 |
# |
| 132 |
connection slave; |
| 133 |
include/stop_slave.inc |
| 134 |
CHANGE MASTER TO master_log_pos=io_log_pos, master_log_file='io_log_file', master_use_gtid=Slave_Pos; |
| 135 |
Warnings: |
| 136 |
Note 1618 MASTER_LOG_FILE option ignored |
| 137 |
Note 1618 MASTER_LOG_POS option ignored |
| 138 |
CHANGE MASTER TO relay_log_pos=relay_log_pos, relay_log_file='relay_log_file', master_use_gtid=Slave_Pos; |
| 139 |
Warnings: |
| 140 |
Note 1618 RELAY_LOG_FILE option ignored |
| 141 |
Note 1618 RELAY_LOG_POS option ignored |
| 142 |
include/start_slave.inc |
| 143 |
include/rpl_end.inc |
| 144 |
# |
| 145 |
# End of rpl_using_gtid_default.test |