Hi Sheeri,
> So I've seen replication break a few times due to duplicate queries.
> A few times it was around a server crashing, but I thought perhaps it
> was because of the crash. (ie, master sends a query, crashes, and
> then tries to send the query again when it comes back up).
>
> But in the past 16 hours, it's happened twice. Both times, no crash.
> No network problems that we know of. No other query problems.
>
> Therefore, we've deduced it's in the code -- it's trying to insert a
> field with a duplicate primary key. I've sent that off to the
> developers, who will hit things with sticks.
>
> However, why does MySQL transfer over DML queries that fail? If they
> have an error, shouldn't they not replicate? This seems like a very
> large bug to me.
It shouldn't, except in *very* limited circumstances (where you've
already shot yourself in the foot a few times, generally).
I have seen a case quite a few times where the slave "hiccups" and
apparently runs the same query twice. Is it possible that this is what
you're seeing?
Is your system replicating a mix of large (images, maybe) and small
(single-row) updates?
Regards,
Jeremy
--
Jeremy Cole
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104