1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00
Files
mariadb/mysql-test/suite/sys_vars/r/innodb_flush_sync_basic.result
Marko Mäkelä 4cbfdeca84 MDEV-24109 InnoDB hangs with innodb_flush_sync=OFF
MDEV-23855 broke the handling of innodb_flush_sync=OFF.
That parameter is supposed to limit the page write rate
in case the log capacity is being exceeded and log checkpoints
are needed.

With this fix, the following should pass:
./mtr --mysqld=--loose-innodb-flush-sync=0

One of our best regression tests for page flushing is
encryption.innochecksum. With innodb_page_size=16k and
innodb_flush_sync=OFF it would likely hang without this fix.

log_sys.last_checkpoint_lsn: Declare as Atomic_relaxed<lsn_t>
so that we are allowed to read the value while not holding
log_sys.mutex.

buf_flush_wait_flushed(): Let the page cleaner perform the flushing
also if innodb_flush_sync=OFF. After the page cleaner has
completed, perform a checkpoint if it is needed, because
buf_flush_sync_for_checkpoint() will not be run if
innodb_flush_sync=OFF.

buf_flush_ahead(): Simplify the condition. We do not really care
whether buf_flush_page_cleaner() is running.

buf_flush_page_cleaner(): Evaluate innodb_flush_sync at the low
level. If innodb_flush_sync=OFF, rate-limit the batches to
innodb_io_capacity_max pages per second.

Reviewed by: Vladislav Vaintroub
2020-11-04 16:55:36 +02:00

85 lines
3.4 KiB
Plaintext

SET @start_global_value = @@global.innodb_flush_sync;
Valid values are 'ON' and 'OFF'
select @@global.innodb_flush_sync in (0, 1);
@@global.innodb_flush_sync in (0, 1)
1
select @@session.innodb_flush_sync;
ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable
SET GLOBAL innodb_flush_sync = ON;
show global variables like 'innodb_flush_sync';
Variable_name Value
innodb_flush_sync ON
show session variables like 'innodb_flush_sync';
Variable_name Value
innodb_flush_sync ON
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
set global innodb_flush_sync='OFF';
select @@global.innodb_flush_sync;
@@global.innodb_flush_sync
0
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC OFF
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC OFF
set @@global.innodb_flush_sync=1;
select @@global.innodb_flush_sync;
@@global.innodb_flush_sync
1
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
set global innodb_flush_sync=0;
select @@global.innodb_flush_sync;
@@global.innodb_flush_sync
0
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC OFF
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC OFF
set @@global.innodb_flush_sync='ON';
select @@global.innodb_flush_sync;
@@global.innodb_flush_sync
1
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
set session innodb_flush_sync='OFF';
ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable and should be set with SET GLOBAL
set @@session.innodb_flush_sync='ON';
ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_flush_sync=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_flush_sync'
set global innodb_flush_sync=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_flush_sync'
set global innodb_flush_sync=2;
ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of '2'
set global innodb_flush_sync=-3;
ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of '-3'
select @@global.innodb_flush_sync;
@@global.innodb_flush_sync
1
select * from information_schema.global_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
select * from information_schema.session_variables where variable_name='innodb_flush_sync';
VARIABLE_NAME VARIABLE_VALUE
INNODB_FLUSH_SYNC ON
set global innodb_flush_sync='AUTO';
ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of 'AUTO'
SET @@global.innodb_flush_sync = @start_global_value;