"InnoDB: using atomic writes." is always printed, with fprintf, different in formatting to anything else.
The message is misleading.
Note, that neither I chose the page size to be 4K, nor do I have 4K sectors on the disk here,
which would be prerequisite of atomic writes (on Windows)
InnoDB: using atomic writes.
2020-07-02 23:18:26 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
It turns out that the message output has not been changed ever since you introduced it in MDEV-4338. Please fix it as you see fit.
Marko Mäkelä
added a comment - It turns out that the message output has not been changed ever since you introduced it in MDEV-4338 . Please fix it as you see fit.
I think you need to fix it for when it was introduced outside of Fusion IO.
This message used to pop up, when innodb_use_atomic_writes was set to on, but after you removed it from MariaDB 10.3.0, this popped up on Windows.
The thing is Innodb is NOT using atomic writes, but it says it does. In the past it at least would complain if you tried to use them, and it did not work.
Vladislav Vaintroub
added a comment - - edited I think you need to fix it for when it was introduced outside of Fusion IO.
This message used to pop up, when innodb_use_atomic_writes was set to on, but after you removed it from MariaDB 10.3.0, this popped up on Windows.
The thing is Innodb is NOT using atomic writes, but it says it does. In the past it at least would complain if you tried to use them, and it did not work.
wlad, indeed, the message is misleading. Even if the global variable srv_use_atomic_writes were set, we would still invoke my_test_if_atomic_write() to check if writes are atomic with a particular page size.
When using the default innodb_page_size=16k, page writes should be atomic on NTFS when using ROW_FORMAT=COMPRESSED and KEY_BLOCK_SIZE<=4.
I think that we must also remove some other nonsense, because innodb_file_per_table is a dynamic parameter.
- if (srv_use_atomic_writes && !srv_file_per_table)
- {
- fprintf(stderr, "InnoDB: Disabling atomic_writes as file_per_table is not used.\n");
- srv_use_atomic_writes= 0;
- }
if (srv_use_atomic_writes) {
- fprintf(stderr, "InnoDB: using atomic writes.\n");
/*
Force O_DIRECT on Unixes (on Windows writes are always
unbuffered)
Marko Mäkelä
added a comment - wlad , indeed, the message is misleading. Even if the global variable srv_use_atomic_writes were set, we would still invoke my_test_if_atomic_write() to check if writes are atomic with a particular page size.
When using the default innodb_page_size=16k , page writes should be atomic on NTFS when using ROW_FORMAT=COMPRESSED and KEY_BLOCK_SIZE<=4 .
I think that we must also remove some other nonsense, because innodb_file_per_table is a dynamic parameter.
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 144f9951eb0..160eb329cc7 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4316,14 +4316,8 @@ innobase_init(
srv_use_atomic_writes
= innobase_use_atomic_writes && my_may_have_atomic_write;
- if (srv_use_atomic_writes && !srv_file_per_table)
- {
- fprintf(stderr, "InnoDB: Disabling atomic_writes as file_per_table is not used.\n");
- srv_use_atomic_writes= 0;
- }
if (srv_use_atomic_writes) {
- fprintf(stderr, "InnoDB: using atomic writes.\n");
/*
Force O_DIRECT on Unixes (on Windows writes are always
unbuffered)
Page writes can only be atomic on Windows (they do not mention NTFS ) if the write is the size of a sector, which leaves the single possibility with innodb page size = 4K and disk sector = 4K
Vladislav Vaintroub
added a comment - - edited Page writes can only be atomic on Windows (they do not mention NTFS ) if the write is the size of a sector, which leaves the single possibility with innodb page size = 4K and disk sector = 4K
Furthermore, the documentation string of innodb_use_atomic_writes was referring to deprecated options. I corrected that.
I think that we should probably deprecate and ignore this parameter, and just make use of atomic writes when they are available.
Marko Mäkelä
added a comment - Furthermore, the documentation string of innodb_use_atomic_writes was referring to deprecated options. I corrected that.
I think that we should probably deprecate and ignore this parameter, and just make use of atomic writes when they are available.
wlad, on 10.2 and 10.3, it seems to me that my_may_have_atomic_write should always be 0 on other systems than Linux. It is unclear to me how that message could have been output on Microsoft Windows.
Marko Mäkelä
added a comment - wlad , on 10.2 and 10.3, it seems to me that my_may_have_atomic_write should always be 0 on other systems than Linux. It is unclear to me how that message could have been output on Microsoft Windows.
It turns out that the message output has not been changed ever since you introduced it in
MDEV-4338. Please fix it as you see fit.