diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-10-29 22:37:12 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-11-15 18:09:30 +0100 |
commit | 5e62b6a5e06eb02cbde1e34e95e26f42d87fce02 (patch) | |
tree | e20f8c1d9cd084ae1b8a4d2bd33eec4027d9fa90 /mysql-test/suite | |
parent | 00ee8d85c925846acc76df2a6fc7c67a062c2ea6 (diff) | |
download | mariadb-git-5e62b6a5e06eb02cbde1e34e95e26f42d87fce02.tar.gz |
MDEV-16264 Use threadpool for Innodb background work.
Almost all threads have gone
- the "ticking" threads, that sleep a while then do some work)
(srv_monitor_thread, srv_error_monitor_thread, srv_master_thread)
were replaced with timers. Some timers are periodic,
e.g the "master" timer.
- The btr_defragment_thread is also replaced by a timer , which
reschedules it self when current defragment "item" needs throttling
- the buf_resize_thread and buf_dump_threads are substitutes with tasks
Ditto with page cleaner workers.
- purge workers threads are not tasks as well, and purge cleaner
coordinator is a combination of a task and timer.
- All AIO is outsourced to tpool, Innodb just calls thread_pool::submit_io()
and provides the callback.
- The srv_slot_t was removed, and innodb_debug_sync used in purge
is currently not working, and needs reimplementation.
Diffstat (limited to 'mysql-test/suite')
5 files changed, 1 insertions, 141 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result index d99565b2f4c..1bbc577ed93 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result @@ -233,48 +233,3 @@ set global debug_dbug= @saved_dbug; drop table t1; set debug_sync=reset; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; -# -# MDEV-18546 ASAN heap-use-after-free -# in innobase_get_computed_value / row_purge -# -CREATE TABLE t1 ( -pk INT AUTO_INCREMENT, -b BIT(15), -v BIT(15) AS (b) VIRTUAL, -PRIMARY KEY(pk), -UNIQUE(v) -) ENGINE=InnoDB; -INSERT IGNORE INTO t1 (b) VALUES -(NULL),(b'011'),(b'000110100'), -(b'01101101010'),(b'01111001001011'),(NULL); -SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated " - "SIGNAL before_row_allocated " - "WAIT_FOR flush_unlock"; -SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open " - "SIGNAL purge_open " - "WAIT_FOR select_open"; -set @saved_dbug= @@global.debug_dbug; -set global debug_dbug= "+d,ib_purge_virtual_index_callback"; -connect purge_waiter,localhost,root; -SET debug_sync= "now WAIT_FOR before_row_allocated"; -connection default; -REPLACE INTO t1 (pk, b) SELECT pk, b FROM t1; -connection purge_waiter; -connection default; -disconnect purge_waiter; -FLUSH TABLES; -SET GLOBAL innodb_debug_sync = reset; -SET debug_sync= "now SIGNAL flush_unlock WAIT_FOR purge_open"; -SET GLOBAL innodb_debug_sync = reset; -SET debug_sync= "ib_open_after_dict_open SIGNAL select_open"; -SELECT * FROM t1; -pk b v -1 NULL NULL -2 -3 -4 j j -5 K K -6 NULL NULL -DROP TABLE t1; -SET debug_sync= reset; -set global debug_dbug= @saved_dbug; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test index 276407007da..04ab8a88488 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test @@ -310,67 +310,3 @@ drop table t1; --source include/wait_until_count_sessions.inc set debug_sync=reset; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; - ---echo # ---echo # MDEV-18546 ASAN heap-use-after-free ---echo # in innobase_get_computed_value / row_purge ---echo # - -CREATE TABLE t1 ( - pk INT AUTO_INCREMENT, - b BIT(15), - v BIT(15) AS (b) VIRTUAL, - PRIMARY KEY(pk), - UNIQUE(v) -) ENGINE=InnoDB; -INSERT IGNORE INTO t1 (b) VALUES - (NULL),(b'011'),(b'000110100'), - (b'01101101010'),(b'01111001001011'),(NULL); - -SET GLOBAL innodb_debug_sync = "ib_clust_v_col_before_row_allocated " - "SIGNAL before_row_allocated " - "WAIT_FOR flush_unlock"; -SET GLOBAL innodb_debug_sync = "ib_open_after_dict_open " - "SIGNAL purge_open " - "WAIT_FOR select_open"; - -# In 10.2 trx_undo_roll_ptr_is_insert(t_roll_ptr) condition never pass in purge, -# so this condition is forced to pass in row_vers_old_has_index_entry -set @saved_dbug= @@global.debug_dbug; -set global debug_dbug= "+d,ib_purge_virtual_index_callback"; - -# The purge starts from REPLACE command. To avoid possible race, separate -# connection is used. ---connect(purge_waiter,localhost,root) ---send -SET debug_sync= "now WAIT_FOR before_row_allocated"; - ---connection default -REPLACE INTO t1 (pk, b) SELECT pk, b FROM t1; - ---connection purge_waiter -# Now we will definitely catch ib_clust_v_col_before_row_allocated ---reap ---connection default ---disconnect purge_waiter - -# purge hangs on the sync point. table is purged, ref_count is set to 0 -FLUSH TABLES; - -# Avoid hang on repeating purge. -# Reset Will be applied after first record is purged -SET GLOBAL innodb_debug_sync = reset; - -SET debug_sync= "now SIGNAL flush_unlock WAIT_FOR purge_open"; - -# Avoid hang on repeating purge -SET GLOBAL innodb_debug_sync = reset; - -# select unblocks purge thread -SET debug_sync= "ib_open_after_dict_open SIGNAL select_open"; -SELECT * FROM t1; - -# Cleanup -DROP TABLE t1; -SET debug_sync= reset; -set global debug_dbug= @saved_dbug;
\ No newline at end of file diff --git a/mysql-test/suite/innodb/r/purge_thread_shutdown.result b/mysql-test/suite/innodb/r/purge_thread_shutdown.result index a87cba89917..85ac77e6d49 100644 --- a/mysql-test/suite/innodb/r/purge_thread_shutdown.result +++ b/mysql-test/suite/innodb/r/purge_thread_shutdown.result @@ -6,11 +6,6 @@ select user,state from information_schema.processlist order by 2; user state root root Filling schema table -system user InnoDB purge coordinator -system user InnoDB purge worker -system user InnoDB purge worker -system user InnoDB purge worker -system user InnoDB shutdown handler set global debug_dbug='+d,only_kill_system_threads'; set global innodb_fast_shutdown=0; shutdown; @@ -19,11 +14,6 @@ disconnect con1; select user,state from information_schema.processlist order by 2; user state root Filling schema table -system user InnoDB purge coordinator -system user InnoDB purge worker -system user InnoDB purge worker -system user InnoDB purge worker -system user InnoDB slow shutdown wait set global innodb_fast_shutdown=1; select user,state from information_schema.processlist order by 2; user state diff --git a/mysql-test/suite/perfschema/r/threads_innodb.result b/mysql-test/suite/perfschema/r/threads_innodb.result index 2229d972038..d79420f6fb5 100644 --- a/mysql-test/suite/perfschema/r/threads_innodb.result +++ b/mysql-test/suite/perfschema/r/threads_innodb.result @@ -5,14 +5,5 @@ FROM performance_schema.threads WHERE name LIKE 'thread/innodb/%' GROUP BY name; name type processlist_user processlist_host processlist_db processlist_command processlist_time processlist_state processlist_info parent_thread_id role instrumented -thread/innodb/io_ibuf_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/io_log_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/io_read_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/io_write_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES thread/innodb/page_cleaner_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/srv_error_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/srv_lock_timeout_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/srv_master_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/srv_monitor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/srv_purge_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES -thread/innodb/thd_destructor_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL 1 NULL YES +thread/innodb/thread_pool_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index f4c072431c6..274e25c169c 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -525,18 +525,6 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED -VARIABLE_NAME INNODB_DEBUG_SYNC -SESSION_VALUE NULL -DEFAULT_VALUE -VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE VARCHAR -VARIABLE_COMMENT debug_sync for innodb purge threads. Use it to set up sync points for all purge threads at once. The commands will be applied sequentially at the beginning of purging the next undo record. -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST NULL -READ_ONLY NO -COMMAND_LINE_ARGUMENT NONE VARIABLE_NAME INNODB_DEFAULT_ENCRYPTION_KEY_ID SESSION_VALUE 1 DEFAULT_VALUE 1 |