List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:October 24 2006 2:15pm
Subject:Re: Statement gets written to binlog after deadlock
View as plain text  
Hi!

On Oct 24, Baron Schwartz wrote:
> In this particular case, the program would have retried the statement that 
> deadlocked:
> 
> INSERT into MyISAM temp table
> SELECT from InnoDB table join MyISAM temp table join MyISAM temp table
> 
> >>We have been having persistent issues with statements causing
> >>deadlock, yet being written to the binlog anyway, thus replicated
> >>through to the slave, where of course there is no deadlock.  The
> >>error message is "Query caused different errors on master and slave.
> >>Error on master: 'Deadlock found when trying to get lock; try
> >>restarting transaction' (1213), Error on slave: 'no error' (0)"

You're mixing transactional and non-transactional tables in one
transaction. Such a transaction is always written to binlog, even when
it's rolled back. It is assumed that changes to transactional tables
were rolled back, changes to non-transactional tables remained, and the
same will happen on the slave - so changes to non-transactional tables
will be replicated correctly. On rollback you must see a warning "Some
non-transactional changed tables couldn't be rolled back".

Of course in your case the rollback doesn't happen on slaves :(

Try to ignore this error with --slave-skip-errors=1213

Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Kerpen, Germany
       <___/  www.mysql.com
Thread
Statement gets written to binlog after deadlockBaron Schwartz23 Oct
  • RE: Statement gets written to binlog after deadlockRick James24 Oct
    • Re: Statement gets written to binlog after deadlockBaron Schwartz24 Oct
      • RE: Statement gets written to binlog after deadlockRick James24 Oct
      • Re: Statement gets written to binlog after deadlockSergei Golubchik24 Oct