Using MYSQL Replication to Accelerate Schema Changes and Table Operations

I have heard that many people use master-slave mechanisms to improve the time taken to change schemas, using replication to install a new temporary master, and then stop moving and then perform role replacement before starting again. I found an example (below) found on stack overflow.

  • Slave setup
  • Stop replication.
  • Make ALTER on the slave
  • Let the subordinate catch up with the master
  • swap master and slave, so the slave becomes a production server with a changed structure and minimal downtime

This is all very good, however, I do not understand that step 4 is not clear to me.

I wonder if anyone can explain the procedure more easily.

+4
source share
2 answers

Let the subordinate catch up with the master

Assume that the slave catches up with the leading value of the slave by 0 seconds behind the master.

This means that replication stopped at some point (to modify the table),
It will record the latest replication time.

When replication resumes,
it will compare the current record with the master with the last replication time on the slave.

However, the procedures look like a flaw .
You cannot change slavery and the pending scheme in the updated slave is the same as master .

In the event column, the value has changed, the column is omitted,
could potentially cause replication failure.

+1
source

seconds_behind_master should be 0.

0
source

All Articles