Why is MYSQL still using fsync () to clear data when the O_DIRECT option?

http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_flush_method

Based on the article above, if we select the O_DIRECT option, she described that

O_DIRECT: InnoDB uses O_DIRECT (or directio () for Solaris) to open data files and uses fsync () to clear data and log files.

As an O_DIRECT value, the value \ minimizing data will be cached in the kernel page cache, however fsync () is used to flush data from the page cache to the device, so my question is: why does MYSQL still use fsync () to clear both data when the option O_DIRECT?

+4
source share
1 answer

, , , O_DIRECT ( ):

O_DIRECT_NO_FSYNC: InnoDB O_DIRECT -, fsync(). , . , XFS. , fsync(), , , O_DIRECT. MySQL 5.6.7 ( № 11754304, № 45892).

MySQL # 45892 :

Domas , (XFS) fsync. , fsync ( O_SYNC ).

, , O_DIRECT , , , , .

:

fsync O_SYNC O_DIRECT.

: fsync() MySQL. , MySQL v5.6.7 MySQL (, innodb), , , O_DIRECT_NO_FSYNC.

+2
source

Source: https://habr.com/ru/post/1665595/


All Articles