postgresql/src/bin
Heikki Linnakangas 3ea8e660c0 Fix more race conditions in the newly-added pg_rewind test.
pg_rewind looks at the control file to check what timeline a server is on.
But promotion doesn't immediately write a checkpoint, it merely writes
an end-of-recovery WAL record. If pg_rewind runs immediately after
promotion, before the checkpoint has completed, it will think think that
the server is still on the earlier timeline. We ran into this issue a long
time ago already, see commit 484a848a73.

It's a bit bogus that pg_rewind doesn't determine the timeline correctly
until the end-of-recovery checkpoint has completed. We probably should
fix that. But for now work around it by waiting for the checkpoint
to complete before running pg_rewind, like we did in commit 484a848a73.

In the passing, tidy up the new test a little bit. Rerder the INSERTs so
that the comments make more sense, remove a spurious CHECKPOINT call after
pg_rewind has already run, and add --debug option, so that if this fails
again, we'll have more data.

Per buildfarm failure at https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=rorqual&dt=2020-12-06%2018%3A32%3A19&stg=pg_rewind-check.
Backpatch to all supported versions.

Discussion: https://www.postgresql.org/message-id/1713707e-e318-761c-d287-5b6a4aa807e8@iki.fi
2020-12-07 14:55:27 +02:00
..
initdb Translation updates 2020-11-09 12:47:52 +01:00
pg_archivecleanup Fix new warnings from GCC 7 2017-05-16 08:52:39 -04:00
pg_basebackup Translation updates 2020-11-09 12:47:52 +01:00
pg_config Translation updates 2020-11-09 12:47:52 +01:00
pg_controldata Translation updates 2020-08-10 15:34:18 +02:00
pg_ctl Translation updates 2020-11-09 12:47:52 +01:00
pg_dump Translation updates 2020-11-09 12:47:52 +01:00
pg_resetxlog Translation updates 2020-08-10 15:34:18 +02:00
pg_rewind Fix more race conditions in the newly-added pg_rewind test. 2020-12-07 14:55:27 +02:00
pg_test_fsync Switch pg_test_fsync to use binary mode on Windows 2020-07-16 15:53:09 +09:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd 2020-10-15 20:37:19 -04:00
pg_xlogdump pg_waldump: Fix --bkp-details to not issue spurious newlines for FPWs. 2019-10-29 22:54:36 -07:00
pgbench Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:23:03 -05:00
pgevent Update copyright for 2016 2016-01-02 13:33:40 -05:00
psql Fix recently-introduced breakage in psql's \connect command. 2020-11-29 15:22:04 -05:00
scripts Translation updates 2020-11-09 12:47:52 +01:00
Makefile Update copyright for 2016 2016-01-02 13:33:40 -05:00