Bug #83019 queries in "show processlist" oscillate with constant times higher each day
Submitted: 16 Sep 2016 6:30 Modified: 29 Mar 2017 13:30
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Connection Handling Severity:S2 (Serious)
Version:8.0.1 OS:Windows (Win7 X64)
Assigned to: CPU Architecture:Any

[16 Sep 2016 6:30] Shane Bester
Description:
Over time,  my processlist looks like Time values go haywire after a day:

mysql> show full processlist;select now(6);
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| Id | User | Host      | db   | Command | Time | State             | Info                  |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| 15 | root | localhost | test | Sleep   |    2 |                   | NULL                  |
| 16 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 17 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 18 | root | localhost | test | Query   |    2 | Sending to client | do 1                  |
| 19 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 20 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 21 | root | localhost | test | Query   |    2 | init              | do 1                  |
| 22 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 23 | root | localhost | test | Query   |    2 | init              | do 1                  |
| 30 | root | localhost | NULL | Query   |    2 | starting          | show full processlist |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
10 rows in set (0.00 sec)

+----------------------------+
| now(6)                     |
+----------------------------+
| 2016-09-16 08:25:12.314022 |
+----------------------------+
1 row in set (0.00 sec)

mysql> show full processlist;select now(6);
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| Id | User | Host      | db   | Command | Time | State             | Info                  |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| 15 | root | localhost | test | Sleep   |    2 |                   | NULL                  |
| 16 | root | localhost | test | Query   |    2 | Opening tables    | do 1                  |
| 17 | root | localhost | test | Query   |    2 | Sending to client | do 1                  |
| 18 | root | localhost | test | Query   |    2 | freeing items     | do 1                  |
| 19 | root | localhost | test | Query   |    2 | Opening tables    | do 1                  |
| 20 | root | localhost | test | Query   |    2 | freeing items     | do 1                  |
| 21 | root | localhost | test | Query   |    2 | NULL              | NULL                  |
| 22 | root | localhost | test | Query   |    2 | NULL              | do 1                  |
| 23 | root | localhost | test | Query   |    2 | Sending to client | do 1                  |
| 30 | root | localhost | NULL | Query   |    2 | starting          | show full processlist |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
10 rows in set (0.00 sec)

+----------------------------+
| now(6)                     |
+----------------------------+
| 2016-09-16 08:25:13.481108 |
+----------------------------+
1 row in set (0.00 sec)

mysql> show full processlist;select now(6);
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| Id | User | Host      | db   | Command | Time | State             | Info                  |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
| 15 | root | localhost | test | Sleep   |    3 |                   | NULL                  |
| 16 | root | localhost | test | Query   |    3 | Sending to client | do 1                  |
| 17 | root | localhost | test | Query   |    3 | freeing items     | do 1                  |
| 18 | root | localhost | test | Query   |    3 | Sending to client | do 1                  |
| 19 | root | localhost | test | Query   |    3 | freeing items     | do 1                  |
| 20 | root | localhost | test | Query   |    3 | Sending to client | do 1                  |
| 21 | root | localhost | test | Query   |    3 | Sending to client | do 1                  |
| 22 | root | localhost | test | Query   |    3 | query end         | do 1                  |
| 23 | root | localhost | test | Query   |    3 | NULL              | do 1                  |
| 30 | root | localhost | NULL | Query   |    3 | starting          | show full processlist |
+----+------+-----------+------+---------+------+-------------------+-----------------------+
10 rows in set (0.00 sec)

+----------------------------+
| now(6)                     |
+----------------------------+
| 2016-09-16 08:25:13.922521 |
+----------------------------+
1 row in set (0.00 sec)

The Time value is wrong.  The queries are really quick,  as we can see:
mysql> show global status like '%questions%';
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| Questions     | 48177388170 |
+---------------+-------------+
1 row in set (0.00 sec)

mysql> show global status like '%uptime%';
+---------------------------+--------+
| Variable_name             | Value  |
+---------------------------+--------+
| Uptime                    | 148775 |
| Uptime_since_flush_status | 148775 |
+---------------------------+--------+
2 rows in set (0.00 sec)

Threads: 10  Questions: 934717420  Slow queries: 0  Opens: 408  Flush tables: 2  Open tables: 386  Queries per second avg: 323840.414

How to repeat:
use something like mysqlslap to run "do 1;" in few threads for a few days.

On day 1, show processlist will show queries with 0 or 1 Time.
On day 2, show processlist will show queries with 1 or 2 Time.
On day 3, show processlist will show queries with 2 or 3 Time.
etc.
[16 Sep 2016 9:33] Laurynas Biveinis
Maybe fixing bug 74416 would take care of this issue too :)
[16 Nov 2016 5:05] MySQL Verification Team
Hello Shane,

Thank you for the report.
Observed this recently on windows box.

Thanks,
Umesh
[5 Jan 2017 7:29] MySQL Verification Team
this was not reproducible on 5.7.17.
[16 Feb 2017 16:42] MySQL Verification Team
This did not affect recent mysql-trunk on linux...
[29 Mar 2017 13:30] Paul DuBois
Posted by developer:
 
Noted in 8.0.2 changelog.

On Windows, Time values in SHOW PROCESSLIST output drifted higher
over time.