Commit e9fc98b5 authored by Kristian Nielsen's avatar Kristian Nielsen

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.
parent f9760507
...@@ -1760,6 +1760,7 @@ rpl_parallel_entry::queue_master_restart(rpl_group_info *rgi, ...@@ -1760,6 +1760,7 @@ rpl_parallel_entry::queue_master_restart(rpl_group_info *rgi,
qev->ir= rli->last_inuse_relaylog; qev->ir= rli->last_inuse_relaylog;
++qev->ir->queued_count; ++qev->ir->queued_count;
thr->enqueue(qev); thr->enqueue(qev);
mysql_cond_signal(&thr->COND_rpl_thread);
mysql_mutex_unlock(&thr->LOCK_rpl_thread); mysql_mutex_unlock(&thr->LOCK_rpl_thread);
return 0; return 0;
} }
......
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