
RELAY_LOG_FILE and RELAY_LOG_POS options were also specified.

The MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you
enable GTID mode for replication by setting the MASTER_USE_GTID option to some
value other than no in the statement.

MASTER_LOG_POS
--------------

The MASTER_LOG_POS option for CHANGE MASTER can be used along with
MASTER_LOG_FILE to specify the coordinates at which the replica's I/O thread
should begin reading from the primary's binary logs the next time the thread
starts.

For example:

STOP SLAVE;
CHANGE MASTER TO
 MASTER_LOG_FILE='master2-bin.001',
 MASTER_LOG_POS=4;
START SLAVE;

The MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the
RELAY_LOG_FILE and RELAY_LOG_POS options were also specified.

The MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you
enable GTID mode for replication by setting the MASTER_USE_GTID option to some
value other than no in the statement.

Relay Log Options
-----------------

These options are related to the relay log position on the replica.

RELAY_LOG_FILE
--------------

The RELAY_LOG_FILE option for CHANGE MASTER can be used along with the
RELAY_LOG_POS option to specify the coordinates at which the replica's SQL
thread should begin reading from the relay log the next time the thread starts.

The CHANGE MASTER statement usually deletes all relay log files. However, if
the RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing
relay log files are kept.

When you want to change the relay log position, you only need to stop the
replica's SQL thread. The replica's I/O thread can continue running. The STOP
SLAVE and START SLAVE statements support the SQL_THREAD option for this
scenario. For example:

STOP SLAVE SQL_THREAD;
CHANGE MASTER TO
 RELAY_LOG_FILE='slave-relay-bin.006',
 RELAY_LOG_POS=4025;
START SLAVE SQL_THREAD;

When the value of this option is changed, the metadata about the replica's SQL
thread's position in the relay logs will also be changed in the relay-log.info
file or the file that is configured by the relay_log_info_file system variable.

The RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the
MASTER_LOG_FILE and MASTER_LOG_POS options were also specified.

RELAY_LOG_POS
-------------

The RELAY_LOG_POS option for CHANGE MASTER can be used along with the
RELAY_LOG_FILE option to specify the coordinates at which the replica's SQL
thread should begin reading from the relay log the next time the thread starts.

The CHANGE MASTER statement usually deletes all relay log files. However, if
the RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing
relay log files are kept.

When you want to change the relay log position, you only need to stop the
replica's SQL thread. The replica's I/O thread can continue running. The STOP
SLAVE and START SLAVE statements support the SQL_THREAD option for this
scenario. For example:

STOP SLAVE SQL_THREAD;
CHANGE MASTER TO
 RELAY_LOG_FILE='slave-relay-bin.006',
 RELAY_LOG_POS=4025;
START SLAVE SQL_THREAD;

When the value of this option is changed, the metadata about the replica's SQL
thread's position in the relay logs will also be changed in the relay-log.info
file or the file that is configured by the relay_log_info_file system variable.

The RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the
MASTER_LOG_FILE and MASTER_LOG_POS options were also specified.

GTID Options
------------

MASTER_USE_GTID
---------------

The MASTER_USE_GTID option for CHANGE MASTER can be used to configure the
replica to use the global transaction ID (GTID) when connecting to a primary.
The possible values are:

* current_pos - Replicate in GTID mode and use gtid_current_pos as the
position to start downloading transactions from the primary. Deprecated from
MariaDB 10.10. Using to transition to primary can break the replication state
if the replica executes local transactions due to actively updating
gtid_current_pos with gtid_binlog_pos and gtid_slave_pos. Use the new, safe,
MASTER_DEMOTE_TO_SLAVE=<bool> option instead.
* slave_pos - Replicate in GTID mode and use gtid_slave_pos as the position to
start downloading transactions from the primary. From MariaDB 10.5.1,
replica_pos is an alias for slave_pos.
* no - Don't replicate in GTID mode.

MASTER_DEMOTE_TO_SLAVE
----------------------

MariaDB starting with 10.10
---------------------------
Used to transition a primary to become a replica. Replaces the old
MASTER_USE_GTID=current_pos with a safe alternative by forcing users to set
Using_Gtid=Slave_Pos and merging gtid_binlog_pos into gtid_slave_pos once at
CHANGE MASTER TO time. If gtid_slave_pos is more recent than gtid_binlog_pos
(as in the case of chain replication), the replication state should be
preserved.

For example:

STOP SLAVE;
CHANGE MASTER TO
 MASTER_USE_GTID = current_pos;
START SLAVE;

Or:

STOP SLAVE;
SET GLOBAL gtid_slave_pos='0-1-153';
CHANGE MASTER TO
 MASTER_USE_GTID = slave_pos;
START SLAVE;

Replication Filter Options
--------------------------

Also see Replication filters.

IGNORE_SERVER_IDS
-----------------

The IGNORE_SERVER_IDS option for CHANGE MASTER can be used to configure a
replica to ignore binary log events that originated from certain servers.
Filtered binary log events will not get logged to the replica’s relay log, and
they will not be applied by the replica.
