Description:
Hi,
In the documentation for innodb_flush_method [1] (link to 8.4, same for 8.0 and 9.6), the first sentence / paragraph is...
[1]: https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html#sysvar_innodb_flush_method
> Defines the method used to flush data to InnoDB data files and log files, which can affect I/O throughput.
...if we read further down in the documentation, we have...
> O_DIRECT or 4: InnoDB uses O_DIRECT (or directio() on Solaris) to open the data files, and uses fsync() to flush both the data and log files. This option is available on some GNU/Linux versions, FreeBSD, and Solaris.
So innodb_flush_method does not only impact flushing, it also impacts how data files are opened / read. And not super clear in the above (you need to read the Linux open system-call documentation [2] for figuring this out), the Linux Page Cache is bypassed when a file is opened with O_DIRECT.
[2]: https://man7.org/linux/man-pages/man2/open.2.html
I would expect the documentation to be more clear on this subject.
Many thanks for looking into this,
Jean-François Gagné
How to repeat:
N/A to a documentation bug, details in the description.
Suggested fix:
Two things...
1. Change the the first sentence / paragraph of the doc from...
> Defines the method used to flush data to InnoDB data files and log files, which can affect I/O throughput.
...to...
> Defines the method used to flush data to InnoDB data files and log files, which can affect I/O throughput. Might also impact the way InnoDB data files are read / cached.
2. Update the O_DIRECT doc from...
> O_DIRECT or 4: InnoDB uses O_DIRECT (or directio() on Solaris) to open the data files, and uses fsync() to flush both the data and log files. This option is available on some GNU/Linux versions, FreeBSD, and Solaris.
...to...
> O_DIRECT or 4: InnoDB uses O_DIRECT (or directio() on Solaris) to open the data files, and uses fsync() to flush both the data and log files. Amongst other things, this disable the file system cache when reading data files (all the details are in the Linux Documentation). This option is available on some GNU/Linux versions, FreeBSD, and Solaris.