Commit 6c93a5d2 authored by Sergei Golubchik's avatar Sergei Golubchik

mdev-201 - Assertion `!thd->spcont' failed in net_send_error on server shutdown

bug in semisync plugin. It didn't check thd->killed before waiting on mysys->current_cond,
and thus an attepmt to kill the thread (on shutdown) was lost

plugin/semisync/semisync_master.cc:
  mdev:201 lp:962540
parent d8eb42ce
...@@ -626,7 +626,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, ...@@ -626,7 +626,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
(int)is_on()); (int)is_on());
} }
while (is_on()) while (is_on() && !thd_killed(NULL))
{ {
if (reply_file_name_inited_) if (reply_file_name_inited_)
{ {
...@@ -743,7 +743,8 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, ...@@ -743,7 +743,8 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name,
At this point, the binlog file and position of this transaction At this point, the binlog file and position of this transaction
must have been removed from ActiveTranx. must have been removed from ActiveTranx.
*/ */
assert(!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name, assert(thd_killed(NULL) ||
!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name,
trx_wait_binlog_pos)); trx_wait_binlog_pos));
/* Update the status counter. */ /* Update the status counter. */
......
...@@ -3735,6 +3735,9 @@ void THD::restore_backup_open_tables_state(Open_tables_backup *backup) ...@@ -3735,6 +3735,9 @@ void THD::restore_backup_open_tables_state(Open_tables_backup *backup)
extern "C" int thd_killed(const MYSQL_THD thd) extern "C" int thd_killed(const MYSQL_THD thd)
{ {
if (!thd)
thd= current_thd;
if (!(thd->killed & KILL_HARD_BIT)) if (!(thd->killed & KILL_HARD_BIT))
return 0; return 0;
return thd->killed; return thd->killed;
......
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