Percona Server does not do background log flushing during the period when there is no user activity
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Invalid
|
Undecided
|
Unassigned | ||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.5 |
Triaged
|
Medium
|
Unassigned | ||
5.6 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Percona Server version: 5.5.28-rel29.1
When there is no activity from user threads then Percona Server does not do background flushing of log. This goes against fuzzy checkpointing behaviour and this documentation in the code:
srv0srv.c:
/* If i/os during the 10 second period were less than 200% of
capacity, we assume that there is free disk i/o capacity
available, and it makes sense to flush srv_io_capacity pages.
Note that this is done regardless of the fraction of dirty
pages relative to the max requested by the user. The one second
loop above requests writes for that case. The writes done here
are not required, and may be disabled. */
This can potentially mean that there can stalls caused later on, which could have been avoided had background flushing being done when there was no user activity.
I am seeing this behaviour on a server that has 340K dirty_pages:
mysql> show status like 'innodb_
+------
| Variable_name | Value |
+------
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
| Innodb_
+------
And the checkpoint age is nearly 70% of the combined log file size:
innodb_
innodb_
---
LOG
---
Log sequence number 55314538017
Log flushed up to 55314538017
Last checkpoint at 52270114659
Max checkpoint age 3478212404
Checkpoint age target 3369518267
Modified age 3039401137
Checkpoint age 3044423358
You can see that checkpoint age is nearly 2.8G.
The main thread is constantly in state but there is no flushing happening:
Main thread process no. 21389, id 140591422957312, state: flushing log
The server is completely idle, no IO etc.
-- How to repeat:
Start mysqld as follows:
mysqld --query_
Prepare sysbench tables:
sysbench --test=
Warmup the bufferpool:
for t in $(seq 1 8); do mysql -A test -e "select * from sbtest${t}" > /dev/null; done
Do multiple runs of sysbench as follows:
sysbench --test=
Once the sysbench run finishes, do nothing and wait.
See http:// bugs.mysql. com/bug. php?id= 58966 also (probably related)