wal_sync_method=fsync_writethrough - Mailing list pgsql-hackers

From Thomas Munro
Subject wal_sync_method=fsync_writethrough
Date
Msg-id CA+hUKGJ2CG2SouPv2mca2WCTOJxYumvBARRcKPraFMB6GSEMcA@mail.gmail.com
Whole thread Raw
Responses Re: wal_sync_method=fsync_writethrough
List pgsql-hackers
Hi,

We allow $SUBJECT on Windows.  I'm not sure exactly how we finished up
with that, maybe a historical mistake, but I find it misleading today.
Modern Windows flushes drive write caches for fsync (= _commit()) and
fdatasync (= FLUSH_FLAGS_FILE_DATA_SYNC_ONLY).  In fact it is possible
to tell Windows to write out file data without flushing the drive
cache (= FLUSH_FLAGS_NO_SYNC), but I don't believe anyone is
interested in new weaker levels.  Any reason not to just get rid of
it?

On macOS, our fsync and fdatasync levels *don't* flush drive caches,
because those system calls don't on that OS, and they offer a weird
special fcntl, so there we offer $SUBJECT for a good reason.  Now that
macOS 10.2 systems are thoroughly extinct, I think we might as well
drop the configure probe, though, while we're doing a lot of that sort
of thing.

The documentation also says a couple of things that aren't quite
correct about wal_sync_level.  (I would also like to revise other
nearby outdated paragraphs about volatile write caches, sector sizes
etc, but that'll take some more research.)

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: use ARM intrinsics in pg_lfind32() where available
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Fix japanese translation of log messages