Replication Issue with "Can't find record in 'audit_main'" Error

Document ID : KB000099901
Last Modified Date : 14/06/2018
Show Technical Document Details
Question:
We had an issue with one of their production boxes where replication was broken. What would trigger a replication break?

----------------------------
180519  2:00:06 [Warning] Slave SQL: Could not execute Delete_rows event on table ssg.audit_main; Can't find record in 'audit_main', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log ssgbin-log.000303, end_log_pos 31938408, Error_code: 1032
180519  2:00:06 [Warning] Slave SQL: Could not execute Delete_rows event on table ssg.audit_main; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log ssgbin-log.000303, end_log_pos 31938408, Error_code: 1032
180519  2:00:06 [Warning] Slave SQL: Could not execute Delete_rows event on table ssg.audit_main; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log ssgbin-log.000303, end_log_pos 31938408, Error_code: 1032
180519  2:00:06 [Warning] Slave SQL: Could not execute Delete_rows event on table ssg.audit_main; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log ssgbin-log.000303, end_log_pos 31938408, Error_code: 1032
180519  2:00:06 [Warning] Slave SQL: Could not execute Delete_rows event on table ssg.audit_main; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; Can't find record in 'audit_main', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log ssgbin-log.000303, end_log_pos 31938408, Error_code: 1032
----------------------------
 
Environment:
CA API Gateway 8.1
Answer:
These errors come from running the audit purge script on both the primary and secondary gateway nodes. The audit purge script should only be executed on the primary node.