mariadb/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 Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
Internal/CPack Merge branch '10.4' into 10.5 2021-12-07 21:30:27 +01:00
os MDEV-33379 innodb_log_file_buffering=OFF causes corruption on bcachefs 2024-02-20 11:22:45 +02:00
abi_check.cmake Merge branch '10.4' into 10.5 2022-10-26 15:26:06 +02:00
aws_sdk.cmake MDEV-31205 Typo: complatible > compatible 2023-06-05 09:16:44 +10:00
build_depends.cmake MDEV-19740 Debug build of 10.3.15 FTBFS 2019-08-19 10:38:24 +03:00
character_sets.cmake A cleanup for MDEV-19897 Rename source code variable names from utf8 to utf8mb3 2019-06-28 21:12:57 +04:00
check_compiler_flag.cmake Merge 10.1 into 10.2 2019-06-12 10:30:01 +03:00
check_linker_flag.cmake MDEV-23887: check_linker_flags correct for old cmake compatibility 2020-10-21 19:11:02 +11:00
compile_flags.cmake
configurable_file_content.in
configure.pl Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
cpack_deb.cmake MDEV-24292 support semi-independent versioning for sub-packages 2021-01-12 16:47:23 +01:00
cpack_rpm.cmake Merge branch '10.10' into 10.11 2023-08-08 14:57:31 +02:00
cpack_source_ignore_files.cmake don't include .git files in source packages 2020-05-27 15:56:40 +02:00
cpack_tgz.cmake MDEV-14938 make buildbot to include galera into bintars 2022-01-07 15:37:00 +01:00
cpu_info.cmake cmake: fewer Build-Depends in SRPM 2021-05-22 21:56:51 +02:00
create_initial_db.cmake Added comment to create_inital_db.cmake of how to run it 2021-05-19 22:54:11 +02:00
ctest.cmake
do_abi_check.cmake Merge 10.4 into 10.5 2021-06-21 14:22:22 +03:00
dtrace.cmake Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
dtrace_prelink.cmake
FindBISON.cmake cmake: quieter 2020-05-31 11:29:43 +02:00
FindGit.cmake cmake: silence repeated git searches too 2021-05-22 21:56:51 +02:00
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 Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
FindLZ4.cmake cmake: detect lz4 version, require >= 1.6 2021-12-08 10:31:00 +01:00
FindLZO.cmake Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
FindPMEM.cmake Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
FindSnappy.cmake Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
FindURING.cmake Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
FindZSTD.cmake Change Find*.cmake modules to match conventions 2021-10-27 15:55:14 +02:00
for_clients.cmake Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
info_bin.cmake
info_macros.cmake.in
info_src.cmake
install_layout.cmake MDEV-22552: mytop packaging 2021-10-25 12:15:49 +02:00
install_macros.cmake Merge branch '10.8' into 10.9 2023-01-31 10:37:31 +01:00
jemalloc.cmake Merge 10.2 into 10.3 2021-07-22 18:57:54 +03:00
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 MDEV-28888 : Embedded MariaDB does not build on Windows 2022-07-03 17:11:56 +02:00
maintainer.cmake Merge 10.6 into 10.7 2022-10-13 10:05:29 +03:00
make_dist.cmake.in followup: rename generated files to have distinct names 2021-05-27 00:40:23 +02:00
mariadb_connector_c.cmake make install: don't assume $DESTDIR exists 2020-09-14 14:31:50 +02:00
merge_archives_unix.cmake libutils: merge_archives_unix 2020-06-18 14:15:36 +03:00
misc.cmake cleanup: CPACK_RPM_* package description 2019-07-10 09:02:10 +02:00
mysql_add_executable.cmake Merge branch '10.4' into 10.5 2022-08-10 12:24:31 +02:00
mysql_version.cmake Merge branch '10.4' into 10.5 2024-01-31 17:32:53 +01:00
numa.cmake Merge 10.2 into 10.3 2021-07-22 18:57:54 +03:00
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 Fix typos in the codebase. 2022-08-09 18:41:09 +03:00
ssl.cmake MDEV-27540 Different OpenSSL versions mix up in build depending on cmake options 2022-08-02 17:49:21 +02:00
submodules.cmake Merge 10.3 into 10.4 2022-03-29 11:13:18 +03:00
symlinks.cmake MDEV-21303: Fix man page packaging for new mariadb-* named binaries 2020-04-05 00:24:24 +03:00
systemd.cmake Merge 10.5 into 10.6 2022-11-30 07:06:41 +02:00
tags.cmake
versioninfo.rc.in
win_compatibility.manifest MDEV-26713 Set activeCodePage=UTF8 for windows programs 2021-12-15 19:13:57 +01:00
wsrep.cmake Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
zlib.cmake Fix typos in the codebase. 2022-08-09 18:41:09 +03:00