postgresql/src
Fujii Masao 14c59185b2 Fix failure of archive recovery with recovery_min_apply_delay enabled.
recovery_min_apply_delay parameter is intended for use with streaming
replication deployments. However, the document clearly explains that
the parameter will be honored in all cases if it's specified. So it should
take effect even if in archive recovery. But, previously, archive recovery
with recovery_min_apply_delay enabled always failed, and caused assertion
failure if --enable-caasert is enabled.

The cause of this problem is that; the ownership of recoveryWakeupLatch
that recovery_min_apply_delay uses was taken only when standby mode
is requested. So unowned latch could be used in archive recovery, and
which caused the failure.

This commit changes recovery code so that the ownership of
recoveryWakeupLatch is taken even in archive recovery. Which prevents
archive recovery with recovery_min_apply_delay from failing.

Back-patch to v9.4 where recovery_min_apply_delay was added.

Author: Fujii Masao
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CAHGQGwEyD6HdZLfdWc+95g=VQFPR4zQL4n+yHxQgGEGjaSVheQ@mail.gmail.com
2019-10-18 22:35:52 +09:00
..
backend Fix failure of archive recovery with recovery_min_apply_delay enabled. 2019-10-18 22:35:52 +09:00
bin Handle corner cases correctly in psql's reconnection logic. 2019-09-02 14:02:46 -04:00
common Fix portability failure introduced in commits d2b0b60e7 et al. 2018-12-26 15:30:40 -05:00
include Selectively include window frames in expression walks/mutates. 2019-10-03 11:18:20 +01:00
interfaces Stamp 9.4.24. 2019-08-05 17:22:47 -04:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:43 -07:00
pl Fix C++ incompatibilities in plpgsql's header files. 2019-05-31 12:34:55 -04:00
port Stamp 9.4.24. 2019-08-05 17:22:47 -04:00
template AIX: Stop adding option -qsrcmsg. 2019-10-12 00:21:51 -07:00
test Fix bitshiftright()'s zero-padding some more. 2019-10-04 10:34:21 -04:00
timezone Update time zone data files to tzdata release 2019c. 2019-09-20 19:54:36 -04:00
tools Handle spaces in OpenSSL install location for MSVC 2019-10-04 15:38:36 -04:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04: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 Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Handle USE_MODULE_DB for all tests able to use an installed postmaster. 2019-04-03 17:10:42 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00