大网数据广告活动
服务器运维问答

MySQL slave-skip-errors = 0?

· 52CE 我爱测

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 comp…

问题原文

原帖链接 · Vladimir · CC BY-SA 3.0

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!

已采纳解答

原帖链接 · drookie · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。