diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2017-03-09 13:27:27 +0100 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2017-04-21 08:00:06 +0200 |
commit | c995ecbe9834bae31912e00cc98f7c872b63e1fb (patch) | |
tree | 9009a8beff3fabb6b3a67ce4de318d4eacd7cfd8 /sql/rpl_gtid.h | |
parent | 087cf0232864b60ce62550598f5903b766fe6c90 (diff) | |
download | mariadb-git-c995ecbe9834bae31912e00cc98f7c872b63e1fb.tar.gz |
MDEV-12179: Per-engine mysql.gtid_slave_pos table
Intermediate commit.
For each GTID recorded in mysq.gtid_slave_pos, keep track of which
engine the update was made in.
This will be later used to know which rows can be deleted in the table
of a given engine.
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r-- | sql/rpl_gtid.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index c8af2c4946a..ea278427061 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -112,6 +112,7 @@ struct rpl_slave_state uint64 sub_id; uint64 seq_no; uint32 server_id; + void *hton; }; /* Elements in the HASH that hold the state for one domain_id. */ @@ -158,7 +159,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; + /* + Use a void * here, rather than handlerton *, to make explicit that we + are not using the value to access any functionality in the engine. It + is just used as an opaque value to identify which engine we are using + for each GTID row. + */ + void *table_hton; LEX_STRING table_name; }; @@ -179,10 +186,10 @@ struct rpl_slave_state void truncate_hash(); ulong count() const { return hash.records; } int update(uint32 domain_id, uint32 server_id, uint64 sub_id, - uint64 seq_no, rpl_group_info *rgi); + uint64 seq_no, void *hton, rpl_group_info *rgi); int truncate_state_table(THD *thd); int record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, - bool in_transaction, bool in_statement); + bool in_transaction, bool in_statement, void **out_hton); uint64 next_sub_id(uint32 domain_id); int iterate(int (*cb)(rpl_gtid *, void *), void *data, rpl_gtid *extra_gtids, uint32 num_extra, @@ -196,12 +203,13 @@ struct rpl_slave_state element *get_element(uint32 domain_id); int put_back_list(uint32 domain_id, list_element *list); - void update_state_hash(uint64 sub_id, rpl_gtid *gtid, rpl_group_info *rgi); + void update_state_hash(uint64 sub_id, rpl_gtid *gtid, void *hton, + rpl_group_info *rgi); 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); + struct gtid_pos_table *alloc_gtid_pos_table(LEX_STRING *table_name, void *hton); void free_gtid_pos_tables(struct gtid_pos_table *list); }; |