Re: fdatasync(2) on macOS

2021-02-04 Thread Thomas Munro
On Mon, Jan 18, 2021 at 4:39 PM Thomas Munro wrote: > On Sat, Jan 16, 2021 at 6:55 AM Tom Lane wrote: > > So it's not a no-op, but on the other hand it's not succeeding in getting > > bits down to the platter. I'm not inclined to dike it out, but it does > > seem problematic that we're defaultin

Re: fdatasync(2) on macOS

2021-01-25 Thread Thomas Munro
On Mon, Jan 18, 2021 at 5:08 PM Tom Lane wrote: > (1) other platforms weren't safe-by-default either. Perhaps the > state of the art is better now, though? Generally the answer seems to be yes, but there are still some systems out there that don't send flushes when volatile write cache is enable

Re: fdatasync(2) on macOS

2021-01-17 Thread Tom Lane
Thomas Munro writes: > On Sat, Jan 16, 2021 at 6:55 AM Tom Lane wrote: >> I have a vague recollection that we discussed changing the default >> wal_sync_method for Darwin years ago, but I don't recall why we >> didn't pull the trigger. These results certainly suggest that >> we oughta. > No str

Re: fdatasync(2) on macOS

2021-01-17 Thread Thomas Munro
On Sat, Jan 16, 2021 at 6:55 AM Tom Lane wrote: > So it's not a no-op, but on the other hand it's not succeeding in getting > bits down to the platter. I'm not inclined to dike it out, but it does > seem problematic that we're defaulting to open_datasync, which is also > not getting bits down to

Re: fdatasync(2) on macOS

2021-01-15 Thread Bruce Momjian
On Fri, Jan 15, 2021 at 12:55:52PM -0500, Tom Lane wrote: > > So... does this unreleased function flush drive caches? We know that > > fsync(2) doesn't, based on Apple's advice[1] for databases hackers to > > call fcntl(fd, F_FULLSYNC, 0) instead. We do that. > > pg_test_fsync results make it cl

Re: fdatasync(2) on macOS

2021-01-15 Thread Tom Lane
Thomas Munro writes: > While following along with the nearby investigation into weird > cross-version Apple toolchain issues that confuse configure, I noticed > that the newer buildfarm Macs say: > checking for fdatasync... (cached) yes > That's a bit strange because there's no man page and no dec

Re: fdatasync(2) on macOS

2021-01-15 Thread Thomas Munro
On Fri, Jan 15, 2021 at 7:53 PM Thomas Munro wrote: > That was fun, but now I'm asking myself: do we really want to use an > IO synchronisation facility that's not declared by the vendor? I should add, the default wal_sync_method is open_datasync, not fdatasync. I'm pretty suspicious of that too

fdatasync(2) on macOS

2021-01-14 Thread Thomas Munro
Hello hackers, While following along with the nearby investigation into weird cross-version Apple toolchain issues that confuse configure, I noticed that the newer buildfarm Macs say: checking for fdatasync... (cached) yes That's a bit strange because there's no man page and no declaration: che