replication-manager
replication-manager copied to clipboard
Auto purge binlogs
When restoring backups with master binlogs it may be necessary to monitor all slaves and purge the binlog on master before oldest slave master binlogs to free space and purge slaves that have log slave updates for the same reason.
Found oldest slave position Master_Log_File: log-bin.000312
On the master purge oldest -1 👍 PURGE BINARY LOGS TO 'log-bin.000311';
Introduce new variables
force-binlog-purge boolean default false remove binary logs exceeding force-purge-binlog-total_size according to replication position
force_purge_binlog_total_size. size in Gb that binary logs should not exceed default 30
force-purge-binlog-on-restore boolean default false
On MariaDB 11.4 just set purge_binlog_total_size. to mariadb variable max_binlog_total_size
Pushed in latest PR #559
Introduced new variables: Working: force-binlog-purge boolean default false remove binary logs exceeding force-purge-binlog-total_size according to replication position force-binlog-purge-total-size. size in Gb that binary logs should not exceed default 30
Additional mandatory: force-binlog-purge-min-replica default 1. Minimum replicas connected for auto purge binlog in master
Still need to enhance: force-purge-binlog-on-restore boolean default false
enhanced force-binlog-purge-on-restore in #561
Note: to make it easier to group, I make all the prefix of the options in .toml with force-binlog-purge
Checked and merged