diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2018-10-14 20:41:49 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2018-12-07 07:10:40 +0100 |
commit | 34f11b06e6aa5e8d4e648c04b5a4049179b66cfd (patch) | |
tree | 6731ebc08eb861b1d80eaf45ffbe7734b9afa104 /sql/mysqld.h | |
parent | 24a45d3bd735f0ab09c1b6d313015022e08c8b39 (diff) | |
download | mariadb-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/mysqld.h')
-rw-r--r-- | sql/mysqld.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/mysqld.h b/sql/mysqld.h index 75f35a6df24..9c02b9127a2 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -262,6 +262,7 @@ extern ulong opt_slave_parallel_mode; extern ulong opt_binlog_commit_wait_count; extern ulong opt_binlog_commit_wait_usec; extern my_bool opt_gtid_ignore_duplicates; +extern uint opt_gtid_cleanup_batch_size; extern ulong back_log; extern ulong executed_events; extern char language[FN_REFLEN]; |