[Commits] Rev 3955: MDEV-5363: Make parallel replication waits killable in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Mon Dec 16 14:48:32 EET 2013


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

------------------------------------------------------------
revno: 3955
revision-id: knielsen at knielsen-hq.org-20131216124832-agr2fs0064ln3w4a
parent: knielsen at knielsen-hq.org-20131213132651-b90mxo3xqsq89r6u
committer: knielsen at knielsen-hq.org
branch nick: tmp-10.0-base
timestamp: Mon 2013-12-16 13:48:32 +0100
message:
  MDEV-5363: Make parallel replication waits killable
  
  Fix locking bug / race introduced by previous patch: If we
  bail out of next_event() due to kill, there was a small window
  where we could exit without rli->data_lock held, causing an
  unlock-twice bug.
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2013-12-13 13:26:51 +0000
+++ b/sql/slave.cc	2013-12-16 12:48:32 +0000
@@ -6182,6 +6182,17 @@ static Log_event* next_event(rpl_group_i
         }
 
         /*
+          We have to check sql_slave_killed() here an extra time.
+          Otherwise we may miss a wakeup, since last check was done
+          without holding LOCK_log.
+        */
+        if (sql_slave_killed(rgi))
+        {
+          mysql_mutex_unlock(log_lock);
+          break;
+        }
+
+        /*
           We can, and should release data_lock while we are waiting for
           update. If we do not, show slave status will block
         */
@@ -6242,17 +6253,6 @@ static Log_event* next_event(rpl_group_i
         }
 
         /*
-          We have to check sql_slave_killed() here an extra time.
-          Otherwise we may miss a wakeup, since last check was done
-          without holding LOCK_log.
-        */
-        if (sql_slave_killed(rgi))
-        {
-          mysql_mutex_unlock(log_lock);
-          break;
-        }
-
-        /*
           If the I/O thread is blocked, unblock it.  Ok to broadcast
           after unlock, because the mutex is only destroyed in
           ~Relay_log_info(), i.e. when rli is destroyed, and rli will



More information about the commits mailing list