pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Make recovery_target_action = pause work.
2+ messages / 2 participants
[nested] [flat]

* pgsql: Make recovery_target_action = pause work.
@ 2015-05-21 04:57  Fujii Masao <fujii@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Fujii Masao @ 2015-05-21 04:57 UTC (permalink / raw)
  To: pgsql-committers

Make recovery_target_action = pause work.

Previously even if recovery_target_action was set to pause and
the recovery target was reached, the recovery could never be paused.
Because the setting of pause was *always* overridden with that of
shutdown unexpectedly. This override is valid and intentional
if hot_standby is not enabled because there is no way to resume
the paused recovery in this case and the setting of pause is
completely useless. But not if hot_standby is enabled.

This patch changes the code so that the setting of pause is overridden
with that of shutdown only when hot_standby is not enabled.

Bug reported by Andres Freund

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/85d0e661aae656d3ec710dab24f883c4b4ef90da

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


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Make recovery_target_action = pause work.
@ 2015-05-21 16:25  Simon Riggs <simon@2ndQuadrant.com>
  parent: Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Simon Riggs @ 2015-05-21 16:25 UTC (permalink / raw)
  To: Fujii Masao <fujii@postgresql.org>; +Cc: pgsql-committers

On 21 May 2015 at 00:57, Fujii Masao <fujii@postgresql.org> wrote:

> Make recovery_target_action = pause work.
>
> Previously even if recovery_target_action was set to pause and
> the recovery target was reached, the recovery could never be paused.
> Because the setting of pause was *always* overridden with that of
> shutdown unexpectedly. This override is valid and intentional
> if hot_standby is not enabled because there is no way to resume
> the paused recovery in this case and the setting of pause is
> completely useless. But not if hot_standby is enabled.
>
> This patch changes the code so that the setting of pause is overridden
> with that of shutdown only when hot_standby is not enabled.
>
> Bug reported by Andres Freund
>

Note for archives: this is a bug, not a change in behaviour.

The original coding of standbyState == STANDBY_DISABLED
wasn't correct because standbyState > STANDBY_DISABLED only after we run
InitRecoveryTransactionEnvironment() which happens later than this
parameter check.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-05-21 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 04:57 pgsql: Make recovery_target_action = pause work. Fujii Masao <fujii@postgresql.org>
2015-05-21 16:25 ` Simon Riggs <simon@2ndQuadrant.com>

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