Bug #71275 Manual is wrong when explaining PROCESSLIST_ID for background thread
Submitted: 2 Jan 2014 14:42 Modified: 8 Jan 2014 13:17
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: missing manual, performance_schema, threads

[2 Jan 2014 14:42] Valeriy Kravchuk
Description:
This manual page, http://dev.mysql.com/doc/refman/5.6/en/threads-table.html, says:

"PROCESSLIST_ID

For threads that are displayed in the INFORMATION_SCHEMA.PROCESSLIST table, this is the PROCESSLIST.ID value, which is also the value that CONNECTION_ID() would return within that thread. For background threads (threads not associated with a user connection), PROCESSLIST_ID is 0, so the values are not unique."

Unfortunately, PROCESSLIST_ID is NOT 0, but NULL for background threads.

How to repeat:
mysql> select thread_id, processlist_id, name from performance_schema.threads where type='BACKGROUND';
+-----------+----------------+----------------------------------------+
| thread_id | processlist_id | name                                   |
+-----------+----------------+----------------------------------------+
|         1 |           NULL | thread/sql/main                        |
|         2 |           NULL | thread/innodb/io_handler_thread        |
|         3 |           NULL | thread/innodb/io_handler_thread        |
|         4 |           NULL | thread/innodb/io_handler_thread        |
|         5 |           NULL | thread/innodb/io_handler_thread        |
|         6 |           NULL | thread/innodb/io_handler_thread        |
|         7 |           NULL | thread/innodb/io_handler_thread        |
|         8 |           NULL | thread/innodb/io_handler_thread        |
|         9 |           NULL | thread/innodb/io_handler_thread        |
|        10 |           NULL | thread/innodb/io_handler_thread        |
|        11 |           NULL | thread/innodb/io_handler_thread        |
|        14 |           NULL | thread/innodb/srv_lock_timeout_thread  |
|        15 |           NULL | thread/innodb/srv_monitor_thread       |
|        16 |           NULL | thread/innodb/srv_purge_thread         |
|        17 |           NULL | thread/innodb/srv_error_monitor_thread |
|        18 |           NULL | thread/innodb/srv_master_thread        |
|        19 |           NULL | thread/innodb/page_cleaner_thread      |
|        20 |           NULL | thread/sql/shutdown                    |
|        21 |           NULL | thread/sql/con_sockets                 |
+-----------+----------------+----------------------------------------+
19 rows in set (0.00 sec)

mysql> select thread_id, processlist_id, name from performance_schema.threads where processlist_id=0;
Empty set (0.04 sec)

Suggested fix:
Fix the manual to explain PROCESSLIST_ID properly for background threads.
[2 Jan 2014 14:43] Valeriy Kravchuk
Corrected synopsis.
[2 Jan 2014 18:10] MySQL Verification Team
Hello Valeriy,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[2 Jan 2014 18:11] MySQL Verification Team
// 5.6.16
// Confirmed from the latest build..

mysql> select version();
+---------------------------------------+
| version()                             |
+---------------------------------------+
| 5.6.16-enterprise-commercial-advanced |
+---------------------------------------+
1 row in set (0.00 sec)

mysql> select thread_id, processlist_id, name from performance_schema.threads where type='BACKGROUND';
+-----------+----------------+----------------------------------------+
| thread_id | processlist_id | name                                   |
+-----------+----------------+----------------------------------------+
|         1 |           NULL | thread/sql/main                        |
|         2 |           NULL | thread/innodb/io_handler_thread        |
|         3 |           NULL | thread/innodb/io_handler_thread        |
|         4 |           NULL | thread/innodb/io_handler_thread        |
|         5 |           NULL | thread/innodb/io_handler_thread        |
|         6 |           NULL | thread/innodb/io_handler_thread        |
|         7 |           NULL | thread/innodb/io_handler_thread        |
|         8 |           NULL | thread/innodb/io_handler_thread        |
|         9 |           NULL | thread/innodb/io_handler_thread        |
|        10 |           NULL | thread/innodb/io_handler_thread        |
|        11 |           NULL | thread/innodb/io_handler_thread        |
|        13 |           NULL | thread/innodb/srv_lock_timeout_thread  |
|        14 |           NULL | thread/innodb/srv_error_monitor_thread |
|        15 |           NULL | thread/innodb/srv_monitor_thread       |
|        16 |           NULL | thread/innodb/srv_master_thread        |
|        17 |           NULL | thread/innodb/srv_purge_thread         |
|        18 |           NULL | thread/innodb/page_cleaner_thread      |
|        19 |           NULL | thread/sql/signal_handler              |
+-----------+----------------+----------------------------------------+
18 rows in set (0.00 sec)

mysql> select thread_id, processlist_id, name from performance_schema.threads where processlist_id=0;
Empty set (0.00 sec)

mysql>
[8 Jan 2014 13:14] Paul DuBois
You are correct. I asked Marc about this and it changed in MySQL 5.6.9.
[8 Jan 2014 13:17] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.