Details
-
Bug
-
Status: Stalled (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.2(EOL)
-
None
Description
10.2 f2fe65106f, debug build, default configuration |
MariaDB [test]> show processlist;
|
+----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ |
| Id | User | Host | db | Command | Time | State | Info | Progress | |
+----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ |
| 1 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | |
| 2 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | |
| 4 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | |
| 3 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | |
| 5 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | |
| 10 | root | localhost:39009 | test | Query | 0 | init | show processlist | 0.000 |
|
+----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ |
6 rows in set (0.00 sec) |
I don't think they should be there
Attachments
Issue Links
- duplicates
-
MDEV-20558 innodb processes appears in processlist, ver10.3.13
-
- Closed
-
- is caused by
-
MDEV-5800 indexes on virtual (not materialized) columns
-
- Closed
-
- relates to
-
MDEV-12531 TIme column in SHOW PROCESSLIST shows NULL for InnoDB service threads
-
- Closed
-
-
MDEV-16264 Implement a common work queue for InnoDB background tasks
-
- Closed
-
-
MDEV-18698 Show InnoDB's internal background threads in SHOW ENGINE INNODB STATUS
-
- Open
-
-
MDEV-17238 Document special thread IDs used in SHOW ENGINE INNODB STATUS output
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code:sql|title=10.2 f2fe65106f, debug build, default configuration}
MariaDB [test]> show processlist; +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ | Id | User | Host | db | Command | Time | State | Info | Progress | +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ | 1 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 2 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 4 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 3 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 5 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 10 | root | localhost:39009 | test | Query | 0 | init | show processlist | 0.000 | +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ 6 rows in set (0.00 sec) I don't think they should be there |
{code:sql|title=10.2 f2fe65106f, debug build, default configuration}
MariaDB [test]> show processlist; +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ | Id | User | Host | db | Command | Time | State | Info | Progress | +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ | 1 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 2 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 4 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 3 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 5 | system user | | NULL | Daemon | NULL | InnoDB background thread | NULL | 0.000 | | 10 | root | localhost:39009 | test | Query | 0 | init | show processlist | 0.000 | +----+-------------+-----------------+------+---------+------+--------------------------+------------------+----------+ 6 rows in set (0.00 sec) {code} I don't think they should be there |
Assignee | Marko Mäkelä [ marko ] | Sergei Golubchik [ serg ] |
Labels | 10.2-ga |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Fix Version/s | 10.2.5 [ 22117 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.2.5 [ 22117 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] |
Labels | 10.2-ga |
Link | This issue relates to MDEV-18698 [ MDEV-18698 ] |
Link | This issue relates to MDEV-17238 [ MDEV-17238 ] |
Priority | Major [ 3 ] | Minor [ 4 ] |
Link |
This issue duplicates |
Workflow | MariaDB v3 [ 79045 ] | MariaDB v4 [ 143499 ] |
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.
That said, the thread labels are misleading. One of the threads is actually a shutdown helper thread that serg added in
MDEV-5800.I would propose the following patch to add some relevant detail to the output. Possibly SHOW PROCESSLIST should be extended with an option to display/suppress background threads. And possibly it should always omit the thd_destructor_proxy() thread.
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9a278143945..86ab705a3ba 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -329,7 +329,7 @@ thd_destructor_proxy(void *)
thd_destructor_myvar = _my_thread_var();
THD *thd= create_thd();
- thd_proc_info(thd, "InnoDB background thread");
+ thd_proc_info(thd, "InnoDB shutdown");
mysql_mutex_lock(&thd_destructor_mutex);
thd_destructor_myvar->current_mutex = &thd_destructor_mutex;
@@ -1788,14 +1788,14 @@ static MYSQL_THDVAR_BOOL(background_thread,
"Internal (not user visible) flag to mark "
"background purge threads", NULL, NULL, 0);
-/** Create a MYSQL_THD for background purge threads and mark it as such.
-@returns new MYSQL_THD */
+/** Create a MYSQL_THD for a background thread and mark it as such.
+@param name thread info for SHOW PROCESSLIST
+@return new MYSQL_THD */
MYSQL_THD
-innobase_create_background_thd()
-/*============================*/
+innobase_create_background_thd(const char* name)
{
MYSQL_THD thd= create_thd();
- thd_proc_info(thd, "InnoDB background thread");
+ thd_proc_info(thd, name);
THDVAR(thd, background_thread) = true;
return thd;
}
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index c10644be832..4231088a7a7 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -653,10 +653,11 @@ buffer pool size.
void
innodb_set_buf_pool_size(ulonglong buf_pool_size);
-/** Create a MYSQL_THD for background purge threads and mark it as such.
-@returns new MYSQL_THD */
+/** Create a MYSQL_THD for a background thread and mark it as such.
+@param name thread info for SHOW PROCESSLIST
+@return new MYSQL_THD */
MYSQL_THD
-innobase_create_background_thd();
+innobase_create_background_thd(const char* name);
/** Destroy a background purge thread THD.
@param[in] thd MYSQL_THD to destroy */
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 0eda03f7fd7..c07c68dc649 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -2742,7 +2742,7 @@ DECLARE_THREAD(srv_worker_thread)(
ut_ad(!srv_read_only_mode);
ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
my_thread_init();
- THD* thd = innobase_create_background_thd();
+ THD* thd = innobase_create_background_thd("purge worker");
#ifdef UNIV_DEBUG_THREAD_CREATION
ib::info() << "Worker thread starting, id "
@@ -3007,7 +3007,7 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
required by os_thread_create */
{
my_thread_init();
- THD* thd = innobase_create_background_thd();
+ THD* thd = innobase_create_background_thd("purge");
srv_slot_t* slot;
ulint n_total_purged = ULINT_UNDEFINED;