Re: recovery_target_time and standby_mode

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: recovery_target_time and standby_mode
Date: 2014-11-06 02:15:17
Message-ID: 545AD9B5.1080307@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/05/2014 05:41 PM, Michael Paquier wrote:
> On Thu, Nov 6, 2014 at 10:00 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
>> On Thu, Nov 6, 2014 at 12:32 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>>> When the recovery_target_time is reached, switch to streaming
>>> replication and stay a standby.
>>
>> Then shouldn't he just not specify a recovert_target at all? That's
>> the default behaviour for standby_mode on, the whole point of
>> recovery_target is to specify when to stop recovery and leave standby
>> mode, no?
> Agreed with Greg, once a target recovery is switched the node gets out
> of recovery. What the user should have done here is not specify
> recovery_target_time in the standby's recovery.conf such as it follows
> the master through streaming.

What I'm pointing out is that you can't actually do that. You think you
can, but you can't.

Instead, what you need to do is:

1) Recover to target_time.
2) Pause
3) shut down the replica
4) replace recovery.conf with one which streams
5) restart replica

This is consistent behavior and makes sense when you think about it. So
I think what we need to do is clarify in the documentation covering
recovery_target and standby_mode that they are exclusive.

Hmmm. You know, I think this means we do have a bug. If
recovery_target_time and standby_mode are exclusive, we should error if
the user attempts to set them both.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-11-06 02:26:37 Re: group locking: incomplete patch, just for discussion
Previous Message Michael Paquier 2014-11-06 01:44:45 Re: recovery_target_time and standby_mode