Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6.15
    • N/A
    • Admin statements
    • None
    • Ubuntu 20.04

    Description

      I've had to enable the slow log on a production server with lots of traffic to identify some issues however it was growing really fast in size.

      I decided to add logrotate to compress and rotate the slow log when it exceeded 1G but to my surprise even though it was rotated and the size appeared smaller, the disk space wasn't actually freed until maria db was restarted

      It appears that maria db is holding a lock to the file indefinitely for writing without ever releasing the lock thus the operating system can never release the space that was freed from log rotation

      There should either be a way to rotate it via settings or allow the operating system to free the space

      Attachments

        Activity

          it's not enough to simply move the file somewhere, you need to tell the server to reopen logs after you moved them. That's why our debian packages install a proper logrotate file into / etc/logrotate.d. You can use it as an example.

          Or see https://github.com/MariaDB/server/blob/10.6/debian/mariadb-server-10.6.mysql-server.logrotate

          serg Sergei Golubchik added a comment - it's not enough to simply move the file somewhere, you need to tell the server to reopen logs after you moved them. That's why our debian packages install a proper logrotate file into / etc/logrotate.d . You can use it as an example. Or see https://github.com/MariaDB/server/blob/10.6/debian/mariadb-server-10.6.mysql-server.logrotate

          I'll give it a try and let you know

          ioweb.gr Gabriel Tziotzis added a comment - I'll give it a try and let you know
          danblack Daniel Black added a comment -

          There's an updated version on https://github.com/MariaDB/server/blob/11.3/support-files/mariadb.logrotate.sh with slightly better sizing, but depends how noisy the file is.

          danblack Daniel Black added a comment - There's an updated version on https://github.com/MariaDB/server/blob/11.3/support-files/mariadb.logrotate.sh with slightly better sizing, but depends how noisy the file is.

          People

            serg Sergei Golubchik
            ioweb.gr Gabriel Tziotzis
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.