summaryrefslogtreecommitdiff
path: root/sql
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
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')
-rw-r--r--sql/rpl_parallel.cc3
-rw-r--r--sql/slave.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index e5964e9c038..43e52c00e8d 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -1109,7 +1109,8 @@ handle_rpl_parallel_thread(void *arg)
thd->wait_for_commit_ptr= &rgi->commit_orderer;
- if (opt_gtid_ignore_duplicates)
+ if (opt_gtid_ignore_duplicates &&
+ rgi->rli->mi->using_gtid != Master_info::USE_GTID_NO)
{
int res=
rpl_global_gtid_slave_state->check_duplicate_gtid(&rgi->current_gtid,
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);