From: Michael L. <ml...@lo...> - 2013-12-19 23:12:37
|
On 20/12/13 08:35, da...@ha... wrote: > If you ARE running a mysql setup with a master and a slave, this error > could in theory occur if your MySQL replication has stopped, failed, is > slow or way behind. Because, if the new triplets arent copied to the > slave, it wont be there when you read from your read_host. Thus, sqlgrey > thinks this is a new triplet and gladly tries to insert into the master, > where it actually already existed and boom-goes-the-dynamite.... you get > the Duplicate entry error. Why don't we do INSERT IGNORE ... to prevent the duplicate key error? It's probably only a timing issue, the pre-existing record would eventually propagate from the master to the slave over time so it's not a problem if we can't insert it again. One other thing - could the index be corrupted? The index may think the record is there while in fact it isn't. Michael |