From 087cf0232864b60ce62550598f5903b766fe6c90 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 9 Mar 2017 12:16:15 +0100 Subject: MDEV-12179: Per-engine mysql.gtid_slave_pos table Intermediate commit. Keep track of which mysql.gtid_slave_posXXX tables are available for each engine, by searching for all tables in the mysql schema with names that start with "gtid_slave_pos". The list is computed at server start when the GTID position is loaded, and it is re-computed on every START SLAVE command. This way, the DBA can manually add a table for a new engine, and it will be automatically picked up on next START SLAVE, so a full server restart is not needed. The list is not yet actually used in the code. --- sql/rpl_gtid.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sql/rpl_gtid.h') diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index f638a084e38..c8af2c4946a 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -155,6 +155,13 @@ struct rpl_slave_state } }; + /* Descriptor for mysql.gtid_slave_posXXX table in specific engine. */ + struct gtid_pos_table { + struct gtid_pos_table *next; + handlerton *table_hton; + LEX_STRING table_name; + }; + /* Mapping from domain_id to its element. */ HASH hash; /* Mutex protecting access to the state. */ @@ -163,6 +170,7 @@ struct rpl_slave_state DYNAMIC_ARRAY gtid_sort_array; uint64 last_sub_id; + struct gtid_pos_table *gtid_pos_tables; bool loaded; rpl_slave_state(); @@ -192,6 +200,9 @@ struct rpl_slave_state int record_and_update_gtid(THD *thd, struct rpl_group_info *rgi); int check_duplicate_gtid(rpl_gtid *gtid, rpl_group_info *rgi); void release_domain_owner(rpl_group_info *rgi); + void set_gtid_pos_tables_list(struct gtid_pos_table *new_list); + struct gtid_pos_table *alloc_gtid_pos_table(LEX_STRING *table_name, handlerton *hton); + void free_gtid_pos_tables(struct gtid_pos_table *list); }; -- cgit v1.2.1