aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-07-14 11:59:07 +1200
committerThomas Munro <tmunro@postgresql.org>2023-07-14 12:30:13 +1200
commitd0c28601efaa8b04f11a19506f3371bba8438acc (patch)
tree04f752fbb2ade2b6fc9f44d1c0c4d9978c98e01b /src/backend/storage/file/fd.c
parentaea7fe33fb6a96133c47cf4b3af25a7c62f49c06 (diff)
downloadpostgresql-d0c28601efaa8b04f11a19506f3371bba8438acc.tar.gz
postgresql-d0c28601efaa8b04f11a19506f3371bba8438acc.zip
Remove wal_sync_method=fsync_writethrough on Windows.
The "fsync" level already flushes drive write caches on Windows (as does "fdatasync"), so it only confuses matters to have an apparently higher level that isn't actually different at all. That leaves "fsync_writethrough" only for macOS, where it actually does something different. Reviewed-by: Magnus Hagander <magnus@hagander.net> Discussion: https://postgr.es/m/CA%2BhUKGJ2CG2SouPv2mca2WCTOJxYumvBARRcKPraFMB6GSEMcA%40mail.gmail.com
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 3c2a2fbef73..a027a8aabc2 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -399,7 +399,7 @@ pg_fsync(int fd)
#endif
/* #if is to skip the sync_method test if there's no need for it */
-#if defined(HAVE_FSYNC_WRITETHROUGH) && !defined(FSYNC_WRITETHROUGH_IS_FSYNC)
+#if defined(HAVE_FSYNC_WRITETHROUGH)
if (sync_method == SYNC_METHOD_FSYNC_WRITETHROUGH)
return pg_fsync_writethrough(fd);
else
@@ -437,9 +437,7 @@ pg_fsync_writethrough(int fd)
{
if (enableFsync)
{
-#ifdef WIN32
- return _commit(fd);
-#elif defined(F_FULLFSYNC)
+#if defined(F_FULLFSYNC)
return (fcntl(fd, F_FULLFSYNC, 0) == -1) ? -1 : 0;
#else
errno = ENOSYS;