Re: Recovery to backup point

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Recovery to backup point
Дата
Msg-id 52CEA83E.4080602@vmware.com
обсуждение исходный текст
Ответ на Re: Recovery to backup point  ("MauMau" <maumau307@gmail.com>)
Ответы Re: Recovery to backup point  ("MauMau" <maumau307@gmail.com>)
Re: Recovery to backup point  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 12/09/2013 03:05 PM, MauMau wrote:
> From: "Heikki Linnakangas" <hlinnakangas@vmware.com>
>> Thanks. Looks sane, although I don't much like the proposed interface
>> to trigger this, setting recovery_target_time='backup_point'. What the
>> code actually does is to stop recovery as soon as you reach
>> consistency, which might not have anything to do with a backup. If you
>> set it on a warm standby server, for example, it will end recovery as
>> soon as it reaches consistency, but there was probably no backup taken
>> at that point.
>
> Thank you for reviewing so rapidly.  I thought I would check the end of
> backup in recoveryStopsHere(), by matching XLOG_BACKUP_END and
> ControlFile->backupStartPoint for backups taken on the primary, and
> comparing the current redo location with ControlFile->backupEndPoint for
> backups taken on the standby.  However, that would duplicate much code
> in XLOG_BACKUP_END redo processing and checkRecoveryConsistency().
> Besides, the code works only when the user explicitly requests recovery
> to backup point, not when he starts the warm standby server.  (I wonder
> I'm answering correctly.)

I was thinking that you have a warm standby server, and you decide to
stop using it as a warm standby, and promote it. You'd do that by
stopping it, modifying recovery.conf to remove standby_mode, and set a
recovery target, and then restart.

After some refactoring and fixing bugs in the existing code, I came up
with the attached patch. I called the option simply "recovery_target",
with the only allowed value of "immediate". IOW, if you want to stop
recovery as early as possible, you add recovery_target='immediate' to
recovery.conf. Now that we have four different options to set the
recovery target with, I rearranged the docs slightly. How does this look
to you?

- Heikki

Вложения

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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: preproc.c compilation error
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Planning time in explain/explain analyze