diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-05-28 13:28:31 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-05-28 13:28:31 +0200 |
commit | ee2b7db3f88f6882022a8aa71b30043ed8b40792 (patch) | |
tree | ce63742ca2896e0bd73a702efeb9eb40ed784f04 /sql/log_event.cc | |
parent | f5319394e3dee146f112b41674ffa188d5e89150 (diff) | |
download | mariadb-git-ee2b7db3f88f6882022a8aa71b30043ed8b40792.tar.gz |
MDEV-4478: Implement GTID "strict mode"
When @@GLOBAL.gtid_strict_mode=1, then certain operations result
in error that would otherwise result in out-of-order binlog files
between servers.
GTID sequence numbers are now allocated independently per domain;
this results in less/no holes in GTID sequences, increasing the
likelyhood that diverging binlogs will be caught by the slave when
GTID strict mode is enabled.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index f4e34dd9224..0a21ae6d279 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6214,6 +6214,15 @@ Gtid_log_event::do_apply_event(Relay_log_info const *rli) thd->variables.gtid_domain_id= this->domain_id; thd->variables.gtid_seq_no= this->seq_no; + if (opt_gtid_strict_mode && opt_bin_log && opt_log_slave_updates) + { + /* Need to reset prior "ok" status to give an error. */ + thd->clear_error(); + thd->stmt_da->reset_diagnostics_area(); + if (mysql_bin_log.check_strict_gtid_sequence(this->domain_id, + this->server_id, this->seq_no)) + return 1; + } if (flags2 & FL_STANDALONE) return 0; |