Skip to content

K8SPSMDB-1560 improve logrotate.conf#2197

Merged
hors merged 6 commits intomainfrom
K8SPSMDB-1560
Jan 19, 2026
Merged

K8SPSMDB-1560 improve logrotate.conf#2197
hors merged 6 commits intomainfrom
K8SPSMDB-1560

Conversation

@hors
Copy link
Collaborator

@hors hors commented Jan 14, 2026

K8SPSMDB-1560 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Logrotate has a conflict with 'db.adminCommand({ logRotate: 1 })' and as a result mongod.log can be rotated twice

Cause:
Logrotate can't just run the prerotate script, it rotates the log and then 'logRotate: 1' rotates it one more time

Solution:

  1. As a solution for now, we can just run 'logRotate: 1' in the mongod.full.log prerotate script. The issue is that we can't control the size of mongod.log, but at the same time, the size of mongod.full.log and mongod.log are almost the same.
  2. Add default logrotation conf into CR
  3. Run logrotate each day instead of each hour

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size bot added the size/S 10-29 lines label Jan 14, 2026
@github-actions github-actions bot added the build label Jan 14, 2026
@hors hors force-pushed the K8SPSMDB-1560 branch 4 times, most recently from e568084 to 14af4e6 Compare January 16, 2026 14:26
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/S 10-29 lines labels Jan 16, 2026
@pull-request-size pull-request-size bot added size/S 10-29 lines and removed size/M 30-99 lines labels Jan 16, 2026
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/S 10-29 lines labels Jan 16, 2026
@hors hors marked this pull request as ready for review January 18, 2026 20:41
egegunes
egegunes previously approved these changes Jan 19, 2026
mayankshah1607
mayankshah1607 previously approved these changes Jan 19, 2026
@hors hors dismissed stale reviews from mayankshah1607 and egegunes via b749090 January 19, 2026 09:54
@hors hors merged commit 9870233 into main Jan 19, 2026
14 of 15 checks passed
@hors hors deleted the K8SPSMDB-1560 branch January 19, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build size/M 30-99 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants