pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Switch pg_test_fsync to use binary mode on Windows
7+ messages / 1 participants
[nested] [flat]

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/932f9fb504a57f296cf698d15bd93462ddfe2776

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/beebbb39d932289b73fa7cab4037895675615a8d

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cd113a0b4741b16624a0ffad326538de2f806cca

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/de559c2b06426e409bf7acf1c0d44a5f7d4550c3

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/800ec48f5ef2e2f8859449e643e470ac67cd1cef

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a452b239e3b0815f80ef1138634e158357e30126

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Switch pg_test_fsync to use binary mode on Windows
@ 2020-07-16 06:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Paquier @ 2020-07-16 06:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ab7ce97ece5729726b8fe4b4c0b695614b76937e

Modified Files
--------------
src/bin/pg_test_fsync/pg_test_fsync.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2020-07-16 06:54 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>
2020-07-16 06:54 pgsql: Switch pg_test_fsync to use binary mode on Windows Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox