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/mysqld.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/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 36d0edee660..d292cc86cfb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -553,6 +553,7 @@ ulong opt_slave_domain_parallel_threads= 0; ulong opt_binlog_commit_wait_count= 0; ulong opt_binlog_commit_wait_usec= 0; ulong opt_slave_parallel_max_queued= 131072; +my_bool opt_gtid_ignore_duplicates= FALSE; const double log_10[] = { 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, @@ -987,7 +988,7 @@ PSI_cond_key key_COND_rpl_thread_queue, key_COND_rpl_thread, key_COND_rpl_thread_pool, key_COND_parallel_entry, key_COND_group_commit_orderer, key_COND_prepare_ordered; -PSI_cond_key key_COND_wait_gtid; +PSI_cond_key key_COND_wait_gtid, key_COND_gtid_ignore_duplicates; static PSI_cond_info all_server_conds[]= { @@ -1035,7 +1036,8 @@ static PSI_cond_info all_server_conds[]= { &key_COND_parallel_entry, "COND_parallel_entry", 0}, { &key_COND_group_commit_orderer, "COND_group_commit_orderer", 0}, { &key_COND_prepare_ordered, "COND_prepare_ordered", 0}, - { &key_COND_wait_gtid, "COND_wait_gtid", 0} + { &key_COND_wait_gtid, "COND_wait_gtid", 0}, + { &key_COND_gtid_ignore_duplicates, "COND_gtid_ignore_duplicates", 0} }; PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, |