On a MySQL Community 5.6 server, slow log rotation is being performed incorrectly.
The agent is using the default setting (server-side config for rotation) and is rotating the slow query log without instructing MySQL server to cleanly handle this.
Steps to reproduce:
- Configure pmm-agent to monitor MySQL using slowlog
- Monitor the slow log file along with the .old path, e.g.
- Run sysbench to rapidly generate content for the slow log, e.g.
The log will be rotated whilst still being written to.
Bug Reproduced on 2.9.1/dev-latest, Steps to recreate are enough and detailed, reproduced the scenario with Mysql 8.x latest version, we need to update the documentation to mention the needed permission for slow log rotation.
How to test/QA?
add mysql instance for monitoring with slowlog enabled. In case of a mysql user that doesn't have reload privileges pmm agent will have the following error message in the log saying "RELOAD grant not enabled cannot rotate slowlog", if the mysql user is granted the RELOAD privilege this log message should disappear and slowlog rotation will continue