mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
parent
00ee8d85c9
commit
5e62b6a5e0
47 changed files with 1152 additions and 5854 deletions
|
@ -102,6 +102,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
|
|||
#include <srv0srv.h>
|
||||
#include <crc_glue.h>
|
||||
#include <log.h>
|
||||
#include <thr_timer.h>
|
||||
|
||||
int sys_var_init();
|
||||
|
||||
|
@ -4052,7 +4053,7 @@ fail:
|
|||
especially in 64-bit
|
||||
computers */
|
||||
}
|
||||
|
||||
srv_thread_pool_init();
|
||||
sync_check_init();
|
||||
ut_d(sync_check_enable());
|
||||
/* Reset the system variables in the recovery module. */
|
||||
|
@ -6133,9 +6134,12 @@ int main(int argc, char **argv)
|
|||
DBUG_SET(dbug_option);
|
||||
}
|
||||
#endif
|
||||
/* Main functions for library */
|
||||
init_thr_timer(5);
|
||||
|
||||
int status = main_low(server_defaults);
|
||||
|
||||
end_thr_timer();
|
||||
backup_cleanup();
|
||||
|
||||
if (innobackupex_mode) {
|
||||
|
|
|
@ -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 |