agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
recovery_target_action doesn't work for anything but shutdown
6+ messages / 4 participants
[nested] [flat]

* recovery_target_action doesn't work for anything but shutdown
@ 2015-03-12 14:52  Andres Freund <andres@2ndquadrant.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Andres Freund @ 2015-03-12 14:52 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org, Petr Jelinek <petr@2ndquadrant.com>; Simon Riggs <simon@2ndQuadrant.com>

Hi,

Unless I'm missing something recovery_target_action = promote/pause
don't work.

There's the following block of code in readRecoveryCommandFile():
	/*
	 * Override any inconsistent requests. Not that this is a change
	 * of behaviour in 9.5; prior to this we simply ignored a request
	 * to pause if hot_standby = off, which was surprising behaviour.
	 */
	if (recoveryTargetAction == RECOVERY_TARGET_ACTION_PAUSE &&
		recoveryTargetActionSet &&
		standbyState == STANDBY_DISABLED)
		recoveryTargetAction = RECOVERY_TARGET_ACTION_SHUTDOWN;

the problem is that when the recovery command file is read standbyState
will always still be STANDBY_DISABLED. Which makes sense, because we
can't even know we're in recovery before readRecoveryCommandFile().

I guess what you actually intended to test was StandbyModeRequested?

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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



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

* Re: recovery_target_action doesn't work for anything but shutdown
@ 2015-03-12 14:53  Andres Freund <andres@2ndquadrant.com>
  parent: Andres Freund <andres@2ndquadrant.com>
  0 siblings, 3 replies; 6+ messages in thread

From: Andres Freund @ 2015-03-12 14:53 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org, Petr Jelinek <petr@2ndquadrant.com>; Simon Riggs <simon@2ndQuadrant.com>

On 2015-03-12 15:52:02 +0100, Andres Freund wrote:
> I guess what you actually intended to test was StandbyModeRequested?

Err, EnableHotStandby.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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



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

* Re: recovery_target_action doesn't work for anything but shutdown
@ 2015-03-13 13:00  Michael Paquier <michael.paquier@gmail.com>
  parent: Andres Freund <andres@2ndquadrant.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2015-03-13 13:00 UTC (permalink / raw)
  To: Andres Freund <andres@2ndquadrant.com>; +Cc: pgsql-hackers; Petr Jelinek <petr@2ndquadrant.com>; Simon Riggs <simon@2ndquadrant.com>

On Thu, Mar 12, 2015 at 11:53 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2015-03-12 15:52:02 +0100, Andres Freund wrote:
>> I guess what you actually intended to test was StandbyModeRequested?
>
> Err, EnableHotStandby.

Indeed. Without !EnableHotStandby, a node in recovery would simply be
shut down even if a pause has been requested when hot_standby = on.
This goes as well in the sense of the comment.
-- 
Michael


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



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

* Re: recovery_target_action doesn't work for anything but shutdown
@ 2015-03-13 14:06  Petr Jelinek <petr@2ndquadrant.com>
  parent: Andres Freund <andres@2ndquadrant.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Petr Jelinek @ 2015-03-13 14:06 UTC (permalink / raw)
  To: Andres Freund <andres@2ndquadrant.com>; pgsql-hackers@postgresql.org, Simon Riggs <simon@2ndQuadrant.com>

On 12/03/15 15:53, Andres Freund wrote:
> On 2015-03-12 15:52:02 +0100, Andres Freund wrote:
>> I guess what you actually intended to test was StandbyModeRequested?
>
> Err, EnableHotStandby.
>

Yeah pause does not work currently. This change was made by committer 
and I think the intended change was to make it a little safer by 
silently changing to shutdown instead of silently changing to promote 
which is essentially what was happening before the patch.

But yes the check should have been against EnableHotStandby it seems.


-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


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



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

* Re: recovery_target_action doesn't work for anything but shutdown
@ 2015-03-13 14:15  Petr Jelinek <petr@2ndquadrant.com>
  parent: Petr Jelinek <petr@2ndquadrant.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Petr Jelinek @ 2015-03-13 14:15 UTC (permalink / raw)
  To: Andres Freund <andres@2ndquadrant.com>; pgsql-hackers@postgresql.org, Simon Riggs <simon@2ndQuadrant.com>

On 13/03/15 15:06, Petr Jelinek wrote:
> On 12/03/15 15:53, Andres Freund wrote:
>> On 2015-03-12 15:52:02 +0100, Andres Freund wrote:
>>> I guess what you actually intended to test was StandbyModeRequested?
>>
>> Err, EnableHotStandby.
>>
>
> Yeah pause does not work currently. This change was made by committer
>

Actually the code is from me, committer just requested the change, sorry.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


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



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

* Re: recovery_target_action doesn't work for anything but shutdown
@ 2015-05-21 04:57  Fujii Masao <masao.fujii@gmail.com>
  parent: Andres Freund <andres@2ndquadrant.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2015-05-21 04:57 UTC (permalink / raw)
  To: Andres Freund <andres@2ndquadrant.com>; +Cc: pgsql-hackers; Petr Jelinek <petr@2ndquadrant.com>; Simon Riggs <simon@2ndquadrant.com>

On Thu, Mar 12, 2015 at 11:53 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2015-03-12 15:52:02 +0100, Andres Freund wrote:
>> I guess what you actually intended to test was StandbyModeRequested?
>
> Err, EnableHotStandby.

Pushed the fix.

Regards,

-- 
Fujii Masao


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



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


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

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 14:52 recovery_target_action doesn't work for anything but shutdown Andres Freund <andres@2ndquadrant.com>
2015-03-12 14:53 ` Andres Freund <andres@2ndquadrant.com>
2015-03-13 13:00   ` Michael Paquier <michael.paquier@gmail.com>
2015-03-13 14:06   ` Petr Jelinek <petr@2ndquadrant.com>
2015-03-13 14:15     ` Petr Jelinek <petr@2ndquadrant.com>
2015-05-21 04:57   ` Fujii Masao <masao.fujii@gmail.com>

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