[Commits] Rev 4501: Parallel replication: Wrong binlog order for directly-binlogged statements such as GRANT in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Thu Nov 13 16:09:39 EET 2014

At http://bazaar.launchpad.net/~maria-captains/maria/10.0

revno: 4501
revision-id: knielsen at knielsen-hq.org-20140924110900-zwifltu91y212vxk
parent: knielsen at knielsen-hq.org-20140923091832-asubf9da2dovya33
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0-mdev6676
timestamp: Wed 2014-09-24 13:09:00 +0200
  Parallel replication: Wrong binlog order for directly-binlogged statements such as GRANT
  Marked-for: 10.0
  In parallel replication, the wait_for_commit facility is used to ensure that
  events are written into the binlog in the correct order. This is handled in an
  optimised way in the binlogging group commit code.
  However, some statements, for example GRANT, are written directly into the
  binlog, outside of the group commit code. There is a bug that this direct
  write does not correctly wait for the prior transactions to have been written
  first, which allows f.ex. GRANT to be written ahead of earlier transactions.
  This patch does a quick partial fix, adding the missing
  wait_for_prior_commit() before writing directly to the binlog.
  However, the problem is still there, although the race is much less likely to
  occur now. The problem is that the optimised group commit code does wakeup of
  following transactions early, before the binlog write is actually done. A
  woken-up following transaction is then allowed to run ahead and queue up for
  the group commit, which will ensure that binlog write happens in correct order
  in the end. However, the code for directly written events currently bypass
  this mechanism, so they get woken up and written too early. This needs to be
  fixed properly in a later patch.
  (Also fix a confusing error message in the testsuite).

More information about the commits mailing list