3

I am still pretty newbie to mysql. This question is regarding promoting slave with option --log-slave-updates to become a master.

The typical schema of promoting slave to master was described in 15.3.6 Switching Masters During Failover. Here you can find very strict steps how to do it :

Run your slaves with the --log-bin option and without --log-slave-updates. The reason for running the slave without --log-slave-updates is to prevent slaves from receiving updates twice in case you cause one of the slaves to become the new master.

Let's say I have the schema like the following (the image was taken from 15.3.5. Improving Replication Performance).

enter image description here

Where Master 2 is actually a slave with --log-slave-updates and bin-log enabled. I need to enable --log-slave-update in order to save bin-log from the Master 1 to bin-log of Master 2 and then transfer it to all slave. In case of failover I need promote Master 2 to the role of Master 1. But there is a contradiction to the standard MySql failover schema I have --log-slave-updates enabled which can cause a problem.

In your opinion. What the action I should take in order to do this?

3

The warning about --log-slave-updates will only apply if you had multiple intermediary 'Master/Slave' servers.

The warning is this (my emphasis):

Then it will write updates that it receives from Master to its own binary log. When Slave 2 changes from Master to Slave 1 as its master, it may receive updates from Slave 1 that it has already received from Master

But in your scenario, Slave 2 is not changing masters, it will still point to the same Master 2 server it always was at.

So now, in case of Master 1 failing, you will need to do two things:

  • Make sure your applications point to Master 2
  • Follow the instructions on promoting one of the three slaves to be new Master 2
  • make sure to enable --log-slave-updates on the new Master 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.