summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2018-10-07 18:59:52 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2018-10-07 18:59:52 +0200
commit2f4a0c5be2c5d5153c4253a49ba8820ab333a9a0 (patch)
tree5aacf74f8fc10978fed9f039b3f1170583ed5dcf /sql/rpl_gtid.h
parent1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b (diff)
downloadmariadb-git-2f4a0c5be2c5d5153c4253a49ba8820ab333a9a0.tar.gz
Fix accumulation of old rows in mysql.gtid_slave_pos
This would happen especially in optimistic parallel replication, where there is a good chance that a transaction will be rolled back (due to conflicts) after it has executed record_gtid(). If the transaction did any deletions of old rows as part of record_gtid(), those deletions will be undone as well. And the code did not properly ensure that the deletions would be re-tried. This patch makes record_gtid() remember the list of deletions done as part of a transaction. Then in rpl_slave_state::update() when the changes have been committed, we discard the list. However, in case of error and rollback, in cleanup_context() we will instead put the list back into rpl_global_gtid_slave_state so that the deletions will be re-tried later. Probably fixes part of the cause of MDEV-12147 as well. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r--sql/rpl_gtid.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h
index 79d566bddbf..7bd639b768f 100644
--- a/sql/rpl_gtid.h
+++ b/sql/rpl_gtid.h
@@ -182,7 +182,7 @@ struct rpl_slave_state
uint64 seq_no, 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);
+ rpl_group_info *rgi, bool in_statement);
uint64 next_sub_id(uint32 domain_id);
int iterate(int (*cb)(rpl_gtid *, void *), void *data,
rpl_gtid *extra_gtids, uint32 num_extra,