postgresql/src
Heikki Linnakangas 6ba581cf11 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:50:20 +02:00
..
backend Fix missed step in removal of useless RESULT RTEs in the planner. 2020-12-05 16:16:13 -05:00
bin Fix more race conditions in the newly-added pg_rewind test. 2020-12-07 14:50:20 +02:00
common Change SHA2 implementation based on OpenSSL to use EVP digest routines 2020-12-04 10:49:23 +09:00
fe_utils Remove incorrect %s in string 2020-11-09 10:38:22 +01:00
include Change SHA2 implementation based on OpenSSL to use EVP digest routines 2020-12-04 10:49:23 +09:00
interfaces Move SHA2 routines to a new generic API layer for crypto hashes 2020-12-02 10:37:20 +09:00
makefiles
pl Don't use custom OID symbols in pg_type.dat, either. 2020-10-29 13:33:38 -04:00
port Remove ability to independently select random number generator 2020-11-20 13:57:33 +01:00
template On macOS, use -isysroot in link steps as well as compile steps. 2020-11-20 00:07:09 -05:00
test Fix missed step in removal of useless RESULT RTEs in the planner. 2020-12-05 16:16:13 -05:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools Change SHA2 implementation based on OpenSSL to use EVP digest routines 2020-12-04 10:49:23 +09:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib
nls-global.mk