Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto purge binlogs #527

Closed
svaroqui opened this issue Dec 27, 2023 · 4 comments · Fixed by #586, #585, #580, #561 or #559
Closed

Auto purge binlogs #527

svaroqui opened this issue Dec 27, 2023 · 4 comments · Fixed by #586, #585, #580, #561 or #559
Milestone

Comments

@svaroqui
Copy link
Collaborator

svaroqui commented Dec 27, 2023

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

@ahfa92
Copy link
Contributor

ahfa92 commented Apr 21, 2024

Pushed in latest PR #559

@ahfa92
Copy link
Contributor

ahfa92 commented Apr 21, 2024

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
Copy link
Contributor

ahfa92 commented Apr 22, 2024

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

@caffeinated92
Copy link
Collaborator

Checked and merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment