1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

MDEV-21452: Remove os_event_t, MUTEX_EVENT, TTASEventMutex, sync_array

We will default to MUTEXTYPE=sys (using OSTrackMutex) for those
ib_mutex_t that have not been replaced yet.

The view INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS is removed.

The parameter innodb_sync_array_size is removed.

FIXME: innodb_fatal_semaphore_wait_threshold will no longer be enforced.
We should enforce it for lock_sys.mutex and dict_sys.mutex somehow!

innodb_sync_debug=ON might still cover ib_mutex_t.
This commit is contained in:
Marko Mäkelä
2020-12-04 18:07:25 +02:00
parent 38fd7b7d91
commit db006a9a43
36 changed files with 16 additions and 2542 deletions

View File

@@ -50,8 +50,6 @@ create sql security invoker view i_sys_foreign_cols as select * from information
create sql security definer view d_sys_foreign_cols as select * from information_schema.innodb_sys_foreign_cols;
create sql security invoker view i_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security definer view d_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security invoker view i_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security definer view d_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security invoker view i_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security definer view d_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security invoker view i_sys_tablespaces as select * from information_schema.innodb_sys_tablespaces;
@@ -222,13 +220,6 @@ ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s)
select count(*) > -1 from d_sys_indexes;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_semaphore_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_semaphore_waits;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from d_sys_semaphore_waits;
count(*) > -1
1
select count(*) > -1 from information_schema.innodb_sys_tables;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
select count(*) > -1 from i_sys_tables;

View File

@@ -363,7 +363,3 @@ select * from information_schema.innodb_tablespaces_encryption;
SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID ROTATING_OR_FLUSHING
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed
select * from information_schema.innodb_sys_semaphore_waits;
THREAD_ID OBJECT_NAME FILE LINE WAIT_TIME WAIT_OBJECT WAIT_TYPE HOLDER_THREAD_ID HOLDER_FILE HOLDER_LINE CREATED_FILE CREATED_LINE WRITER_THREAD RESERVATION_MODE READERS WAITERS_FLAG LOCK_WORD LAST_WRITER_FILE LAST_WRITER_LINE OS_WAIT_COUNT
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_semaphore_waits but the InnoDB storage engine is not installed

View File

@@ -1,27 +0,0 @@
connect con1,localhost,root,,;
connect con2,localhost,root,,;
drop table if exists t1;
connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
set autocommit=0;
# Sending query on con1,
# the session will hold lock table mutex and sleep
SELECT * from t1 where id = 0 FOR UPDATE;
connection con2;
set autocommit=0;
# Sending query on con2,
# the session will be blocked on the lock table mutex and
# thus be put into sync arry
SELECT * from t1 where id = 0 FOR UPDATE;
connection default;
# Waitting for mysqld to crash
# Mysqld crash was detected
# Waitting for reconnect after mysqld restarts
# Reconnected after mysqld was successfully restarted
# Cleaning up before exit
SET debug_dbug = @saved_dbug;
drop table if exists t1;
# Clean exit

View File

@@ -26,5 +26,4 @@
--enable-plugin-innodb-sys-foreign-cols
--enable-plugin-innodb-sys-tablespaces
--enable-plugin-innodb-sys-virtual
--enable-plugin-innodb-sys-semaphore-waits
--enable-plugin-innodb-tablespaces-encryption

View File

@@ -79,9 +79,6 @@ create sql security definer view d_sys_foreign_cols as select * from information
create sql security invoker view i_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security definer view d_sys_indexes as select * from information_schema.innodb_sys_indexes;
create sql security invoker view i_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security definer view d_sys_semaphore_waits as select * from information_schema.innodb_sys_semaphore_waits;
create sql security invoker view i_sys_tables as select * from information_schema.innodb_sys_tables;
create sql security definer view d_sys_tables as select * from information_schema.innodb_sys_tables;
@@ -236,12 +233,6 @@ select count(*) > -1 from information_schema.innodb_sys_indexes;
select count(*) > -1 from i_sys_indexes;
select count(*) > -1 from d_sys_indexes;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_semaphore_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from i_sys_semaphore_waits;
select count(*) > -1 from d_sys_semaphore_waits;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
select count(*) > -1 from information_schema.innodb_sys_tables;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR

