mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
5ab5ff08b0
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>
61 lines
3 KiB
Text
61 lines
3 KiB
Text
#
|
|
# Start of 10.2 tests
|
|
#
|
|
#
|
|
# MDEV-21037 mariabackup does not detect multi-source replication slave
|
|
#
|
|
SELECT @@global.gtid_slave_pos;
|
|
@@global.gtid_slave_pos
|
|
|
|
|
|
# Without any masters the file xtrabackup_slave_info is not created
|
|
line
|
|
[00] YYYY-MM-DD hh:mm:ss Failed to get master binlog coordinates from SHOW SLAVE STATUS.This means that the server is not a replication slave. Ignoring the --slave-info option
|
|
|
|
CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=10000;
|
|
lineno line
|
|
1 CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>;
|
|
line
|
|
[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: master '' filename '' position '0'
|
|
|
|
CHANGE MASTER 'master2' TO MASTER_HOST='localhost', MASTER_PORT=10002;
|
|
lineno line
|
|
1 CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>;
|
|
2 CHANGE MASTER 'master2' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>;
|
|
line
|
|
[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: master '' filename '' position '0'; master 'master2' filename '' position '0'
|
|
|
|
SET GLOBAL gtid_slave_pos='1-1-1,2-2-2';
|
|
CHANGE MASTER 'master3' TO MASTER_HOST='localhost', MASTER_PORT=10003, MASTER_USE_GTID=slave_pos;
|
|
CHANGE MASTER 'master4' TO MASTER_HOST='localhost', MASTER_PORT=10004, MASTER_USE_GTID=no;
|
|
CHANGE MASTER 'master5' TO MASTER_HOST='localhost', MASTER_PORT=10005, MASTER_USE_GTID=slave_pos;
|
|
lineno line
|
|
1 SET GLOBAL gtid_slave_pos = '<NUM-NUM-NUM>,<NUM-NUM-NUM>';
|
|
2 CHANGE MASTER TO master_use_gtid = slave_pos;
|
|
3 CHANGE MASTER 'master2' TO master_use_gtid = slave_pos;
|
|
4 CHANGE MASTER 'master3' TO master_use_gtid = slave_pos;
|
|
5 CHANGE MASTER 'master4' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>;
|
|
6 CHANGE MASTER 'master5' TO master_use_gtid = slave_pos;
|
|
line
|
|
[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' master_use_gtid = slave_pos; master 'master2' master_use_gtid = slave_pos; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos
|
|
|
|
CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=10000, MASTER_USE_GTID=slave_pos;
|
|
lineno line
|
|
1 SET GLOBAL gtid_slave_pos = '<NUM-NUM-NUM>,<NUM-NUM-NUM>';
|
|
2 CHANGE MASTER TO master_use_gtid = slave_pos;
|
|
3 CHANGE MASTER 'master2' TO master_use_gtid = slave_pos;
|
|
4 CHANGE MASTER 'master3' TO master_use_gtid = slave_pos;
|
|
5 CHANGE MASTER 'master4' TO MASTER_LOG_FILE='', MASTER_LOG_POS=<NUM>;
|
|
6 CHANGE MASTER 'master5' TO master_use_gtid = slave_pos;
|
|
line
|
|
[00] YYYY-MM-DD hh:mm:ss MySQL slave binlog position: gtid_slave_pos '<NUM-NUM-NUM>,<NUM-NUM-NUM>'; master '' master_use_gtid = slave_pos; master 'master2' master_use_gtid = slave_pos; master 'master3' master_use_gtid = slave_pos; master 'master4' filename '' position '0'; master 'master5' master_use_gtid = slave_pos
|
|
RESET SLAVE ALL;
|
|
RESET SLAVE 'master2' ALL;
|
|
RESET SLAVE 'master3' ALL;
|
|
RESET SLAVE 'master4' ALL;
|
|
Warnings:
|
|
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos'
|
|
RESET SLAVE 'master5' ALL;
|
|
#
|
|
# End of 10.2 tests
|
|
#
|