Re: BUG #16526: pg_test_fsync in v12 doesn't run in Windows
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: jeff.janes@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2020-07-04T01:03:56Z
Lists: pgsql-bugs
On Fri, Jul 03, 2020 at 04:01:46PM +0000, PG Bug reporting form wrote: > Note that it abandons the run here it does not just report an error and then > continue. > I'm not in a position to compile on Windows, so I can't run git bisect nor > tell if this is something specific to EDB. But I suspect this rather has > something to do with commit 0ba06e0bfb8cfd24ff17aca92aa72245ddd6c4d7 I think that the error actually comes from 40cfe86, where we enforce O_TEXT in our port of open() for Windows so as the switch from WIN32's open() to our concurrent-safe version remains compatible. O_TEXT and FILE_FLAG_NO_BUFFERING are visibly incompatible together, and enforcing the call of open() in pg_test_fsync to use O_BINARY (actually PG_BINARY) when testing open_datasync() allows things to go through. So we are one call short of _setmode(), but it is more simple to pass down the flag when opening the fd. It may actually be safer in the long run to add the binary flag to all the calls of open() in pg_test_fsync. Thoughts? -- Michael
Commits
-
Switch pg_test_fsync to use binary mode on Windows
- ab7ce97ece57 9.5.23 landed
- a452b239e3b0 9.6.19 landed
- 800ec48f5ef2 10.14 landed
- de559c2b0642 11.9 landed
- cd113a0b4741 12.4 landed
- beebbb39d932 13.0 landed
- 932f9fb504a5 14.0 landed
-
Allow concurrent-safe open() and fopen() in frontend code for Windows
- 0ba06e0bfb8c 12.0 cited