replication-manager icon indicating copy to clipboard operation
replication-manager copied to clipboard

Auto purge binlogs

Open svaroqui opened this issue 1 year ago • 4 comments

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

svaroqui avatar Dec 27 '23 07:12 svaroqui

Pushed in latest PR #559

ahfa92 avatar Apr 21 '24 14:04 ahfa92

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

ahfa92 avatar Apr 21 '24 14:04 ahfa92

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

ahfa92 avatar Apr 22 '24 11:04 ahfa92

Checked and merged

caffeinated92 avatar Apr 22 '24 14:04 caffeinated92