[Commits] Rev 4496: MDEV-7121: Parallel slave may hang if master crashes in the middle of writing transaction to binlog in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Mon Nov 17 13:42:03 EET 2014


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

------------------------------------------------------------
revno: 4496
revision-id: knielsen at knielsen-hq.org-20141117114202-64xpofds30k3i638
parent: knielsen at knielsen-hq.org-20141117114144-911vnd0ssd6hlw45
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0
timestamp: Mon 2014-11-17 12:42:02 +0100
message:
  MDEV-7121: Parallel slave may hang if master crashes in the middle of writing transaction to binlog
  
  When a master server restarts, it writes a restart format_description event as
  the first event in the next binlog file. The parallel slave SQL thread queues
  a special restart entry for the current worker thread to signal this, so that
  the worker thread can roll back any prior partial transaction that might have
  been written to the binlog due to master crashing.
  
  This queueing was missing a mysql_cond_signal() to notify the worker
  thread. This could cause the worker thread to not process the restart entry,
  and this in turn would cause the SQL thread to hang infinitely waiting for the
  worker thread to complete processing.
  
  Fix by adding the missing wakeup signalling for this case.
=== modified file 'sql/rpl_parallel.cc'
--- a/sql/rpl_parallel.cc	2014-11-13 09:46:09 +0000
+++ b/sql/rpl_parallel.cc	2014-11-17 11:42:02 +0000
@@ -1760,6 +1760,7 @@ rpl_parallel_entry::queue_master_restart
   qev->ir= rli->last_inuse_relaylog;
   ++qev->ir->queued_count;
   thr->enqueue(qev);
+  mysql_cond_signal(&thr->COND_rpl_thread);
   mysql_mutex_unlock(&thr->LOCK_rpl_thread);
   return 0;
 }



More information about the commits mailing list