Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d23e0f

Browse files
committed
Update C comment about O_DIRECT and fsync().
1 parent06711de commit7d23e0f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

‎src/include/access/xlogdefs.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,12 @@ typedef uint32 TimeLineID;
8585

8686
/*
8787
*Because O_DIRECT bypasses the kernel buffers, and because we never
88-
*read those buffers except during crash recovery, it is a win to use
89-
*it in all cases where we sync on each write().We could allow O_DIRECT
90-
*with fsync(), but because skipping the kernel buffer forces writes out
91-
*quickly, it seems best just to use it for O_SYNC. It is hard to imagine
92-
*how fsync() could be a win for O_DIRECT compared to O_SYNC and O_DIRECT.
93-
*Also, O_DIRECT is never enough to force data to the drives, it merely
94-
*tries to bypass the kernel cache, so we still need O_SYNC or fsync().
88+
*read those buffers except during crash recovery or if wal_level != minimal,
89+
*it is a win to use it in all cases where we sync on each write(). We could
90+
*allow O_DIRECT with fsync(), but it is unclear if fsync() could process
91+
*writes not buffered in the kernel. Also, O_DIRECT is never enough to force
92+
*data to the drives, it merely tries to bypass the kernel cache, so we still
93+
*need O_SYNC/O_DSYNC.
9594
*/
9695
#ifdefO_DIRECT
9796
#definePG_O_DIRECTO_DIRECT

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp