Merge lp:~vlad-lesin/percona-server/5.5-bug801989 into lp:percona-server/5.5
Status: | Work in progress | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~vlad-lesin/percona-server/5.5-bug801989 | ||||
Merge into: | lp:percona-server/5.5 | ||||
Diff against target: |
64 lines (+13/-5) 2 files modified
Percona-Server/storage/innobase/include/os0file.h (+3/-2) Percona-Server/storage/innobase/os/os0file.c (+10/-3) |
||||
To merge this branch: | bzr merge lp:~vlad-lesin/percona-server/5.5-bug801989 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Fixing | ||
Review via email: mp+123403@code.launchpad.net |
Description of the change
The https:/
The main idea of this fix is to return "true" on success and "false" otherwise from os_file_
I haven't found the way to test this bug with MTR. The only idea is to use LD_PRELOAD and the library which just returns "false" on "fcntl" and "open" with O_DIRECT. But I'm not sure if such test should be MTR test. It's supposed MTR tests are platform-independed but we need at least to build library and use platform-specific environment for testing.
Jenkins tests: http://
Unmerged revisions
- 297. By Vlad Lesin
-
The bug #801989 fix.
The main idea of this fix is to return "true" on success and "false" otherwise
from os_file_set_nocache( ). That allows to process O_DIRECT flag setting failures. If setting O_DIRECT failes on log files the srv_unix_
file_flush_ method is set
to SRV_UNIX_O_DIRECT value to do fsync() on log files. If O_DIRECT fails on
other files the error is ignored to do buffered I/O on filesystems that do not
support direct I/O(for example tmpfs).
Vlad, some comments on the patch:
- I don't think we should crash the server after failing to set bugs.mysql. com/bug. php?id= 26662
O_DIRECT. This way you are essentially resurrecting
http://
The warning is relatively harmless, the InnoDB will just do buffered
I/O on file systems that do not support O_DIRECT such as tmpfs.
It only becomes a problem in XtraDB in case of ALL_O_DIRECT, because
in this case XtraDB does not flush the log files, even if O_DIRECT
fails (the correctness of not doing fsync() when O_DIRECT succeeds
is a separate issue).
So what we should do is to disable ALL_O_DIRECT (i.e. O_DIRECT for create_ func() check the value returned by file_set_ nocache( ) introduced by your patch, and if it failed, do unix_file_ flush_method = SRV_UNIX_O_DIRECT). This way we will at
log files) and switch to O_DIRECT (i.e. O_DIRECT on data files only)
if setting O_DIRECT on a log file fails. That is, essentially use
the fix suggested by Yasufumi, but perhaps a cleaner variant,
i.e. in os_file_
os_
srv_
least do fsync() on log files when setting O_DIRECT failed.
- the bug also affects 5.1. I have updated the bug accordingly
- after fixing the above, please put description to revision comments
in addition to MP. Note that it's ok to reference bug numbers by
their number (e.g. "bug #...") rather than by the full URL. It's
unambiguous, but shorter
- to answer your concerns about the test case, I don't think we should
have a regression test for this fix.