pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix failure of archive recovery with recovery_min_apply_delay en
Date: Fri, 18 Oct 2019 13:36:26 +0000
Message-ID: <E1iLSQc-0008Ko-2z@gemulon.postgresql.org> (raw)

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9dfbf9a04398f8b9332d95e49037c530c4dda827

Modified Files
--------------
src/backend/access/transam/xlog.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1iLSQc-0008Ko-2z@gemulon.postgresql.org>
Permalink:  ../E1iLSQc-0008Ko-2z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iLSQc-0008Ko-2z@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Fix failure of archive recovery with recovery_min_apply_delay en
  In-Reply-To: <E1iLSQc-0008Ko-2z@gemulon.postgresql.org>
  References: <E1iLSQc-0008Ko-2z@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox