mariadb/mysql-test/lib
Marko Mäkelä 24648768b4 MDEV-30136: Deprecate innodb_flush_method
We introduce the following settable Boolean global variables:

innodb_log_file_write_through: Whether writes to ib_logfile0 are
write-through (disabling any caching, as in O_SYNC or O_DSYNC).

innodb_data_file_write_through: Whether writes to any InnoDB data files
(including the temporary tablespace) are write-through.

innodb_data_file_buffering: Whether the file system cache is enabled
for InnoDB data files.

All these parameters are OFF by default, that is, the file system cache
will be disabled, but any hardware caching is enabled, that is,
explicit calls to fsync(), fdatasync() or similar functions are needed.

On systems that support FUA it may make sense to enable write-through,
to avoid extra system calls.

If the deprecated read-only start-up parameter is set to one of the
following values, then the values of the 4 Boolean flags (the above 3
plus innodb_log_file_buffering) will be set as follows:

O_DSYNC:
innodb_log_file_write_through=ON, innodb_data_file_write_through=ON,
innodb_data_file_buffering=OFF, and
(if supported) innodb_log_file_buffering=OFF.

fsync, littlesync, nosync, or (Microsoft Windows specific) normal:
innodb_log_file_write_through=OFF, innodb_data_file_write_through=OFF,
and innodb_data_file_buffering=ON.

Note: fsync() or fdatasync() will only be disabled if the separate
parameter debug_no_sync (in the code, my_disable_sync) is set.

In mariadb-backup, the parameter innodb_flush_method will be ignored.

The Boolean parameters can be modified by SET GLOBAL while the
server is running. This will require reopening the ib_logfile0
or all currently open InnoDB data files.

We will open files straight in O_DSYNC or O_SYNC mode when applicable.
Data files we will try to open straight in O_DIRECT mode when the
page size is at least 4096 bytes. For atomically creating data files,
we will invoke os_file_set_nocache() to enable O_DIRECT afterwards,
because O_DIRECT is not supported on some file systems. We will also
continue to invoke os_file_set_nocache() on ib_logfile0 when
innodb_log_file_buffering=OFF can be fulfilled.

For reopening the ib_logfile0, we use the same logic that was developed
for online log resizing and reused for updates of
innodb_log_file_buffering.

Reopening all data files is implemented in the new function
fil_space_t::reopen_all().

Reviewed by: Vladislav Vaintroub
Tested by: Matthias Leich
2023-01-11 17:55:56 +02:00
..
My MDEV-30136: Deprecate innodb_flush_method 2023-01-11 17:55:56 +02:00
t Merge 10.1 into 10.2 2020-07-01 12:03:55 +03:00
v1 Merge 10.5 into 10.6 2022-07-27 17:52:37 +03:00
generate-ssl-certs.sh MDEV-18019, MDEV-18135: Renew test OpenSSL certs at level 3 security 2021-04-11 07:49:35 -07:00
mtr_cases.pm Merge 10.4 into 10.5 2022-07-27 17:17:24 +03:00
mtr_gprof.pl Update FSF Address 2019-05-11 21:29:06 +03:00
mtr_io.pl Update FSF Address 2019-05-11 21:29:06 +03:00
mtr_match.pm Update FSF Address 2019-05-11 21:29:06 +03:00
mtr_misc.pl Update FSF Address 2019-05-11 21:29:06 +03:00
mtr_process.pl Merge 10.5 into 10.6 2022-07-27 17:52:37 +03:00
mtr_report.pm MDEV-28931 --verbose option is too verbose 2022-07-18 23:16:17 +03:00
mtr_results.pm Update FSF Address 2019-05-11 21:29:06 +03:00
mtr_stress.pl MDEV-22010: use executables MariaDB named in scripts 2021-06-14 15:10:47 +05:30
mtr_unique.pm Update FSF Address 2019-05-11 21:29:06 +03:00
openssl.cnf MDEV-25785 Add support for OpenSSL 3.0 2022-07-04 12:49:11 +02:00
process-purecov-annotations.pl mtr: use env for perl 2020-06-23 03:24:46 +02:00