postgresql/src
Andres Freund a652b0c78c Fix (re-)starting from a basebackup taken off a standby after a failure.
When starting up from a basebackup taken off a standby extra logic has
to be applied to compute the point where the data directory is
consistent. Normal base backups use a WAL record for that purpose, but
that isn't possible on a standby.

That logic had a error check ensuring that the cluster's control file
indicates being in recovery. Unfortunately that check was too strict,
disregarding the fact that the control file could also indicate that
the cluster was shut down while in recovery.

That's possible when the a cluster starting from a basebackup is shut
down before the backup label has been removed. When everything goes
well that's a short window, but when either restore_command or
primary_conninfo isn't configured correctly the window can get much
wider. That's because inbetween reading and unlinking the label we
restore the last checkpoint from WAL which can need additional WAL.

To fix simply also allow starting when the control file indicates
"shutdown in recovery". There's nicer fixes imaginable, but they'd be
more invasive.

Backpatch to 9.2 where support for taking basebackups from standbys
was added.
2014-12-18 08:47:33 +01:00
..
backend Fix (re-)starting from a basebackup taken off a standby after a failure. 2014-12-18 08:47:33 +01:00
bin Fix another poorly worded error message. 2014-12-17 13:22:25 -05:00
include Fix off-by-one loop count in MapArrayTypeName, and get rid of static array. 2014-12-16 15:35:43 -05:00
interfaces Fix minor bugs in commit 30bf4689a9 et al. 2014-11-30 12:20:54 -05:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:46 -05:00
pl Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:02:18 -04:00
port Fix win32setlocale.c const-related warnings. 2014-11-02 21:44:34 -05:00
template Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
test Lock down regression testing temporary clusters on Windows. 2014-12-17 22:48:47 -05:00
timezone Update time zone data files to tzdata release 2014j. 2014-11-17 12:08:32 -05:00
tools Lock down regression testing temporary clusters on Windows. 2014-12-17 22:48:47 -05:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +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 Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes (v2)" 2013-10-07 22:37:26 -04:00
Makefile.shlib fix whitespace 2014-02-01 16:30:18 -05:00
nls-global.mk Lots of doc corrections. 2012-04-23 22:43:09 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00