Bug 2216795 - [OSP 16] default logrotate-crond templates could lead to premature logs purge [NEEDINFO]
Summary: [OSP 16] default logrotate-crond templates could lead to premature logs purge
Keywords:
Status: NEW
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: OSP Team
QA Contact: Joe H. Rahme
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-22 15:27 UTC by Flavio Piccioni
Modified: 2023-07-03 06:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
tkajinam: needinfo? (shtiwari)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-25996 0 None None None 2023-06-22 16:24:57 UTC

Description Flavio Piccioni 2023-06-22 15:27:57 UTC
Description of problem:

default logrotate-crond-container-puppet.yaml template...:

parameter_defaults
  LogrotateRotate: '14'
  LogrotatePurgeAfterDays: '14'
  LogrotateMaxsize: '10M'

...is going to configure logrotate using:

  daily
  rotate 14
  maxage 14
  minsize 1
  maxsize 10M
  missingok
  notifempty
  copytruncate
  delaycompress
  compress


According to our docs:
The following example (about default templates) forces the logrotate task to create a new log file when it reaches 10 megabytes and retains the log file for 14 days.

So basically customers are expecting 14 days of log retention to be honored.
This is not going to happen in case of heavy-logging services (control plane nova's units, for example), with rotate that is being caused by the maxsize.

So basically we'll have just 14 rotated logs covering 14 hours that will be purged within 1 day.

Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates

How reproducible:
just let logrotate-crond with default settings to handle heavy-logging services logs


Actual results:
heavy-logging services logs to be rotate 14 times within 14 hours, then purged.

Expected results:
14 days retention (LogrotatePurgeAfterDays) to be honored regardless maxsize or slightly update docs in order to give customers explanation about how default template's parameters are going to interact (interfere?) each other in case of heavy-logging services
 
Additional info:
Not sure if, for example, adopting something like LogrotateRotate: (LogrotatePurgeAfterDays*24) could be a good strategy.

Using rotate 336 (maxage*24h, where maxage is the LogrotatePurgeAfterDays logrotate config value) will ensure customers to have the 14 days worth of logs.


Note You need to log in before you can comment on or make changes to this bug.