MySQL slave-skip-errors = 0

MySQLreplication

I'm migrating a cluster that has the following set for slave-skip-errors:

slave-skip-errors = 0,1062,1053,1051

Of course, as these things go, nobody knows why it was setup like this or who did it, or if they're even with the company. I also know why NOT to put slave-skip-errors of any kind, but I am totally clueless as to the "0". The replication I'm setting up will not have any slave-skip-errors.

Looking at http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html I can find all the codes that are skipped. I can only assume that the zero is a sort of catch-all for slave-skip-errors? My google-fu is not so strong on this one, I can't really find an answer to my question, so I'm hoping that some MySQL guru here will be able to confirm or deny the 0, and if it in fact does anything.

Thanks!

Best Answer

There shouldn't be any of these, this configuration directive should be set to default (not ignoring any of the errors). As simple as that. And if I were you - I would reinitialize the whole replica. It's almost inevitably out of sync, on logical level.

This urban legend (setting non-default slave-skip-errors) comes out of two things:

  • lack of understanding how the replication works
  • the funny fact that MySQL doesn't set replica to read-only by default, so any clients that still connect to it (due to stale connection descriptors, or stuck connection poolers) may easily damage it. So every replica probably needs to be read-only, unless there's a cyclic chain replication (from my point of view - another nonsense) or at least definitive understanding why it should be read-write.