diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-04-15 10:55:27 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-04-15 10:55:27 +0200 |
commit | 665a31af2b7d0ecd66d5e54ed0544b5db3892732 (patch) | |
tree | d19eae18ae9ffff6e7b3d30b16cf7671c511700f /sql/log.h | |
parent | 491047a24714be57409e42656057e56f99c65513 (diff) | |
parent | e5cbefeb899f6325fc99277c515a91f0843cdcd5 (diff) | |
download | mariadb-git-665a31af2b7d0ecd66d5e54ed0544b5db3892732.tar.gz |
MDEV-26: Global transaction ID. First alpha release.
Merge of 10.0-mdev26 feature tree into 10.0-base.
Global transaction ID is prepended to each event group in the binlog.
Slave connect can request to start from GTID position instead of specifying
file name/offset of master binlog. This facilitates easy switch to a new
master.
Slave GTID state is stored in a table mysql.rpl_slave_state, which can be
InnoDB to get crash-safe slave state.
GTID includes a replication domain ID, allowing to keep track of distinct
positions for each of multiple masters.
Diffstat (limited to 'sql/log.h')
-rw-r--r-- | sql/log.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/log.h b/sql/log.h index da8faa36a00..bd20c8aee09 100644 --- a/sql/log.h +++ b/sql/log.h @@ -396,6 +396,7 @@ private: ( ((ulong)(c)>>1) == BINLOG_COOKIE_DUMMY_ID ) class binlog_cache_mngr; +struct rpl_gtid; class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG { private: @@ -420,11 +421,10 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG bool using_stmt_cache; bool using_trx_cache; /* - Extra events (BEGIN, COMMIT/ROLLBACK/XID, and possibly INCIDENT) to be + Extra events (COMMIT/ROLLBACK/XID, and possibly INCIDENT) to be written during group commit. The incident_event is only valid if trx_data->has_incident() is true. */ - Log_event *begin_event; Log_event *end_event; Log_event *incident_event; /* Set during group commit to record any per-thread error. */ @@ -507,6 +507,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG */ uint *sync_period_ptr; uint sync_counter; + /* Protect against reading the binlog state file twice. */ + bool state_read; inline uint get_sync_period() { @@ -773,6 +775,14 @@ public: inline uint32 get_open_count() { return open_count; } void set_status_variables(THD *thd); bool is_xidlist_idle(); + bool write_gtid_event(THD *thd, bool standalone, bool is_transactional); + int read_state_from_file(); + int write_state_to_file(); + int get_most_recent_gtid_list(rpl_gtid **list, uint32 *size); + bool find_in_binlog_state(uint32 domain_id, uint32 server_id, + rpl_gtid *out_gtid); + bool lookup_domain_in_binlog_state(uint32 domain_id, rpl_gtid *out_gtid); + void bump_seq_no_counter_if_needed(uint64 seq_no); }; class Log_event_handler |