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

expire binlog #2350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

expire binlog #2350

wants to merge 1 commit into from

Conversation

HPPinata
Copy link

@HPPinata HPPinata commented Dec 15, 2024

Enabeling binlog without any cleanup/purge policy is a horrible idea, since it causes binlog.XXXXXX files to accumulate indefinitely, unless the administrator manually runs a purge by connecting to the database.
I only noticed this due to the fact almost 50GB of binlog files had accumulated on my server over a period of around 7 months, even on my relatively small instance.

I'm unsure why the binlog is enabled in the first place, since none of these setups are using replication, but the ability to do a point in time recovery might be the original intent.

Whatever the reasoning for enabeling binlog, this change should both stop new deployments from running into the issue and resolve the problem on any existing setups once the compose.yaml is updated.
The only exceptions are database servers under souch heavy load that the binlog grows quickly enough to reach a problematic size in the 7 days until it is cleaned up. The administrators of those instances (if they aren't already supported by Nextcloud Enterprise) would have noticed this issue and should be equipped to independently evaluate the usage of binlog on their database system.

In any case (and even for systems under high load) automatically purging binlog entries older than a week should have a significant positive impact on the deployments storage usage without negatively affecting either replication (if configured) or point in time recovery.

--slave_connections_needed_for_purge=0 is required to make the binlog cleanup on databases without replication possible, which should apply to essentially all deployments based on these compose.yaml files.

Including a check for a binlog without any cleanup active in the Web Ui's "security & setup warnings" would probably also be a good idea, but that's beyond my ability and should probably be a separate Issue/PR on https://github.com/nextcloud/server.

References:
https://mariadb.com/kb/en/using-and-maintaining-the-binary-log/
https://mariadb.com/kb/en/replication-and-binary-log-system-variables/#expire_logs_days

@HPPinata HPPinata force-pushed the binlog-fix branch 2 times, most recently from 46db50a to 8f2cd07 Compare December 15, 2024 10:56
expire binlog entries older than a week to avoid unbounded binlog growth over longer timespans

Signed-off-by: HPPinata <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant