To get a better understanding of what exactly would be involved in supporting multiple masters, I decided to just start hacking it up. I did this mainly to get a sense of what would need to be changed, since my original design didn't allow for this at all. (Shortsightedness on my part I suppose.)
So I have a beta version of my results available in this Launchpad branch:
lp:~dshrews/drizzle/beta-multi-masterFrom my simple tests, it seems to work. I'm not real happy with the code (like I said, this was a hack), but functionality is there. I'm not promising this will go into Drizzle trunk just yet. I would like to make some improvements on it, and I'd really like to get some feedback from people on it.
To use it, you'll first need to create a modified slave configuration file. Here is a sample one:
Currently, a total of 10 masters are supported. This was an arbitrary number. It was simplest to just predetermine a set number of masters due to some complications with config file parsing which I wasn't prepared to solve (this is one of the things I want to see fixed). One IO thread per master will be started, though we still use a single applier thread for the time being.ignore-errors [master1] master-host = foo.my.domain master-port = 3306 master-user = user1 master-pass = password [master2] master-host = bar.my.domain master-port = 3306 master-user = user2 master-pass = password
You'll notice in the sample config a new option, ignore-errors. If this option is present, the slave ignores any errors from replication events received from the masters that it executes locally. I highly recommend you have this option enabled. Also note the addition of the [master1] and [master2] sections that define options for each master. You can go all the way to a [master10] section.
Nothing changes with how you start your slave or masters (see my post on setting up a simple replication example).
Give it a try and let me know how it works for you. Again, this is bleeding edge stuff (does any other database support this? :) ), so be prepared for bugs.