Open barryprice opened 4 days ago
logrotate should rotate mysql's log files to avoid filling the disk
logrotate looks for files that don't exist, and doesn't rotate the actual log files - which eventually will fill the disk.
logrotate config:
$ grep ^/var /etc/logrotate.d/flush_mysql_logs /var/snap/charmed-mysql/common/var/log/mysql/error.log { /var/snap/charmed-mysql/common/var/log/mysql/general.log { /var/snap/charmed-mysql/common/var/log/mysql/slowquery.log {
Actual contents of the log directory:
$ ls -l /var/snap/charmed-mysql/common/var/log/mysql/ total 268 drwxrwx--- 2 snap_daemon snap_daemon 122880 Sep 12 07:34 archive_error drwxrwx--- 2 snap_daemon snap_daemon 139264 Sep 12 07:33 archive_general drwxrwx--- 2 snap_daemon snap_daemon 4096 Sep 10 13:29 archive_slowquery
We found this file under the archive_general dir recently:
-rw-r----- 1 snap_daemon root 44G Sep 15 23:28 /var/snap/charmed-mysql/common/var/log/mysql/archive_general/general.log-20240912_0733
Operating system: Ubuntu 22.04.4 LTS
Juju CLI: 2.9.51-ubuntu-amd64
Juju agent: 2.9.49
Charm revision: 8.0/stable / 240
LXD: none
Juju debug log: not relevant
The installed mysql snap is:
charmed-mysql 8.0.36 103 latest/stable dataplatformbot held
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5535.
This message was autogenerated
Steps to reproduce
Expected behavior
logrotate should rotate mysql's log files to avoid filling the disk
Actual behavior
logrotate looks for files that don't exist, and doesn't rotate the actual log files - which eventually will fill the disk.
logrotate config:
Actual contents of the log directory:
We found this file under the archive_general dir recently:
Versions
Operating system: Ubuntu 22.04.4 LTS
Juju CLI: 2.9.51-ubuntu-amd64
Juju agent: 2.9.49
Charm revision: 8.0/stable / 240
LXD: none
Log output
Juju debug log: not relevant
Additional context
The installed mysql snap is: