From 2de9427ccfb1256e6c63810b845ebfedc101890f Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 13 Jan 2015 14:18:23 +0100 Subject: [PATCH] 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.) --- sql/log.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index e226b593566..8a247a50ee1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -6041,14 +6041,6 @@ err: } 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 @@ err: } 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;