Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-655

Maxscale log rotation stymies logrotate

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.2.1
    • 2.1.0
    • Core
    • None

    Description

      Rotating maxscale logs via SIGUSR1, or flush logs, picks a new "maxscaleN.log" filename to begin writing to. This scheme violates assumptions that logrotate uses to count the number of logs retained, when using maxscale's documented logrotate configuration example.

      Logrotate assumes that the filename will not change upon rotation - that the writing process will either reopen its logging filehandle at the original name, or will be restarted, effectively accomplishing the same thing.

      Maxscale is using some internal logfile generation number, creating a new filename. When logrotate encounters this new name (with no apparent previous rotations), it determines that this is a new file with no rotations. This leads to old rotations never being removed.

      Best practice would be to change the USR1 handling to simply reopen the logging file handle. This allows the external actor (logrotate) to move the file to a new name, and signal the maxscale service to reopen the original file location when appropriate.

      Attachments

        Activity

          People

            johan.wikman Johan Wikman
            babbottscott@zendesk.com Benjamin Abbott-Scott
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.