List:Replication« Previous MessageNext Message »
From:Johan De Meersman Date:October 27 2011 7:51am
Subject:Re: Master-Master -> duplicate entry
View as plain text  
----- Original Message -----
> From: "Marcus Bointon" <marcus@stripped>
> 
> Writing to both masters is not improving your redundancy - it's
> reducing it! If your replication fails then you've got incomplete
> data on BOTH servers, not just one.

Say what? If that's the case, you haven't set up your replication correctly. There are
quite a few reasons to not use both masters concurrently, but this is not one of them.

> You really don't want to do it.
> This is why MMM sets the passive master to read-only. The increment

No, it does that because it sets up an active/passive master pair and wants to prevent
accidental writes on the passive master.

You can perfectly use an active-active dual-master setup, but your application must be
built around it. Most applications aren't.

> As has been said many times, master-master replication is not a
> scaling solution.

Depends. It can be a very useful scaling solution if it fits your environment.


A very summary view of dual active master:

* it is NOT a WRITE-scaling solution (both masters still must write all data), but it *is*
a valid option in a read-heavy, low-write environment.
* a minor problem for dual-active is clashing autoincrements on inserts - this is easily
solved using offsetting.
* the MAJOR problem, however, is that due to the asynchronous nature of replication, it is
possible to have conflicting updates. There is no solution for this in the standard
version of MySQL, although a number of vendors do have solutions.


Imagine a dual-active scenario, with a client connected to each host. Client a updates
record 123 on host A. At approximately the same moment, client b deletes that same record
123 on host B. Both statements succeed (asynchronous, remember) and then get sent to the
other side. Host A receives a delete statement for record 123 and executes it normally.
Host B, however, receives an update statement for record 123 and fails with a "no such
record" error. Your databases are now inconsistent, and replication grinds to a halt.

THAT is the problem with writing to both masters at once.



-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
Master-Master -> duplicate entryRicardo Freitas26 Oct
  • Re: Master-Master -> duplicate entrynavid@navid.it26 Oct
    • Re: Master-Master -> duplicate entryRicardo26 Oct
  • Re: Master-Master -> duplicate entryRick James27 Oct
    • Re: Master-Master -> duplicate entryRicardo27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryJohan De Meersman27 Oct
          • Re: Master-Master -> duplicate entryRicardo27 Oct
          • Re: Master-Master -> duplicate entryRicardo27 Oct
          • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
            • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
              • Re: Master-Master -> duplicate entrynavid@navid.it27 Oct
              • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                  • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                    • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                    • Re: Master-Master -> duplicate entryRicardo27 Oct
                      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                        • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
                          • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
                            • Re: Master-Master -> duplicate entry (UUID lecture)Rick James27 Oct
            • Re: Master-Master -> duplicate entryJohan De Meersman28 Oct
        • Re: Master-Master -> duplicate entryRicardo27 Oct
  • Re: Master-Master -> duplicate entrylist27 Oct
    • RE: Master-Master -> duplicate entryRicardo Freitas27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryMySQL)27 Oct
    • Re: Master-Master -> duplicate entryRick James27 Oct
      • Re: Master-Master -> duplicate entryMarcus Bointon27 Oct
        • Re: Master-Master -> duplicate entryRick James27 Oct
          • Re: Master-Master -> duplicate entryJohan De Meersman28 Oct
            • Re: Master-Master -> duplicate entryRick James28 Oct
              • Re: Master-Master -> duplicate entryMats Kindahl31 Oct
      • Re: Master-Master -> duplicate entrylist27 Oct