Commit f2c4765c authored by unknown's avatar unknown

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.
parent dbfe5f47
...@@ -6181,6 +6181,17 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size) ...@@ -6181,6 +6181,17 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size)
DBUG_RETURN(ev); DBUG_RETURN(ev);
} }
/*
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 We can, and should release data_lock while we are waiting for
update. If we do not, show slave status will block update. If we do not, show slave status will block
...@@ -6241,17 +6252,6 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size) ...@@ -6241,17 +6252,6 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size)
rli->ignore_log_space_limit= true; rli->ignore_log_space_limit= true;
} }
/*
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 If the I/O thread is blocked, unblock it. Ok to broadcast
after unlock, because the mutex is only destroyed in after unlock, because the mutex is only destroyed in
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment