diff options
author | unknown <knielsen@knielsen-hq.org> | 2014-03-09 10:27:38 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2014-03-09 10:27:38 +0100 |
commit | 2c2478b82260f5110ea2c5bed3c6c7bcd3558453 (patch) | |
tree | 24a7a88645c37c46f734869cb8b593ea6ea4dfec /sql/rpl_rli.cc | |
parent | 5c31e79f8bba85e555dac2e2f6e97cc1b0a2b51b (diff) | |
download | mariadb-git-2c2478b82260f5110ea2c5bed3c6c7bcd3558453.tar.gz |
MDEV-5804: If same GTID is received on multiple master connections in multi-source replication, the event is double-executed causing corruption or replication failure
Before, the arrival of same GTID twice in multi-source replication
would cause double-apply or in gtid strict mode an error.
Keep the behaviour, but add an option --gtid-ignore-duplicates which
allows to correctly handle duplicates, ignoring all but the first.
This relies on the user ensuring correct configuration so that
sequence numbers are strictly increasing within each replication
domain; then duplicates can be detected simply by comparing the
sequence numbers against what is already applied.
Only one master connection (but possibly multiple parallel worker
threads within that connection) is allowed to apply events within
one replication domain at a time; any other connection that
receives a GTID in the same domain either discards it (if it is
already applied) or waits for the other connection to not have
any events to apply.
Intermediate patch, as proof-of-concept for testing. The main limitation
is that currently it is only implemented for parallel replication,
@@slave_parallel_threads > 0.
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r-- | sql/rpl_rli.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 0fae3a3bb89..020f984ad50 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1435,7 +1435,8 @@ rpl_load_gtid_slave_state(THD *thd) if ((err= rpl_global_gtid_slave_state.update(tmp_entry.gtid.domain_id, tmp_entry.gtid.server_id, tmp_entry.sub_id, - tmp_entry.gtid.seq_no))) + tmp_entry.gtid.seq_no, + NULL))) { mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state); my_error(ER_OUT_OF_RESOURCES, MYF(0)); |