postgresql/src/bin
Michael Paquier de559c2b06 Switch pg_test_fsync to use binary mode on Windows
pg_test_fsync has always opened files using the text mode on Windows, as
this is the default mode used if not enforced by _setmode().

This fixes a failure when running pg_test_fsync down to 12 because
O_DSYNC and the text mode are not able to work together nicely.  We
fixed the handling of O_DSYNC in 12~ for the tool by switching to the
concurrent-safe version of fopen() in src/port/ with 0ba06e0.  And
40cfe86, by enforcing the text mode for compatibility reasons if O_TEXT
or O_BINARY are not specified by the caller, broke pg_test_fsync.  For
all versions, this avoids any translation overhead, and pg_test_fsync
should test binary writes, so it is a gain in all cases.

Note that O_DSYNC is still not handled correctly in ~11, leading to
pg_test_fsync to show insanely high numbers for open_datasync() (using
this property it is easy to notice that the binary mode is much
faster).  This would require a backpatch of 0ba06e0 and 40cfe86, which
could potentially break existing applications, so this is left out.

There are no TAP tests for this tool yet, so I have checked all builds
manually using MSVC.  We could invent a new option to run a single
transaction instead of using a duration of 1s to make the tests a
maximum short, but this is left as future work.

Thanks to Bruce Momjian for the discussion.

Reported-by: Jeff Janes
Author: Michael Paquier
Discussion: https://postgr.es/m/16526-279ded30a230d275@postgresql.org
Backpatch-through: 9.5
2020-07-16 15:53:01 +09:00
..
initdb Update Windows timezone name list to include currently-known zones. 2020-04-24 17:53:23 -04:00
pg_archivecleanup Translation updates 2019-11-11 10:50:22 +01:00
pg_basebackup Replace use of sys_siglist[] with strsignal(). 2020-07-15 22:05:12 -04:00
pg_config Translation updates 2019-11-11 10:50:22 +01:00
pg_controldata Translation updates 2019-11-11 10:50:22 +01:00
pg_ctl Translation updates 2020-02-10 13:06:23 +01:00
pg_dump Avoid trying to restore table ACLs and per-column ACLs in parallel. 2020-07-11 13:36:50 -04:00
pg_resetwal Translation updates 2019-11-11 10:50:22 +01:00
pg_rewind Fix handling of missing files when using pg_rewind with online source 2020-07-15 15:17:44 +09:00
pg_test_fsync Switch pg_test_fsync to use binary mode on Windows 2020-07-16 15:53:01 +09:00
pg_test_timing Translation updates 2019-11-11 10:50:22 +01:00
pg_upgrade pg_upgrade: set vacuum_defer_cleanup_age to zero 2020-06-15 20:59:40 -04:00
pg_verify_checksums Translation updates 2020-05-11 13:24:12 +02:00
pg_waldump Translation updates 2020-02-10 13:06:23 +01:00
pgbench Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:23:00 -05:00
pgevent Update copyright for 2018 2018-01-02 23:30:12 -05:00
psql Translation updates 2020-05-11 13:24:12 +02:00
scripts Translation updates 2020-05-11 13:24:12 +02:00
Makefile Allow on-line enabling and disabling of data checksums 2018-04-05 22:04:48 +02:00