Does anyone know which error codes are safe to ignore during replication, meaning the slave will remain consistent with the master?
For example
[mysqld]
slave-skip-errors=1007,1008,1050,1051,1054,1060,1061,1068,1094,1146
The example that I found omitted is 1213 (Deadlock found when trying to get lock; try restarting transaction, Error_code: 1213; handler error HA_ERR_LOCK_DEADLOCK
), which seems safe to me?
I've found little advice on the matter so seems like a good one for stackoverflow…
Best Answer
To get the ball rolling, let us start with the manual
option_mysqld_slave-skip-errors
Which includes:
Error: 1007 SQLSTATE: HY000 (ER_DB_CREATE_EXISTS)
Error: 1008 SQLSTATE: HY000 (ER_DB_DROP_EXISTS)
Error: 1050 SQLSTATE: 42S01 (ER_TABLE_EXISTS_ERROR)
Error: 1051 SQLSTATE: 42S02 (ER_BAD_TABLE_ERROR)
Error: 1054 SQLSTATE: 42S22 (ER_BAD_FIELD_ERROR)
Error: 1060 SQLSTATE: 42S21 (ER_DUP_FIELDNAME)
Error: 1061 SQLSTATE: 42000 (ER_DUP_KEYNAME)
Error: 1068 SQLSTATE: 42000 (ER_MULTIPLE_PRI_KEY)
Error: 1094 SQLSTATE: HY000 (ER_NO_SUCH_THREAD)
Error: 1146 SQLSTATE: 42S02 (ER_NO_SUCH_TABLE)
But in support of Dave's comment: