MariaDB-server/cmake
Marko Mäkelä 7f7329f092 MDEV-33379 innodb_log_file_buffering=OFF causes corruption on bcachefs
Apparently, invoking fcntl(fd, F_SETFL, O_DIRECT) will lead to
unexpected behaviour on Linux bcachefs and possibly other file systems,
depending on the operating system version. So, let us avoid doing that,
and instead just attempt to pass the O_DIRECT flag to open(). This should
make us compatible with NetBSD, IBM AIX, as well as Solaris and its
derivatives.

This fix does not change the fact that we had only implemented
innodb_log_file_buffering=OFF on systems where we can determine the
physical block size (typically 512 or 4096 bytes).
Currently, those operating systems are Linux and Microsoft Windows.

HAVE_FCNTL_DIRECT, os_file_set_nocache(): Remove.

OS_FILE_OVERWRITE, OS_FILE_CREATE_PATH: Remove (never used parameters).

os_file_log_buffered(), os_file_log_maybe_unbuffered(): Helper functions.

os_file_create_simple_func(): When applicable, initially attempt to
open files in O_DIRECT mode.

os_file_create_func(): When applicable, initially attempt to
open files in O_DIRECT mode.
For type==OS_LOG_FILE && create_mode != OS_FILE_CREATE
we will first invoke stat(2) on the file name to find out if the size
is compatible with O_DIRECT. If create_mode == OS_FILE_CREATE, we will
invoke fstat(2) on the created log file afterwards, and may close and
reopen the file in O_DIRECT mode if applicable.

create_temp_file(): Support O_DIRECT. This is only used if O_TMPFILE is
available and innodb_disable_sort_file_cache=ON (non-default value).
Notably, that setting never worked on Microsoft Windows.

row_merge_file_create_mode(): Split from row_merge_file_create_low().
Create a temporary file in the specified mode.

Reviewed by: Vladislav Vaintroub
2024-02-20 11:22:45 +02:00
..
build_configurations
Internal/CPack
os MDEV-33379 innodb_log_file_buffering=OFF causes corruption on bcachefs 2024-02-20 11:22:45 +02:00
abi_check.cmake
aws_sdk.cmake MDEV-31205 Typo: complatible > compatible 2023-06-05 09:16:44 +10:00
build_depends.cmake
character_sets.cmake
check_compiler_flag.cmake
check_linker_flag.cmake
compile_flags.cmake
configurable_file_content.in
configure.pl
cpack_deb.cmake
cpack_rpm.cmake Merge branch '10.10' into 10.11 2023-08-08 14:57:31 +02:00
cpack_source_ignore_files.cmake
cpack_tgz.cmake
cpu_info.cmake
create_initial_db.cmake
ctest.cmake
do_abi_check.cmake
dtrace_prelink.cmake
dtrace.cmake
FindBISON.cmake
FindGit.cmake
FindJava.cmake Revert "MDEV-31230: Fix CONNECT_JDBC in CMake" 2023-06-02 09:02:41 +02:00
FindJNI.cmake Revert "MDEV-31230: Fix CONNECT_JDBC in CMake" 2023-06-02 09:02:41 +02:00
FindLIBAIO.cmake
FindLZ4.cmake
FindLZO.cmake
FindPMEM.cmake
FindSnappy.cmake
FindURING.cmake
FindZSTD.cmake
for_clients.cmake
info_bin.cmake
info_macros.cmake.in
info_src.cmake
install_layout.cmake
install_macros.cmake Merge branch '10.8' into 10.9 2023-01-31 10:37:31 +01:00
jemalloc.cmake
libfmt.cmake MDEV-32815 test main.func_sformat Locale + test failures under Fedora 39 (fmt-10.0.0+) 2024-02-01 18:35:18 +01:00
libutils.cmake
maintainer.cmake
make_dist.cmake.in
mariadb_connector_c.cmake
merge_archives_unix.cmake
misc.cmake
mysql_add_executable.cmake
mysql_version.cmake Merge branch '10.4' into 10.5 2024-01-31 17:32:53 +01:00
numa.cmake
package_name.cmake Merge branch '10.5' into 10.6 2024-01-31 18:04:03 +01:00
pcre.cmake Merge branch '10.6' into mariadb-10.6.17 2024-02-06 22:45:22 +01:00
plugin.cmake MDEV-33091 pcre2 headers aren't found on Solaris 2024-01-19 20:23:45 +01:00
readline.cmake Improve READLINE_V5 detection 2024-01-23 18:38:22 +02:00
sign.cmake.in
ssl.cmake
submodules.cmake
symlinks.cmake
systemd.cmake
tags.cmake
versioninfo.rc.in
win_compatibility.manifest
wsrep.cmake
zlib.cmake