Potential loss of data when switching masters

2 views
Skip to first unread message

mmoench

unread,
Oct 26, 2009, 11:47:54 AM10/26/09
to MySQL Multi Master Manager Development
Hi, I want to create a "fail save" replication with multiple slave
servers and was looking at your scripts as possible solution. But as
far as I can see there is a possible danger that write statements
which are made shortly after one master fails (and the Backup takes
over) are not replicated to every slave. But I might be wrong if I'm
looking at the wrong files...

I guess the function to switch the master of a slave is in lib/Agent/
Helpers/Actions.pm where the slave reads as much out of the old master
log and then switches to the new master which is done by simply using
the values one gets by executing the 'SHOW MASTER STATUS' command on
the new master.

The problem I have with this is as follows:

I have 4 Servers, 2 Slaves, 1 Master and 1 Backup-Master. The Master
fails. Slave 1 switches to the Backup master first, someone inserts a
row on the Backup-Master (now the regular Master), finally Slave 2
switches to the Backup Master too (maybe he had a little bit more load
than Slave 1 and was unable to switch at the same moment). What
happened now is that The Backup Master and Slave 1 have different Data
than the Slave 2.

Correct me if I'm wrong but shouldn't the Slaves start replicating at
the same position from the new Master where they stopped at the old
one (which is a little bit tricky I guess because log-pos and log-file
may be different for the same logical position)?

Paul Graydon

unread,
Oct 26, 2009, 12:52:51 PM10/26/09
to mmm-...@googlegroups.com
From my understanding of MMM it's never been designed or intended to be
a 100% data safe fail over system. You'd be better off looking at a
heartbeat/DRBD type solution for that, there is always a danger of data
losing sync when you're requiring issuing of commands to handle it.

There is a good run-down of various HA setups here:
http://www.mysqlperformanceblog.com/2009/10/16/finding-your-mysql-high-availability-solution-%E2%80%93-the-questions/

If you've not come across them before there are some very handy tools
for mysql syncing (and others) here: http://www.maatkit.org/

Paul
Reply all
Reply to author
Forward
0 new messages