diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-11-18 15:22:50 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-11-18 15:22:50 +0100 |
commit | 170e9e593df52643653269a61efbdc35076a1190 (patch) | |
tree | 99141eb14dddfff07a661b3b3f613efd9f445930 /sql/rpl_gtid.h | |
parent | def3c98af47a95981437de3ccee8bc1a736cd4a7 (diff) | |
download | mariadb-git-170e9e593df52643653269a61efbdc35076a1190.tar.gz |
MDEV-5306: Missing locking around rpl_global_gtid_binlog_state
There were some places where insufficient locking between
parallel threads could cause invalid memory accesses and
possibly other grief.
This patch adds the missing locking, and moves the locking
into the struct rpl_binlog_state methods to make it easier
to see that proper locking is in place everywhere.
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r-- | sql/rpl_gtid.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index a503184cee6..b0bc54900e7 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -146,13 +146,15 @@ struct rpl_binlog_state rpl_binlog_state(); ~rpl_binlog_state(); + void reset_nolock(); void reset(); void free(); bool load(struct rpl_gtid *list, uint32 count); + int update_nolock(const struct rpl_gtid *gtid, bool strict); int update(const struct rpl_gtid *gtid, bool strict); int update_with_next_gtid(uint32 domain_id, uint32 server_id, rpl_gtid *gtid); - int alloc_element(const rpl_gtid *gtid); + int alloc_element_nolock(const rpl_gtid *gtid); bool check_strict_sequence(uint32 domain_id, uint32 server_id, uint64 seq_no); int bump_seq_no_if_needed(uint32 domain_id, uint64 seq_no); int write_to_iocache(IO_CACHE *dest); @@ -162,6 +164,7 @@ struct rpl_binlog_state int get_most_recent_gtid_list(rpl_gtid **list, uint32 *size); bool append_pos(String *str); bool append_state(String *str); + rpl_gtid *find_nolock(uint32 domain_id, uint32 server_id); rpl_gtid *find(uint32 domain_id, uint32 server_id); rpl_gtid *find_most_recent(uint32 domain_id); }; |