postgresql/src
Heikki Linnakangas d137b14c3c 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:25 +02:00
..
backend Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:28 -05:00
bin Fix more race conditions in the newly-added pg_rewind test. 2020-12-07 14:55:25 +02:00
common Replace use of sys_siglist[] with strsignal(). 2020-07-15 22:05:12 -04:00
fe_utils Fix translation of special characters in psql's LaTeX output modes. 2018-11-26 17:32:51 -05:00
include Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:28 -05:00
interfaces Stamp 10.15. 2020-11-09 17:29:52 -05:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
pl Translation updates 2020-11-09 12:42:39 +01:00
port Stamp 10.15. 2020-11-09 17:29:52 -05:00
template On macOS, use -isysroot in link steps as well as compile steps. 2020-11-20 00:58:26 -05:00
test Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:28 -05:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:24:17 -04:00
tools Sync our copy of the timezone library with IANA release tzcode2020c. 2020-10-16 21:40:16 -04:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Build src/test/isolation during "make" and "make install". 2017-11-22 20:18:52 -08:00
Makefile.global.in Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
Makefile.shlib makefile: use proper linker flags for C++ compiles 2020-03-31 22:26:11 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00