diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-03-11 06:46:44 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-03-11 06:46:44 -0500 |
commit | 7d23e0f803fc0af0ff7b317a504eba31a51ebade (patch) | |
tree | 830927c6cc6194bfb657a823cd2c8c4fae038d77 /src | |
parent | 06711de9d9d4e122d4e4c9b801b471e048281f48 (diff) | |
download | postgresql-7d23e0f803fc0af0ff7b317a504eba31a51ebade.tar.gz postgresql-7d23e0f803fc0af0ff7b317a504eba31a51ebade.zip |
Update C comment about O_DIRECT and fsync().
Diffstat (limited to 'src')
-rw-r--r-- | src/include/access/xlogdefs.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/include/access/xlogdefs.h b/src/include/access/xlogdefs.h index 9078f3eb4e6..2982a4799cd 100644 --- a/src/include/access/xlogdefs.h +++ b/src/include/access/xlogdefs.h @@ -85,13 +85,12 @@ typedef uint32 TimeLineID; /* * Because O_DIRECT bypasses the kernel buffers, and because we never - * read those buffers except during crash recovery, it is a win to use - * it in all cases where we sync on each write(). We could allow O_DIRECT - * with fsync(), but because skipping the kernel buffer forces writes out - * quickly, it seems best just to use it for O_SYNC. It is hard to imagine - * how fsync() could be a win for O_DIRECT compared to O_SYNC and O_DIRECT. - * Also, O_DIRECT is never enough to force data to the drives, it merely - * tries to bypass the kernel cache, so we still need O_SYNC or fsync(). + * read those buffers except during crash recovery or if wal_level != minimal, + * it is a win to use it in all cases where we sync on each write(). We could + * allow O_DIRECT with fsync(), but it is unclear if fsync() could process + * writes not buffered in the kernel. Also, O_DIRECT is never enough to force + * data to the drives, it merely tries to bypass the kernel cache, so we still + * need O_SYNC/O_DSYNC. */ #ifdef O_DIRECT #define PG_O_DIRECT O_DIRECT |