Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-3063] Change dateformat in logrotate config to avoid causing filename conflicts after 24hrs of uptime #363

Merged
merged 2 commits into from Dec 1, 2023

Conversation

shayancanonical
Copy link
Contributor

@shayancanonical shayancanonical commented Nov 30, 2023

Issue

We are using -%V_%H%M as the dateformat for logrotate - this causes filename conflicts after a day of uptime due to file name conflicts.

Solution

Use -%Y%m%d_%H:%M as the dateformat (for consistency with pgbouncer)

Alternatives

-%u in the dateformat does not get correctly substituted as per the docs:

error: destination /var/log/mysql/archive_general/general.log-%u_1637 already exists, skipping rotation

root@mysql-k8s-0:/# ls -la /var/log/mysql/archive_error/
total 8
drwxrwx--- 2 mysql mysql 4096 Nov 30 16:37 .
drwxr-xr-x 1 mysql mysql 4096 Nov 30 16:37 ..
-rw-r----- 1 mysql mysql    0 Nov 30 16:36 error.log-%u_1637

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ca65034) 65.91% compared to head (279f84b) 65.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #363   +/-   ##
=======================================
  Coverage   65.91%   65.91%           
=======================================
  Files          17       17           
  Lines        3119     3119           
  Branches      410      410           
=======================================
  Hits         2056     2056           
  Misses        935      935           
  Partials      128      128           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shayancanonical shayancanonical merged commit f757f4e into main Dec 1, 2023
39 checks passed
@shayancanonical shayancanonical deleted the fix/log_rotation_dateformat branch December 1, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants