Bug #68966 "can't find record" error on value insert?
Submitted: 15 Apr 2013 22:34 Modified: 29 Apr 2013 17:39
Reporter: Trey Raymond Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.5.29 OS:Linux (RHEL 6.3)
Assigned to: CPU Architecture:Any
Tags: replication statement insert

[15 Apr 2013 22:34] Trey Raymond
Description:
Statement based replication.  This only happened on one slave, others were fine.  It's just an insert with a list of explicit rows, nothing unusual, and of course it doesn't make sense to get a "can't find record" error when the query isn't looking for any records.
I just ran "start slave" and it worked fine, processed the statement without recurrence, but it did cause an outage on a production system and could for others as well.

130415 20:58:50 [ERROR] Slave SQL: Error 'Can't find record in 'keyword_audience_aggregate_state_stg'' on query. Default database: 'zestdb'. Query: 'INSERT INTO keyword_audience_aggregate_state_stg (hourID, campaignID, creativeID, keyword, segment, bucket, location, location_level, impressions, clicks, last_updated) VALUES('379459','tcu53zd8','669ca6f3d9b34814af590e5f3f1860d1','glasses','5816104','2','1','1','11','0',NOW()),('379459','121000_121000','VqmscTrYgp','j','10828333','2','0','3','75','0',NOW()),('379459','121000_121000','VqmscTrYgp','j','10828333','3','1','1','41','0',NOW()),('379459','121000_121000','VqmscTrYgp','s','10828333','3','0','3','567','0',NOW()),('379459','121000_121000','VqmscTrYgp','21','10828333','2','0','3','278','0',NOW()),('379459','121000_121000','VqmscTrYgp','21','10828333','3','1','1','93','0',NOW()),('379459','121000_121000','VqmscTrYgp','hm','10828333','3','0','3','6','0',NOW()),('379459','121000_121000','VqmscTrYgp','vs','0','3','1','1','2','0',NOW()),('379459','121000_121000','VqmscTrYgp','ann','10
130415 20:58:50 [Warning] Slave: Can't find record in 'keyword_audience_aggregate_state_stg' Error_code: 1032

How to repeat:
Run a bunch of batch inserts with statement replication on this version, I'd guess - but this is the first time I've seen it.

Suggested fix:
Find out how a basic insert query (not an ins..sel, mind you, just values specified) could get a record not found error
[20 Apr 2013 18:10] MySQL Verification Team
Kindly send us output of;

show create table zestdb.keyword_audience_aggregate_state_stg\G
check table zestdb.keyword_audience_aggregate_state_stg;

are there any before/after triggers on this table?
[29 Apr 2013 17:39] Trey Raymond
There are no triggers.  We did find that they were running some third party plugins, however (sorry for not noticing that at first, managing 14K servers makes me spacey sometimes) and the problem hasn't recurred since we disabled that - so I'm closing this.  If it does recur, I'll reopen.  Thanks.