summaryrefslogtreecommitdiff
path: root/sql/slave.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2018-10-14 20:41:49 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2018-12-07 07:10:40 +0100
commit34f11b06e6aa5e8d4e648c04b5a4049179b66cfd (patch)
tree6731ebc08eb861b1d80eaf45ffbe7734b9afa104 /sql/slave.h
parent24a45d3bd735f0ab09c1b6d313015022e08c8b39 (diff)
downloadmariadb-git-34f11b06e6aa5e8d4e648c04b5a4049179b66cfd.tar.gz
Move deletion of old GTID rows to slave background thread
This patch changes how old rows in mysql.gtid_slave_pos* tables are deleted. Instead of doing it as part of every replicated transaction in record_gtid(), it is done periodically (every @@gtid_cleanup_batch_size transaction) in the slave background thread. This removes the deletion step from the replication process in SQL or worker threads, which could speed up replication with many small transactions. It also decreases contention on the global mutex LOCK_slave_state. And it simplifies the logic, eg. when a replicated transaction fails after having deleted old rows. With this patch, the deletion of old GTID rows happens asynchroneously and slightly non-deterministic. Thus the number of old rows in mysql.gtid_slave_pos can temporarily exceed @@gtid_cleanup_batch_size. But all old rows will be deleted eventually after sufficiently many new GTIDs have been replicated.
Diffstat (limited to 'sql/slave.h')
-rw-r--r--sql/slave.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/slave.h b/sql/slave.h
index 649d55b45b9..12d569b0333 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -276,6 +276,7 @@ bool net_request_file(NET* net, const char* fname);
void slave_background_kill_request(THD *to_kill);
void slave_background_gtid_pos_create_request
(rpl_slave_state::gtid_pos_table *table_entry);
+void slave_background_gtid_pending_delete_request(void);
extern bool volatile abort_loop;
extern Master_info *active_mi; /* active_mi for multi-master */