Re: pause recovery if pitr target not reached

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: pause recovery if pitr target not reached
Дата
Msg-id 89fdfec8edb303319a224e48920964b088ec6e65.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: pause recovery if pitr target not reached  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On Sat, 2019-10-19 at 21:45 +0200, Peter Eisentraut wrote:
> On 2019-09-17 13:23, Leif Gunnar Erlandsen wrote:
> > This patch allows PostgreSQL to pause recovery before PITR target is reached 
> > if recovery_target_time is specified.
> > 
> > Missing WAL's could then be restored from backup and applied on next restart.
> > 
> > Today PostgreSQL opens the database in read/write on a new timeline even when 
> > PITR tareg is not reached.
> 
> I think this idea is worth thinking about.  I don't think this should be
> specific to a time-based recovery target.  This could apply for example
> to a target xid as well.  Also, there should be a way to get the old
> behavior.  Perhaps this whole thing should be a new
> recovery_target_action, say, 'pause_unless_reached'.

+1 for pausing if end-of-logs is reached before the recovery target.

I don't think that we need to add a new "recovery_target_action" to
retain the old behavior, because I think that nobody ever wants that.
I'd say that this typically happens in two cases:

1. Someone forgot to archive the WAL segment that contains the target.
   In this case the proposed change will solve the problem.

2. Someone specified the recovery target wrong, e.g. used CET rather
   than CEST in the recovery target time, so that the recovery target
   was later than intended.
   In that case the only solution is to start recovery from scratch.

But perhaps there are use cases I didn't think of.

Yours,
Laurenz Albe




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: configure fails for perl check on CentOS8
Следующее
От: John W Higgins
Дата:
Сообщение: Re: jsonb_set() strictness considered harmful to data