Using Master-Master for failover? :(

| Keine Kommentare | Keine TrackBacks

Using master-master for MySQL? To be frankly we need to get rid of that architecture. We are skipping the active-active setup and show why master-master even for failover reasons is the wrong decision.

So why does a DBA thinks master-master is good for in a failover scenario?

  • The recovered node does get his data automatically.
  • You need not to use a backup for recovery.

Please remember: MySQL Replication is async

Again: MySQL Replication is async. Even the so called semi-sync Replication!

So following is quite likely.

See a nice master-master setup:

 activ                 standby
+------+     c        +------+
|      |------------->|      |
|abcd  |              |ab    |
|      |              |      |
|      |<-------------|      |
+------+              +------+

Oh my god the node went down:

 RIP                   activ
+------+              +------+
|      |-----||------>|      |
|abcd  |              |abc   |
|      |              |      |
|      |<----||-------|      |
+------+              +------+

Np, we’ve got master-master. After the takeover the recovering node fetches up. (As a fact it has one transaction more:( )

recovered              activ
+------+              +------+
|      |------------->|      |
|abcd  |              |abce  |
|      |      e       |      |
|      |<-------------|      |
+------+              +------+

Great we got no sync data anymore!

recovered             activ
+------+              +------+
|      |------------->|      |
|abcde |              |abce  |
|      |              |      |
|      |<-------------|      |
+------+              +------+

As a fact there is no need for master-master anyway. We’ve got GTID nowadays. Use a simple replication. In a failover you can use GTID to check if you got extra transactions on the recovering node.

If not then simply create a replication and you get all the missing data.

But if there are extra transactions on the recovering node you got to rebuild the node anyway.

FYI: This works with GTID@MariaDB and GTID@MySQL.

Welcome to the GTID era! \o/

Viel Spaß

Erkan :)

Keine TrackBacks

TrackBack-URL: http://linsenraum.de/mt/mt-tb.cgi/357

Jetzt kommentieren

Über diese Seite

Diese Seite enthält einen einen einzelnen Eintrag von erkan vom 5.03.15 14:55.

systemd Centos7 => MySQL/MariaDB ist der vorherige Eintrag in diesem Blog.

Galera for Mesos ist der nächste Eintrag in diesem Blog.

Aktuelle Einträge finden Sie auf der Startseite, alle Einträge in den Archiven.

Seiten

Powered by Movable Type 4.23-en