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
da...@pgmasters.net