I recently encountered an error when two slave databases were using the same server_id value. I know having unique server_ids across all MySQL databases in a given replication topology is a best practice, but I'm not sure I understand exactly why MySQL is trying to enforce uniqueness in this specific case.
The most obvious reason to use unique server_id values for every database in a replication setup is to avoid having a master and slave with the same server_id. If that happens the slave will skip any events coming from that master.
But if I have two slaves with the same server_id, that should be safe unless I promote one of those slave to be the master of the other. Is that the case that MySQL is trying to protect me from, or is there some other case I am missing?
My specific problem started when I cloned a slave database. This is something I do fairly often, but most of the time I am creating a new read slave, and I …
[Read more]