summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2016-12-01 09:59:58 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2017-04-10 07:53:27 +0200
commit88613e1df69ab416d43f21551acec340648d0017 (patch)
tree706bad400ab32eee66cf6d36a52963bd8f012778 /sql/slave.cc
parent7dd6efeaab688d703e3569c4f54f30502e88dd2f (diff)
downloadmariadb-git-88613e1df69ab416d43f21551acec340648d0017.tar.gz
MDEV-11201: gtid_ignore_duplicates incorrectly ignores statements when GTID replication is not enabled
When master_use_gtid=no, the IO thread loads the slave GTID state from the master during connect. This races with the SQL thread when gtid_ignore_duplicates=1. If an event is in the relay log from before the new connect and has not been applied yet, moving the slave position causes the SQL thread to think that event should be skipped due to gtid_ignore_duplicates=1. This patch simply disables gtid_ignore_duplicates when not using GTID, which seems to be what one would expect.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 70b1c5b025e..8801e9e9ab5 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3612,7 +3612,8 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
DBUG_RETURN(1);
}
- if (opt_gtid_ignore_duplicates)
+ if (opt_gtid_ignore_duplicates &&
+ rli->mi->using_gtid != Master_info::USE_GTID_NO)
{
int res= rpl_global_gtid_slave_state->check_duplicate_gtid
(&serial_rgi->current_gtid, serial_rgi);