Last week I was working with a client that rediscovered a bug where setting expire_logs_days and issuing a flush logs causes the server to crash. It’s MySQL Bug #17733 if you want to have a look. Seeing MySQL crash was enough inspiration to fix something that I and others have wanted to fix in MySQL for years.
Currently a flush logs command tries to flush all of the following logs in order:
- General Log
- Slow Query Log
- Binary Log
- Relay Log
- Store Engine Logs (If available)
- Error Log
The reason I wanted to fix this is because my client was issuing a flush logs to rotate the error log on a server with no replication. The crash was caused by replication. With individual flush logs it’s less likely for this to happen again in the future. People can simply issue a query for the …
[Read more]