summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-12-13 14:26:51 +0100
committerunknown <knielsen@knielsen-hq.org>2013-12-13 14:26:51 +0100
commitdbfe5f4774cf35283f7c7378d25fe881c00103c2 (patch)
tree6bda414f61cd9c29b376ef3a3b466f4febd3a387 /sql/slave.cc
parentb7ae65ef86636e986594d8e44dec83a83311977c (diff)
downloadmariadb-git-dbfe5f4774cf35283f7c7378d25fe881c00103c2.tar.gz
MDEV-5363: Make parallel replication waits killable
Add a test case for killing a waiting query in parallel replication. Fix several bugs found: - We should not wakeup_subsequent_commits() in ha_rollback_trans(), since we do not know the right wakeup_error() to give. - When a wait_for_prior_commit() is killed, we must unregister from the waitee so we do not race and get an extra (non-kill) wakeup. - We need to deal with error propagation correctly in queue_for_group_commit when one thread is killed. - Fix one locking issue in queue_for_group_commit(), we could unlock the waitee lock too early and this end up processing wakeup() with insufficient locking. - Fix Xid_log_event::do_apply_event; if commit fails it must not update the in-memory @@gtid_slave_pos state. - Fix and cleanup some things in the rpl_parallel.cc error handling. - Add a missing check for killed in the slave sql driver thread, to avoid a race.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 4be4a96d142..bddb69d84bb 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -6242,6 +6242,17 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size)
}
/*
+ 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