summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2014-06-25 15:24:11 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2014-06-25 15:24:11 +0200
commit9150a0c7cbefefe6ffbd9ba19a37f159d86a8d2f (patch)
tree3cff14f4f2ebf036c894f57b3cdd0412556eebda /sql/sql_repl.cc
parenta985ac3affe65884a579ae4da371d6b32860d872 (diff)
downloadmariadb-git-9150a0c7cbefefe6ffbd9ba19a37f159d86a8d2f.tar.gz
MDEV-4937: sql_slave_skip_counter does not work with GTID
The sql_slave_skip_counter is important to be able to recover replication from certain errors. Often, an appropriate solution is to set sql_slave_skip_counter to skip over a problem event. But setting sql_slave_skip_counter produced an error in GTID mode, with a suggestion to instead set @@gtid_slave_pos to point past the problem event. This however is not always possible; for example, in case of an INCIDENT event, that event does not have any GTID to assign to @@gtid_slave_pos. With this patch, sql_slave_skip_counter now works in GTID mode the same was as in non-GTID mode. When set, that many initial events are skipped when the SQL thread starts, plus as many extra events are needed to completely skip any partially skipped event group. The GTID position is updated to point past the skipped event(s).
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index c7bd28259ae..e2ba5197dc4 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -3075,6 +3075,7 @@ int reset_slave(THD *thd, Master_info* mi)
mi->clear_error();
mi->rli.clear_error();
mi->rli.clear_until_condition();
+ mi->rli.slave_skip_counter= 0;
// close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0
end_master_info(mi);
@@ -3522,6 +3523,7 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
/* Clear the errors, for a clean start */
mi->rli.clear_error();
mi->rli.clear_until_condition();
+ mi->rli.slave_skip_counter= 0;
sql_print_information("'CHANGE MASTER TO executed'. "
"Previous state master_host='%s', master_port='%u', master_log_file='%s', "