Re: could recovery_target_timeline=latest be the default in standby mode?

From: David Steele <david(at)pgmasters(dot)net>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Sergei Kornilov <sk(at)zsrv(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: could recovery_target_timeline=latest be the default in standby mode?
Date: 2018-12-27 16:36:23
Message-ID: 6759b48b-5623-b917-0bc8-c4402a3ca338@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/27/18 1:02 PM, Peter Eisentraut wrote:
> On 22/12/2018 00:38, Michael Paquier wrote:
>> On Fri, Dec 21, 2018 at 01:54:20PM +0300, Sergei Kornilov wrote:
>>> I am +1 for recovery_target_timeline=latest by default. This is
>>> common case in my opinion.
>>
>> I agree also that switching to the latest timeline should be the
>> default. People get confused because of the current default.
>
> How about this patch then?

I like the idea of defaulting to the latest timeline since this is what
you want to do most of the time, but I think we'd then need a value for
following the current timelime, i.e. the one that the backup was taken
on (which is the current default).

I also think that changing the behavior of this setting based on
standby_mode is going to be confusing. Recovering to the most recent
timeline is the general case whether setting up a standby or not.

Imagine the following case:

1) Primary fails
2) Switch to standby
3) Standby runs for a while but fails before the old primary is rebuilt
4) We recover a new primary from the most recent backup which is
probably on the old timeline, but we'd rather recover to the new
timeline established after the failover.

Or, we recover a cluster for reporting and promote it so we can create
temp tables. We'd also like that to be on the most recent timeline.

I would recommend:

1) Make the default for recovery_target_timeline always be latest.
2) Add a new value, current, that replicates the current behavior.

Regards,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2018-12-27 16:47:16 Re: Remove Deprecated Exclusive Backup Mode
Previous Message Daniel Verite 2018-12-27 16:24:50 Re: Alternative to \copy in psql modelled after \g