[MDEV-8382] Processlist returns random numbers in Time column Created: 2015-06-25  Updated: 2015-06-29  Resolved: 2015-06-29

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: 10.1
Fix Version/s: 10.1.6

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: regression


 Description   

MariaDB [test]> show status like 'uptime';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Uptime        | 119   |
+---------------+-------+
1 row in set (0.00 sec)
 
MariaDB [test]> show processlist ;
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
| Id | User | Host            | db   | Command | Time     | State | Info             | Progress |
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
|  3 | root | localhost:47560 | test | Sleep   | 36680651 |       | NULL             |    0.000 |
|  4 | root | localhost:47561 | test | Query   |       94 | init  | show processlist |    0.000 |
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
2 rows in set (0.00 sec)
 
MariaDB [test]> show processlist ;
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
| Id | User | Host            | db   | Command | Time     | State | Info             | Progress |
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
|  3 | root | localhost:47560 | test | Sleep   | 44551816 |       | NULL             |    0.000 |
|  4 | root | localhost:47561 | test | Query   |       78 | init  | show processlist |    0.000 |
+----+------+-----------------+------+---------+----------+-------+------------------+----------+
2 rows in set (0.00 sec)

No need to do anything special, just start the server, open a couple of connections and run show processlist a few times.

The regression was introduced by the following commit:

commit 8f603bcbcac4a9091b6adbca3fd3655a947e759a 2bc6e29afeea374aa0ef4bc36c7a7b649c20d959
Author: Sergey Vojtovich <svoj@mariadb.org>
Date:   Wed Jun 17 18:55:38 2015 +0400
 
    MDEV-7952 - clock_gettime() takes 0.24% in OLTP RO
    
    Initialize abs_timeout when it is about to be used. This saves one my_hrtime()
    call on hot path (when we acquire MDL lock without waiting).
    
    When filling I_S.PROCESSLIST use THD::start_utime/THD::utime_after_query instead
    of THD::start_time. This allows us to save 2 clock_gettime() calls.
    
    Overhead change:
    __clock_gettime   0.13% -> 0.11% (122 -> 76 calls per OLTP RO transaction)
    my_interval_timer 0.07% -> 0.06%
    my_hrtime         0.04% -> 0.01%


Generated at Thu Feb 08 07:26:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.