[MDEV-11703] InnoDB background threads show up in the processlist Created: 2017-01-02 Updated: 2019-09-11 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
I don't think they should be there |
| Comments |
| Comment by Marko Mäkelä [ 2017-01-03 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think that all threads should be reported. In the future, InnoDB purge threads could wait for metadata locks, which would create visible conflicts with SQL execution.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-03-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
InnoDB background threads are no longer invisible for the server, they have THDs, and for many practical purposes they look like regular connection threads. That's why they're now shown. marko, thanks, will do. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2018-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
That's a bad user experience. THD has no meaning for users. It is internal information, for developers. There are 40 something threads after startup, if every thread gets a THD, do we want them all to be shown in all GUI tools? In "show processlist", people look for connections, that have meanings, to people. People get confused if they find something else. A background THD can be put into any list, which it does not have to be the main "threads" list, that is presented in processlist I also think that if KILL CONNECTION or KILL QUERY cannot be applied to "THD", it should not use a thread_id, that is , first connection should get a connection id 1, and not 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is arguable. If a thread owns a THD, it will open tables, place locks, etc. So the thread id will be visible, say, in the list of metadata locks (metadata_lock_info plugin) and in P_S. Not counting these threads might be quite difficult, but I can easily hide them in SHOW PROCESSLIST. And say "no such thread" in KILL. Still there must be thread id's assigned, and they'll be visible in some commands. Or... Make thread_id signed, internally. And assign negative id's to internal threads. Then connection id's will be sequential and internal threads won't be killable. Would it be an improvement? It cannot be done in a bug fix, though. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think hiding background thread THDs from PROCESSLIST and KILL is good enough. If this is achieved with negative thread_id, this is fine with me. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
wlad, negative id would be a separate feature, a easy way to distinguish visually internal from user threads. It cannot be done as a bug fix and is not part of this issue. Skipping internal threads in PROCESSLIST and KILL can be done based on something like thd->is_internal_thread() (or whatever), I'll do that. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg, fine with me, too. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There is a kind-of-a middle ground between "client connections" and "system threads" – replication-related threads: Binlog Dump on master and all those Slave_IO, Slave_SQL and Slave_worker threads on the slave. Unlike other system threads, they actually show states which make sense to the user and might be important to them; AFAIR they can also be meaningfully killed under some circumstances. I am not really sure how it can and should be treated, I think if we lose them for the sake of cosmetical improvements, users might be unhappy about it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-12-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The complete list of system threads:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-18698 seems to be loosely related to this. |