View File

@@ -59,4 +59,3 @@
--loose-innodb_sys_datafiles
--loose-innodb_changed_pages
--loose-innodb_tablespaces_encryption
--loose-innodb_sys_semaphore_waits

View File

@@ -27,4 +27,3 @@ select * from information_schema.innodb_sys_foreign;
select * from information_schema.innodb_sys_foreign_cols;
select * from information_schema.innodb_sys_tablespaces;
select * from information_schema.innodb_tablespaces_encryption;
select * from information_schema.innodb_sys_semaphore_waits;

View File

@@ -1,2 +0,0 @@
--innodb-fatal-semaphore-wait-threshold=1
--innodb-sys-semaphore-waits=1

View File

@@ -1,115 +0,0 @@
--source include/have_innodb.inc
--source include/not_windows.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1;
--enable_warnings
connection con1;
eval create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
# Enable the debug injection.
SET @saved_dbug = @@SESSION.debug_dbug;
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
set autocommit=0;
# The following query will hang for an hour since the debug injection
# code will sleep an hour after holding the lock table mutex
--echo # Sending query on con1,
--echo # the session will hold lock table mutex and sleep
--send
SELECT * from t1 where id = 0 FOR UPDATE;
# To make sure con1 holding the lock table mutex and sleeping
--sleep 2
connection con2;
set autocommit=0;
# The following query will be blocked on the lock table mutex held by
# con1 so it will be put into sync array.
--echo # Sending query on con2,
--echo # the session will be blocked on the lock table mutex and
--echo # thus be put into sync arry
--send
SELECT * from t1 where id = 0 FOR UPDATE;
# Waitting for mysqld to abort due to fatal semaphore timeout.
# Please note that, in the master.opt file, the fatal timeout
# was set to 1 second, but in mysqld debug mode, this timeout
# value will be timed 10 because UNIV_DEBUG_VALGRIND is set
# (see sync_array_print_long_waits_low() in storage/innobase/sync/sync0arr.cc)
# so the actual timeout will be 1 * 10 = 10 seconds. Besides,
# mysqld will abort after detecting this fatal timeout 10 times in
# a loop with interval of 1 second (see srv_error_monitor_thread
# thread in torage/innobase/srv/srv0srv.cc), so mysqld will abort
# in 1 * 10 + 1 * 10 = 20 seconds after con2 being blocked on
# the lock table mutex.
#
# P.S. the default fatal sempahore timeout is 600 seconds,
# so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds
# in debug mode and 600 + 1 * 10 = 610 seconds in release mode.
connection default;
--disable_result_log
--disable_query_log
# Since this test generates lot of errors in log, suppress checking errors
call mtr.add_suppression(".*");
# The crash is expected
exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--echo # Waitting for mysqld to crash
# It will take 20 seconds to detect the long semaphore and mysqld to abort.
# This test will be treated as pass as long as mysqld crash/restart is dectected
# in 80 seconds.
let $counter= 80;
let $mysql_errno= 0;
while (!$mysql_errno)
{
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
show status;
--error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
select * from information_schema.innodb_sys_semaphore_waits;
dec $counter;
if (!$counter)
{
# This will fail this test.
--die Server failed to dissapear
}
--sleep 1
}
--echo # Mysqld crash was detected
--echo # Waitting for reconnect after mysqld restarts
enable_reconnect;
connection default;
--exec echo "restart:--log-error=$error_log" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Call script that will poll the server waiting for it to be back online again
source include/wait_until_connected_again.inc;
--echo # Reconnected after mysqld was successfully restarted
--echo # Cleaning up before exit
--disable_warnings
SET debug_dbug = @saved_dbug;
drop table if exists t1;
--enable_warnings
--echo # Clean exit

View File

@@ -1 +0,0 @@
--innodb_sys_semaphore_waits

View File

