Re: Standby trying "restore_command" before local WAL

Поиск
Список
Период
Сортировка
От David Steele
Тема Re: Standby trying "restore_command" before local WAL
Дата
Msg-id ad9b3807-de4c-782a-4255-6153ea0c139f@pgmasters.net
обсуждение исходный текст
Ответ на Re: Standby trying "restore_command" before local WAL  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: Standby trying "restore_command" before local WAL
Список pgsql-hackers
On 8/7/18 12:05 PM, Stephen Frost wrote:
>>
>> All I'm saying is that (assuming my understanding of RestoreArchivedFile is
>> correct) we can't just do that in the current restore_command. We do need a
>> way to ask the archive for some metadata/checksums, and restore_command is
>> too late.
> 
> Yeah, I see what you mean there.  An alternative might be to *not*
> unlink the file, in case the restore command wants to check if it's
> valid and matches what's in the archive, and instead restore the
> requested file somewhere else and then perform an unlink/mv after
> the restore command has been run.
I don't see any cases (in master, at least) where RestoredArchivedFile()
would unlink an existing WAL segment.  If you look at the call sites
they all pass "RECOVERYHISTORY" or "RECOVERYXLOG"  to the recovername
parameter.

RestoreArchivedFile() does overwrite the existing file after we decide
that we prefer the restored version over the one in pg_wal, but that
happens after restore_command returns.

So as far as I can see, it could be possible for the restore_command to
do something clever here.

Regards,
-- 
-David
david@pgmasters.net


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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: Standby trying "restore_command" before local WAL
Следующее
От: Isaac Morland
Дата:
Сообщение: Re: Facility for detecting insecure object naming