1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00
Files
mariadb/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
Brandon Nesterenko 5ab5ff08b0 MDEV-19801: Change defaults for CHANGE MASTER TO so that GTID-based replication is used by default if master supports it
This commit makes replicas crash-safe by default by changing the
Using_Gtid value to be Slave_Pos on a fresh slave start and after
RESET SLAVE is issued. If the primary server does not support GTIDs
(i.e., version < 10), the replica will fall back to Using_Gtid=No on
slave start and after RESET SLAVE.

The following additional informational messages/warnings are added:

 1. When Using_Gtid is automatically changed. That is, if RESET
SLAVE reverts Using_Gtid back to Slave_Pos, or Using_Gtid is
inferred to No from a CHANGE MASTER TO given with log coordinates
without MASTER_USE_GTID.
 2. If options are ignored in CHANGE MASTER TO. If CHANGE MASTER TO
is given with log coordinates, yet also specifies
MASTER_USE_GTID=Slave_Pos, a warning message is given that the log
coordinate options are ignored.

Additionally, an MTR macro has been added for RESET SLAVE,
reset_slave.inc, which provides modes/options for resetting a slave
in log coordinate or gtid modes. When in log coordinates mode, the
macro will execute CHANGE MASTER TO MASTER_USE_GTID=No after the
RESET SLAVE command. When in GTID mode, an extra parameter,
reset_slave_keep_gtid_state, can be set to reset or preserve the
value of gtid_slave_pos.

Reviewed By:
===========
Andrei Elkin <andrei.elkin@mariadb.com>
2022-07-26 13:31:27 -06:00

55 lines
1.7 KiB
Plaintext

include/master-slave.inc
[connection master]
connection slave;
master_id: 1
stop slave;
*** --replicate-same-server-id and change master option can clash ***
change master to IGNORE_SERVER_IDS= (2, 1);
ERROR HY000: The requested server id 2 clashes with the slave startup option --replicate-same-server-id
*** must be empty due to the error ***
ignore server id list:
change master to IGNORE_SERVER_IDS= (10, 100);
*** must be 10, 100 ***
ignore server id list: 10, 100
include/reset_slave.inc
*** must be empty due to reset slave ***
ignore server id list: 10, 100
change master to IGNORE_SERVER_IDS= (10, 100);
*** CHANGE MASTER with IGNORE_SERVER_IDS option overrides (does not increment) the previous setup ***
change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
*** must be 1, 3, 4, 5 due to overriding policy ***
ignore server id list: 1, 3, 4, 5
*** ignore master (server 1) queries for a while ***
start slave;
connection master;
connection slave;
connection master;
create table t1 (n int);
connection slave;
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
*** must be empty as the event is to be filtered out ***
show tables;
Tables_in_test
*** allowing events from master ***
stop slave;
include/wait_for_slave_to_stop.inc
include/reset_slave.inc
change master to IGNORE_SERVER_IDS= (10, 100);
*** the list must remain (10, 100) after reset slave ***
change master to IGNORE_SERVER_IDS= ();
*** must be empty due to IGNORE_SERVER_IDS empty list ***
ignore server id list:
change master to master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root';
start slave;
connection master;
connection slave;
*** must have caught create table ***
show tables;
Tables_in_test
t1
connection master;
drop table t1;
connection slave;
end of the tests
include/rpl_end.inc