Commit 2de9427c authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-7391: rpl.rpl_semi_sync, rpl.rpl_semi_sync_after_sync_row fail in buildbot

The problem was caused by a merge error (incorrect conflict resolution) when
the MDEV-7257 patch was merged into 10.1.

The incorrect merge put two code blocks in the wrong order. This caused a race
that was seen as sporadic test failures.

(The problem was that binlog end position was updated before running
after_flush hook; this way it was possible for the binlog dump thread to send
a transaction to a slave without requesting semi-sync acknowledgement. Then
when no acknowledgement was received, semisync replication would be disabled
on the master.)
parent e695db0f
......@@ -6041,14 +6041,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
}
else
{
/* update binlog_end_pos so it can be read by dump thread
*
* note: must be _after_ the RUN_HOOK(after_flush) or else
* semi-sync-plugin might not have put the transaction into
* it's list before dump-thread tries to send it
*/
update_binlog_end_pos(offset);
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log);
......@@ -6065,6 +6057,14 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
}
else
{
/* update binlog_end_pos so it can be read by dump thread
*
* note: must be _after_ the RUN_HOOK(after_flush) or else
* semi-sync-plugin might not have put the transaction into
* it's list before dump-thread tries to send it
*/
update_binlog_end_pos(offset);
signal_update();
if ((error= rotate(false, &check_purge)))
check_purge= false;
......
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