canonical / mysql-operator

Machine charm for MySQL following the operator framework
https://charmhub.io/mysql
Apache License 2.0
7 stars 10 forks source link

logrotate config doesn't match layout on disk #523

Open barryprice opened 4 days ago

barryprice commented 4 days ago

Steps to reproduce

  1. Deploy (on jammy/amd64 here), and wait for enough workload to generate a lot of logs

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:

$ 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

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:

charmed-mysql        8.0.36         103    latest/stable  dataplatformbot  held
syncronize-issues-to-jira[bot] commented 4 days ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5535.

This message was autogenerated