Re: Windows now has fdatasync()
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Dave Page <dpage@pgadmin.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-07-18T03:26:36Z
Lists: pgsql-hackers
Attachments
- v3-0001-Fix-treatment-of-direct-I-O-in-pg_test_fsync.patch (text/x-patch) patch v3-0001
- v3-0002-Add-wal_sync_method-fdatasync-for-Windows.patch (text/x-patch) patch v3-0002
On Fri, Apr 8, 2022 at 7:56 PM Dave Page <dpage@pgadmin.org> wrote: > Windows 8 was a pretty unpopular release, so I would expect shifting to 10/2016+ for PG 16 would be unlikely to be a major problem. Thanks to Michael for making that happen. That removes the main thing I didn't know how to deal with in this patch. Here's a rebase with some cleanup. With my garbage collector hat on, I see that all systems we target have fdatasync(), except: 1. Windows, but this patch supplies src/port/fdatasync.c. 2. DragonflyBSD before 6.1. We have 6.0 in the build farm. 3. Ancient macOS. Current releases have it, though we have to cope with a missing declaration. From a standards point of view, fdatasync() is issue 5 POSIX like fsync(). Both are optional, but, being a database, we require fsync(), and they're both covered by the same POSIX option "Synchronized Input and Output". My plan now is to commit this patch so that problem #1 is solved, prod conchuela's owner to upgrade to solve #2, and wait until Tom shuts down prairiedog to solve #3. Then we could consider removing the HAVE_FDATASYNC probe and associated #ifdefs when convenient. For that reason, I'm not too bothered about the slight weirdness of defining HAVE_FDATASYNC on Windows even though that doesn't come from configure; it'd hopefully be short-lived. Better ideas welcome, though. Does that make sense?
Commits
-
Remove configure probe for fdatasync.
- d2e150831af8 16.0 landed
-
Remove O_FSYNC and associated macros.
- a1b56090eb54 16.0 landed
-
Fix warnings on Windows.
- bde60daa0ec9 16.0 landed
-
Add wal_sync_method=fdatasync for Windows.
- 9430fb407bb6 16.0 landed