Browse Source
MDEV-24109 InnoDB hangs with innodb_flush_sync=OFF
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 Vaintroubbb-10.5-MDEV-24142
7 changed files with 78 additions and 64 deletions
-
1include/my_atomic_wrapper.h
-
2mysql-test/include/innodb_checksum_algorithm.combinations
-
10mysql-test/suite/sys_vars/r/innodb_flush_sync_basic.result
-
7mysql-test/suite/sys_vars/t/innodb_flush_sync_basic.test
-
112storage/innobase/buf/buf0flu.cc
-
6storage/innobase/include/log0log.h
-
4storage/innobase/log/log0log.cc
Write
Preview
Loading…
Cancel
Save
Reference in new issue