Hi folks, tl;dr: With slave_connections_needed_for_purge=1 (the default), binlogs are not auto-purged if no slave is connected. I’m wondering why this is the default behavior.
I just debugged a puzzling issue on my single-instance MariaDB server. I enable binlogs on all my servers to help with query debugging. Also, in case of data issues, I can restore from a backup and then replay all relevant queries between the backup timestamp (usually nightly) and the point just before the issue occurred. To handle log purging automatically, I configured expire_logs_days / binlog_expire_logs_seconds (the docs [1] state they’re equivalent). However, this didn’t work, and I only noticed when monitoring alerted me about low disk space. After investigating, I found that automatic binlog purging only occurs if a slave is connected (slave_connections_needed_for_purge=1, the default). I understand why setting this to 1 can be useful in replication setups [2], but I’m surprised it’s the default. I would assume most MariaDB deployments are not replication setups, so auto-purging being disabled by default seems counterintuitive. Has anyone else run into this, and is there a rationale for keeping this as the default? [1] https://mariadb.com/docs/server/ha-and-performance/standard-replication/replication-and-binary-log-system-variables#binlog_expire_logs_seconds [2] https://jira.mariadb.org/browse/MDEV-31404 Cheers, Marco _______________________________________________ discuss mailing list -- discuss@lists.mariadb.org To unsubscribe send an email to discuss-le...@lists.mariadb.org