Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while
Date
Msg-id CAB7nPqTYS51+ySZTUi32QVz0o1zcLDV_bO1BAtCON-7HeZwkMQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while  (Greg Clough <greg@gclough.com>)
Responses Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while  (Greg Clough <greg@gclough.com>)
Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
On Mon, Dec 21, 2015 at 7:44 PM, Greg Clough <greg@gclough.com> wrote:
> I didn't see any response to this, and I do believe it's an actual
> PostgreSQL bug... or at least a case of undesirable undocumented behaviour.
>
> SHORT SUMMARY:  If you are using a Standby with recovery_min_apply_delay =
> 1h and you increase it to 24h, then your Standby will be unavailable for the
> next 23h.
>
> Could someone confirm my diagnosis?

When recovery_min_apply_delay is set, replay should wait for the delay
defined in the case of a COMMIT or COMMIT PREPARED record, and this
even if the minimum recovery point ensuring that standby is in a
consistent state on is not reached. In short, if there is a COMMIT
before the standby thinks that it has reached a consistent state to
allow read-only queries, which is what you are looking for, your
application won't be able to connect to the standby, and the feature
behaves correctly.

Depending on the use cases, it may be interesting to have a switch
allowing to not apply the delay should a consistent point not be
reached though...
--
Michael

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #13822: Slave terminated - WAL contains references to invalid page
Next
From: Tim Hutt
Date:
Subject: Re: BUG #13832: Syntax errors are extremely unfriendly