Re: BUG #16526: pg_test_fsync in v12 doesn't run in Windows
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: jeff.janes@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2020-07-14T00:06:25Z
Lists: pgsql-bugs
On Tue, Jul 7, 2020 at 05:25:49PM +0900, Michael Paquier wrote: > So, I have been looking at that again. And, I am not completely sure > why the combination of FILE_FLAG_NO_BUFFERING and _setmode(O_TEXT) > would cause this failure, but I suspect that this is caused by the > fact that CRLF gets changed into single LF characters on input (input > buffer uses random data), causing the size of what's expected to be > written to not match with what is actually written. An additional > factor is visibly our wrapper safe-concurrent wrapper pgwin32_open(). > > It seems to me that it would be a better idea to just use the binary > mode for all the open() calls in pg_test_fsync in the long run, which > is what the attached patch does as there is no control on the data > written. This way, we avoid any translation that may happen during > the write. Any thoughts? Well, pg_test_fsync is testing binary writes, so using TEXT for the files might add unwanted overhead, so I think binary is the best approach. -- Bruce Momjian <bruce@momjian.us> https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee
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