mariadb/extra/mariabackup
Marko Mäkelä 4ca355d863 MDEV-33894: Resurrect innodb_log_write_ahead_size
As part of commit 685d958e38 (MDEV-14425)
the parameter innodb_log_write_ahead_size was removed, because it was
thought that determining the physical block size would be a sufficient
replacement.

However, we can only determine the physical block size on Linux or
Microsoft Windows. On some file systems, the physical block size
is not relevant. For example, XFS uses a block size of 4096 bytes
even if the underlying block size may be smaller.

On Linux, we failed to determine the physical block size if
innodb_log_file_buffered=OFF was not requested or possible.
This will be fixed.

log_sys.write_size: The value of the reintroduced parameter
innodb_log_write_ahead_size. To keep it simple, this is read-only
and a power of two between 512 and 4096 bytes, so that the previous
alignment guarantees are fulfilled. This will replace the previous
log_sys.get_block_size().

log_sys.block_size, log_t::get_block_size(): Remove.

log_t::set_block_size(): Ensure that write_size will not be less
than the physical block size. There is no point to invoke this
function with 512 or less, because that is the minimum value of
write_size.

innodb_params_adjust(): Add some disabled code for adjusting
the minimum value and default value of innodb_log_write_ahead_size
to reflect the log_sys.write_size.

log_t::set_recovered(): Mark the recovery completed. This is the
place to adjust some things if we want to allow write_size>4096.

log_t::resize_write_buf(): Refer to write_size.

log_t::resize_start(): Refer to write_size instead of get_block_size().

log_write_buf(): Simplify some arithmetics and remove a goto.

log_t::write_buf(): Refer to write_size. If we are writing less than
that, do not switch buffers, but keep writing to the same buffer.
Move some code to improve the locality of reference.

recv_scan_log(): Refer to write_size instead of get_block_size().

os_file_create_func(): For type==OS_LOG_FILE on Linux, always invoke
os_file_log_maybe_unbuffered(), so that log_sys.set_block_size() will
be invoked even if we are not attempting to use O_DIRECT.

recv_sys_t::find_checkpoint(): Read the entire log header
in a single 12 KiB request into log_sys.buf.

Tested with:
./mtr --loose-innodb-log-write-ahead-size=4096
./mtr --loose-innodb-log-write-ahead-size=2048
2024-06-27 16:38:08 +03:00
..
quicklz
aria_backup_client.cc Fix a typo which lead to compiler error on 32 bit systems 2024-04-09 17:11:49 +02:00
aria_backup_client.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_copy.cc Merge 10.6 into 10.11 2024-05-30 16:04:00 +03:00
backup_copy.h MDEV-32932 fix comments to match the code 2024-04-22 15:27:14 +02:00
backup_debug.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_mysql.cc Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
backup_mysql.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_wsrep.h
CMakeLists.txt MDEV-33447: libpmem is not available in RHEL 8 2024-04-19 10:54:08 +03:00
common.h MDEV-33379 innodb_log_file_buffering=OFF causes corruption on bcachefs 2024-02-20 11:22:45 +02:00
common_engine.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
common_engine.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
datasink.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
datasink.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ddl_log.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ddl_log.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_buffer.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_buffer.h
ds_compress.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_compress.h
ds_local.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_local.h
ds_stdout.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_stdout.h
ds_tmpfile.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_tmpfile.h
ds_xbstream.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_xbstream.h
encryption_plugin.cc Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
encryption_plugin.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
fil_cur.cc Merge branch '10.6' into 10.11 2024-04-26 08:02:49 +02:00
fil_cur.h Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
innobackupex.cc Give warnings if one tries to use obsolete options with mariadb-backup 2024-02-27 20:55:54 +02:00
innobackupex.h
read_filt.cc Cleanup: Remove changed_pages_bitmap 2024-02-12 17:01:35 +02:00
read_filt.h Cleanup: Remove changed_pages_bitmap 2024-02-12 17:01:35 +02:00
thread_pool.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
thread_pool.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
write_filt.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
write_filt.h MDEV-31039 mariadb-backup: remove global variables ds_data and ds_meta 2023-04-12 15:14:03 +04:00
wsrep.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xb_regex.h
xbcloud.cc Fix few vulnerabilities found by Cppcheck 2023-03-02 14:38:24 +11:00
xbstream.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xbstream.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xbstream_read.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xbstream_write.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xtrabackup.cc MDEV-33894: Resurrect innodb_log_write_ahead_size 2024-06-27 16:38:08 +03:00
xtrabackup.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00