Not the answer you need?
Register and ask your own question!

percona proxysql 1.4.3 packages logrotate leaves deleted files attached to process

archedarched EntrantCurrent User Role Beginner
While troubleshooting a disk space issue on a proxysql node I noticed the following:
sudo lsof +L1 | grep -E "COMMAND|proxysql"
COMMAND   PID     USER   FD   TYPE DEVICE   SIZE/OFF NLINK   NODE NAME
proxysql 5403 proxysql    2w   REG  253,3 1212984784     0   2424 /var/lib/proxysql/proxysql.log-20171101 (deleted)

Which means that deleted files are kept open by the process and the diskspace is still claimed.

/etc/logrotate.d/proxysql-logrotate looks like this:
/var/lib/proxysql/*.log {
        missingok
        daily
        notifempty
        compress
        create 0600 proxysql proxysql
        rotate 5
}

It should probably include something like the following:
/var/lib/proxysql/*.log {
        missingok
        daily
        notifempty
        compress
        create 0600 proxysql proxysql
        rotate 5
        sharedscripts
        postrotate
             /etc/init.d/proxysql reload >/dev/null 2>&1 || true
        endscript
}

I will test this monday.

Comments

  • archedarched Entrant Current User Role Beginner
     /var/lib/proxysql/*.log {
            missingok
            daily
            notifempty
            compress
            create 0600 proxysql proxysql
            rotate 5
            copytruncate
    }
    

    Copytruncate seems to fix/workaround the issue. A reload of proxysql does not respawn the process with a new PID, A restart is rather brutal and several queries would probably fail during the stop / start of proxysql and kill -HUP does nothing.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.