No config options for logrotate

Bug #1812950 reported by Barry Price
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Fix Committed
High
Chi Wai CHAN

Bug Description

It'd be nice if the charm had a config option that would drop a config snipped into /etc/logrotate.d/ to compress/rotate the contents of /var/log/mysql (I just came across an 8GB error.log).

Revision history for this message
Frode Nordahl (fnordahl) wrote :

This is indeed a charm bug as we specifically configure the use of ``/var/log/mysql/error.log`` in our templates.

Paraphrasing the logrotate configuration included in the packages: "The error log is obsolete, messages go to syslog now."

I guess we should either update our template to not create the /var/log/mysql/error.log or add a logrotate config for it.

Changed in charm-percona-cluster:
status: New → Confirmed
importance: Undecided → High
Barry Price (barryprice)
tags: added: canonical-is
Revision history for this message
Xav Paice (xavpaice) wrote :

Workaround is to use https://jaas.ai/logrotated

Revision history for this message
Facundo Ciccioli (fandanbango) wrote (last edit ):

I'm not sure how the cited charm solves this issue. As far as I can tell, the logrotated charm doesn't allow for addition of new files to be rotated, and this is what would be needed for the case of mysql.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

> I'm sure how the cited charm solves this issue. As far as I can tell, the logrotated charm doesn't allow for addition of new files to be rotated, and this is what would be needed for the case of mysql.

I think the override config option of the logrotated charm supports this: https://jaas.ai/logrotated#charm-config-override

Revision history for this message
Facundo Ciccioli (fandanbango) wrote :

If I understand the code and that config option documentation properly, then no. That option allows you to change the logrotate settings for specific files *already* in /etc/logrotate.d.

I don't see any code to add new files, which is what's needed for working around the mysql issue (the error.log file is not handled by any pre-existing logrotate config file).

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

> If I understand the code and that config option documentation properly, then no. That option allows you to change the logrotate settings for specific files *already* in /etc/logrotate.d.

On a deeper reading of the code, yes, it does sadly look like the logrotated charm can't handle adding new /etc/logrotate.d/ control files. Shame.

Thus, the bug stands for now; a possible workaround is to manually place a control file in /etc/logrotate.d for the error log, but it should be fixed in the percona-cluster charm.

Changed in charm-percona-cluster:
status: Confirmed → Triaged
tags: added: good-first-bug
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-percona-cluster (master)

Change abandoned by "Billy Olsen <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-percona-cluster/+/634722
Reason: Change has not been updated to address feedback in > 180 days

Revision history for this message
Samuel Walladge (swalladge) wrote :

^ the proposed change that was abandoned ( https://review.opendev.org/c/openstack/charm-percona-cluster/+/634722 ), attempted to solve this bug by switching logging to syslog. Is this the consensus for how this bug should be solved, or is it still preferable to configure logrotate as per the original description?

Chi Wai CHAN (raychan96)
Changed in charm-percona-cluster:
assignee: nobody → Chi Wai CHAN (raychan96)
Revision history for this message
Billy Olsen (billy-olsen) wrote :

Fwiw I think that just logging to syslog is fine

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-percona-cluster (master)
Changed in charm-percona-cluster:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-percona-cluster (master)

Reviewed: https://review.opendev.org/c/openstack/charm-percona-cluster/+/847713
Committed: https://opendev.org/openstack/charm-percona-cluster/commit/66f004c2baa6fe17f933886315769711da869e92
Submitter: "Zuul (22348)"
Branch: master

commit 66f004c2baa6fe17f933886315769711da869e92
Author: Chi Wai, Chan <email address hidden>
Date: Mon Jun 27 10:35:23 2022 +0800

    Add an option to allow MySQL service to log to syslog.

    This patch provides one of the alternative solution to address the
    problem that the error log might grow too large.

    Closes-bug: #1812950
    Change-Id: If7c0c71492eb30f24cbcc03ca05a67e6ea571f4e

Changed in charm-percona-cluster:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.