pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: pgsql-hackers@postgresql.org, Petr Jelinek <petr@2ndquadrant.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Subject: recovery_target_action doesn't work for anything but shutdown
Date: Thu, 12 Mar 2015 15:52:02 +0100
Message-ID: <20150312145202.GD20199@awork2.anarazel.de> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (6+ messages)  latest in thread

Message-ID: <20150312145202.GD20199@awork2.anarazel.de>
Permalink:  ../20150312145202.GD20199@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20150312145202.GD20199@awork2.anarazel.de

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@2ndquadrant.com, petr@2ndquadrant.com, simon@2ndQuadrant.com
  Subject: Re: recovery_target_action doesn't work for anything but shutdown
  In-Reply-To: <20150312145202.GD20199@awork2.anarazel.de>

* 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