diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result deleted file mode 100644 index f4114595819..00000000000 --- a/mysql-test/suite/innodb/r/innodb_bug12400341.result +++ /dev/null @@ -1,18 +0,0 @@ -call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot find a free slot for an undo log. Do you have too"); -drop database if exists mysqltest; -create database mysqltest; -CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; -select count(*) from information_schema.processlist where command != 'Daemon'; -count(*) -33 -connection default; -CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; -ERROR HY000: Can't create table `mysqltest`.`testtable` (errno: 177 "Too many active concurrent transactions") -select count(*) from information_schema.processlist where command != 'Daemon'; -count(*) -33 -connection default; -select count(*) from information_schema.processlist where command != 'Daemon'; -count(*) -33 -drop database mysqltest; diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test deleted file mode 100644 index 13eadc70bee..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ /dev/null @@ -1,102 +0,0 @@ -# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND - --- source include/have_debug.inc --- source include/have_innodb.inc --- source include/have_innodb_16k.inc - -# Don't test under valgrind, undo slots of the previous test might exist still -# and cause unstable result. ---source include/not_valgrind.inc -# undo slots of the previous test might exist still ---source include/not_windows.inc - -call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot find a free slot for an undo log. Do you have too"); - ---disable_query_log -set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; -set global innodb_trx_rseg_n_slots_debug = 32; ---enable_query_log - ---disable_warnings -drop database if exists mysqltest; ---enable_warnings - -create database mysqltest; -CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; - ---disable_query_log -# -# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached, -# because the cached insert_undo can be reused at "CREATE TABLE" statement later. -# -START TRANSACTION; -let $c = 1024; -while ($c) -{ - eval INSERT INTO mysqltest.transtable (id) VALUES ($c); - dec $c; -} -COMMIT; - -let $c = 32; -while ($c) -{ - # if failed at here, it might be shortage of file descriptors limit. - connect (con$c,localhost,root,,); - dec $c; -} ---enable_query_log - -select count(*) from information_schema.processlist where command != 'Daemon'; - -# -# fill the all undo slots -# ---disable_query_log -let $c = 32; -while ($c) -{ - connection con$c; - START TRANSACTION; - eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c; - dec $c; -} ---enable_query_log - -connection default; - ---error ER_CANT_CREATE_TABLE -CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; - -select count(*) from information_schema.processlist where command != 'Daemon'; - ---disable_query_log -let $c = 32; -while ($c) -{ - connection con$c; - ROLLBACK; - dec $c; -} ---enable_query_log - -connection default; -select count(*) from information_schema.processlist where command != 'Daemon'; - ---disable_query_log -let $c = 32; -while ($c) -{ - disconnect con$c; - dec $c; -} ---enable_query_log - -# -# If the isolated .ibd file remained, the drop database should fail. -# -drop database mysqltest; - ---disable_query_log -set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug; ---enable_query_log diff --git a/mysql-test/suite/perfschema/t/show_sanity.test b/mysql-test/suite/perfschema/t/show_sanity.test index 171bbfa8bd6..3f5a5ddfb62 100644 --- a/mysql-test/suite/perfschema/t/show_sanity.test +++ b/mysql-test/suite/perfschema/t/show_sanity.test @@ -491,7 +491,6 @@ insert into test.sanity values ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_SYNC_SPIN_LOOPS"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_TEMP_DATA_FILE_PATH"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG"), - ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_TRX_RSEG_N_SLOTS_DEBUG"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_DIRECTORY"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_LOG_TRUNCATE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_TABLESPACES"), diff --git a/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result deleted file mode 100644 index 7e253c869e3..00000000000 --- a/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result +++ /dev/null @@ -1,65 +0,0 @@ -SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; -SELECT @start_global_value; -@start_global_value -0 -select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; -@@global.innodb_trx_rseg_n_slots_debug between 0 and 1024 -1 -select @@global.innodb_trx_rseg_n_slots_debug; -@@global.innodb_trx_rseg_n_slots_debug -0 -select @@session.innodb_trx_rseg_n_slots_debug; -ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable -show global variables like 'innodb_trx_rseg_n_slots_debug'; -Variable_name Value -innodb_trx_rseg_n_slots_debug 0 -show session variables like 'innodb_trx_rseg_n_slots_debug'; -Variable_name Value -innodb_trx_rseg_n_slots_debug 0 -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 -set global innodb_trx_rseg_n_slots_debug=1; -select @@global.innodb_trx_rseg_n_slots_debug; -@@global.innodb_trx_rseg_n_slots_debug -1 -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 -set @@global.innodb_trx_rseg_n_slots_debug=0; -select @@global.innodb_trx_rseg_n_slots_debug; -@@global.innodb_trx_rseg_n_slots_debug -0 -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 -set session innodb_trx_rseg_n_slots_debug='some'; -ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL -set @@session.innodb_trx_rseg_n_slots_debug='some'; -ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL -set global innodb_trx_rseg_n_slots_debug=1.1; -ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' -set global innodb_trx_rseg_n_slots_debug='foo'; -ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' -set global innodb_trx_rseg_n_slots_debug=-2; -Warnings: -Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '-2' -set global innodb_trx_rseg_n_slots_debug=1e1; -ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' -set global innodb_trx_rseg_n_slots_debug=1024; -set global innodb_trx_rseg_n_slots_debug=1025; -Warnings: -Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '1025' -SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; -SELECT @@global.innodb_trx_rseg_n_slots_debug; -@@global.innodb_trx_rseg_n_slots_debug -0 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 032dde519cf..3b95064abd3 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1663,18 +1663,6 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT NULL -VARIABLE_NAME INNODB_TRX_RSEG_N_SLOTS_DEBUG -SESSION_VALUE NULL -DEFAULT_VALUE 0 -VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for trx_rsegf_undo_find_free() -NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 1024 -NUMERIC_BLOCK_SIZE 0 -ENUM_VALUE_LIST NULL -READ_ONLY NO -COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME INNODB_UNDO_DIRECTORY SESSION_VALUE NULL DEFAULT_VALUE diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test deleted file mode 100644 index 858e1b63908..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test +++ /dev/null @@ -1,59 +0,0 @@ ---source include/have_innodb.inc ---source include/have_debug.inc - -SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; -SELECT @start_global_value; - -# -# exists as global only -# -select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; -select @@global.innodb_trx_rseg_n_slots_debug; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.innodb_trx_rseg_n_slots_debug; -show global variables like 'innodb_trx_rseg_n_slots_debug'; -show session variables like 'innodb_trx_rseg_n_slots_debug'; ---disable_warnings -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; ---enable_warnings - -# -# show that it's writable -# -set global innodb_trx_rseg_n_slots_debug=1; -select @@global.innodb_trx_rseg_n_slots_debug; ---disable_warnings -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; ---enable_warnings -set @@global.innodb_trx_rseg_n_slots_debug=0; -select @@global.innodb_trx_rseg_n_slots_debug; ---disable_warnings -select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; -select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; ---enable_warnings ---error ER_GLOBAL_VARIABLE -set session innodb_trx_rseg_n_slots_debug='some'; ---error ER_GLOBAL_VARIABLE -set @@session.innodb_trx_rseg_n_slots_debug='some'; - -# -# incorrect types -# ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_trx_rseg_n_slots_debug=1.1; ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_trx_rseg_n_slots_debug='foo'; -set global innodb_trx_rseg_n_slots_debug=-2; ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_trx_rseg_n_slots_debug=1e1; -set global innodb_trx_rseg_n_slots_debug=1024; -set global innodb_trx_rseg_n_slots_debug=1025; - -# -# Cleanup -# - -SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; -SELECT @@global.innodb_trx_rseg_n_slots_debug; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 19582b79b2e..7ce5b4983fc 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19623,11 +19623,6 @@ static MYSQL_SYSVAR_ENUM(default_row_format, innodb_default_row_format, &innodb_default_row_format_typelib); #ifdef UNIV_DEBUG -static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT, - "Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for trx_rsegf_undo_find_free()", - NULL, NULL, 0, 0, 1024, 0); - static MYSQL_SYSVAR_UINT(limit_optimistic_insert_debug, btr_cur_limit_optimistic_insert_debug, PLUGIN_VAR_RQCMDARG, "Artificially limit the number of records per B-tree page (0=unlimited).", @@ -19900,7 +19895,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(compression_pad_pct_max), MYSQL_SYSVAR(default_row_format), #ifdef UNIV_DEBUG - MYSQL_SYSVAR(trx_rseg_n_slots_debug), MYSQL_SYSVAR(limit_optimistic_insert_debug), MYSQL_SYSVAR(trx_purge_view_update_only_debug), MYSQL_SYSVAR(evict_tables_on_commit_debug), diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 3ae2e0b5305..8a72199284d 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -70,11 +70,6 @@ inline buf_block_t *trx_sysf_get(mtr_t* mtr, bool rw= true) 0, rw ? RW_X_LATCH : RW_S_LATCH, mtr); } -#ifdef UNIV_DEBUG -/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ -extern uint trx_rseg_n_slots_debug; -#endif - /** Write DB_TRX_ID. @param[out] db_trx_id the DB_TRX_ID field to be written to @param[in] id transaction ID */ diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 9e8b256ffb6..8ac3f93cd15 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -437,7 +437,6 @@ loop: rollback segment. */ if (!(rseg.SKIP & rseg_ref) && !freed && - ut_d(!trx_rseg_n_slots_debug &&) &rseg == &trx_sys.rseg_array[purge_sys.skipped_rseg]) /* If rseg.space == purge_sys.truncate_undo_space.current the following will be a no-op. A possible conflict diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 68c3e79a3d1..0bd9a06bd44 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -45,9 +45,6 @@ Created 3/26/1996 Heikki Tuuri trx_sys_t trx_sys; #ifdef UNIV_DEBUG -/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ -uint trx_rseg_n_slots_debug = 0; - void rw_trx_hash_t::validate_element(trx_t *trx) { ut_ad(!trx->read_only || !trx->rsegs.m_redo.rseg); diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 560489cd9d0..e2adc085c53 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -802,7 +802,6 @@ static void trx_assign_rseg_low(trx_t *trx) undo tablespaces that are scheduled for truncation. */ static Atomic_counter rseg_slot; unsigned slot = rseg_slot++ % TRX_SYS_N_RSEGS; - ut_d(if (trx_rseg_n_slots_debug) slot = 0); ut_d(const auto start_scan_slot = slot); ut_d(bool look_for_rollover = false); trx_rseg_t* rseg; @@ -814,7 +813,6 @@ static void trx_assign_rseg_low(trx_t *trx) rseg = &trx_sys.rseg_array[slot]; ut_ad(!look_for_rollover || start_scan_slot != slot); ut_d(look_for_rollover = true); - ut_d(if (!trx_rseg_n_slots_debug)) slot = (slot + 1) % TRX_SYS_N_RSEGS; if (!rseg->space) { diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index 1751bba49e1..7c855bf2044 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -434,11 +434,6 @@ static ulint trx_rsegf_undo_find_free(const buf_block_t *rseg_header) { ulint max_slots= TRX_RSEG_N_SLOTS; -#ifdef UNIV_DEBUG - if (trx_rseg_n_slots_debug) - max_slots= std::min(trx_rseg_n_slots_debug, TRX_RSEG_N_SLOTS); -#endif - for (ulint i= 0; i < max_slots; i++) if (trx_rsegf_get_nth_undo(rseg_header, i) == FIL_NULL) return i;