When doing migrations or failovers in MySQL, there is usually a need to do a topology change and repoint replica servers to obtain replication data from a different server.
For example, given servers {A, B, and C} and the following topology:
If you need to repoint C to be a replica of B, i.e:
You can follow the next steps:
Note: log_replica_updates should be enabled on the soon-to-be primary as it is a prerequisite for chain replication.
Note: It is assumed that both replicas only stream from Server A and there are no conflicting replication filters in place that might break replication later on.
If Using File/Position-Based Replication:
1) Stop B and C STOP REPLICA; 2) If replicas are multi-threaded, correct MTS gaps and make them …[Read more]