@@ -1,24 +0,0 @@
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS;
Table Create Table
INNODB_SYS_SEMAPHORE_WAITS CREATE TEMPORARY TABLE `INNODB_SYS_SEMAPHORE_WAITS` (
`THREAD_ID` bigint(21) unsigned NOT NULL DEFAULT 0,
`OBJECT_NAME` varchar(4000) DEFAULT NULL,
`FILE` varchar(4000) DEFAULT NULL,
`LINE` int(11) unsigned NOT NULL DEFAULT 0,
`WAIT_TIME` bigint(21) unsigned NOT NULL DEFAULT 0,
`WAIT_OBJECT` bigint(21) unsigned NOT NULL DEFAULT 0,
`WAIT_TYPE` varchar(16) DEFAULT NULL,
`HOLDER_THREAD_ID` bigint(21) unsigned NOT NULL DEFAULT 0,
`HOLDER_FILE` varchar(4000) DEFAULT NULL,
`HOLDER_LINE` int(11) unsigned NOT NULL DEFAULT 0,
`CREATED_FILE` varchar(4000) DEFAULT NULL,
`CREATED_LINE` int(11) unsigned NOT NULL DEFAULT 0,
`WRITER_THREAD` bigint(21) unsigned NOT NULL DEFAULT 0,
`RESERVATION_MODE` varchar(16) DEFAULT NULL,
`READERS` int(11) unsigned NOT NULL DEFAULT 0,
`WAITERS_FLAG` bigint(21) unsigned NOT NULL DEFAULT 0,
`LOCK_WORD` bigint(21) unsigned NOT NULL DEFAULT 0,
`LAST_WRITER_FILE` varchar(4000) DEFAULT NULL,
`LAST_WRITER_LINE` int(11) unsigned NOT NULL DEFAULT 0,
`OS_WAIT_COUNT` int(11) unsigned NOT NULL DEFAULT 0
) ENGINE=MEMORY DEFAULT CHARSET=utf8

View File

@@ -1,3 +0,0 @@
--source include/have_innodb.inc
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS;

View File

@@ -1,30 +0,0 @@
Valid values are between 0 and 1024
SELECT @@global.innodb_sync_array_size between 0 and 1024;
@@global.innodb_sync_array_size between 0 and 1024
1
SELECT @@global.innodb_sync_array_size;
@@global.innodb_sync_array_size
1
SELECT @@session.innodb_sync_array_size;
ERROR HY000: Variable 'innodb_sync_array_size' is a GLOBAL variable
SHOW GLOBAL variables LIKE 'innodb_sync_array_size';
Variable_name Value
innodb_sync_array_size 1
SHOW SESSION variables LIKE 'innodb_sync_array_size';
Variable_name Value
innodb_sync_array_size 1
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_sync_array_size';
VARIABLE_NAME VARIABLE_VALUE
INNODB_SYNC_ARRAY_SIZE 1
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_sync_array_size';
VARIABLE_NAME VARIABLE_VALUE
INNODB_SYNC_ARRAY_SIZE 1
SET GLOBAL innodb_sync_array_size=10;
ERROR HY000: Variable 'innodb_sync_array_size' is a read only variable
SET SESSION innodb_sync_array_size=10;
ERROR HY000: Variable 'innodb_sync_array_size' is a read only variable
SELECT @@global.innodb_sync_array_size;
@@global.innodb_sync_array_size
1

View File

@@ -1665,18 +1665,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SYNC_ARRAY_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of the mutex/lock wait array.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SYNC_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF

View File

@@ -1,29 +0,0 @@
# 2010-01-27 - Added
--source include/have_innodb.inc
# Exists as global only
#
--echo Valid values are between 0 and 1024
SELECT @@global.innodb_sync_array_size between 0 and 1024;
SELECT @@global.innodb_sync_array_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_sync_array_size;
SHOW GLOBAL variables LIKE 'innodb_sync_array_size';
SHOW SESSION variables LIKE 'innodb_sync_array_size';
--disable_warnings
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_sync_array_size';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_sync_array_size';
--enable_warnings
#
# Show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL innodb_sync_array_size=10;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET SESSION innodb_sync_array_size=10;
SELECT @@global.innodb_sync_array_size;