summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2017-03-09 12:16:15 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2017-04-21 08:00:06 +0200
commit087cf0232864b60ce62550598f5903b766fe6c90 (patch)
treed5cad7b02959aa67edcbc3ba0a3d890a1a19edb5 /sql/rpl_gtid.h
parent141a1b09e661a574ff30953f6fb34bd2fbb96607 (diff)
downloadmariadb-git-087cf0232864b60ce62550598f5903b766fe6c90.tar.gz
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.
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r--sql/rpl_gtid.h11
1 files changed, 11 insertions, 0 deletions
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);
};