Re: Function to promote standby servers

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Function to promote standby servers
Дата
Msg-id 20181022233121.GB1651@paquier.xyz
обсуждение исходный текст
Ответ на Re: Function to promote standby servers  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Function to promote standby servers
Список pgsql-hackers
On Mon, Oct 22, 2018 at 11:45:30AM +0200, Laurenz Albe wrote:
> Masahiko Sawada wrote:
>> Thank you for workig on this. There is one review comment for the latest patch.
>>
>> +     if (FreeFile(promote_file))
>> +               ereport(ERROR,
>> +                               (errcode_for_file_access(),
>> +                                errmsg("could not write file \"%s\": %m",
>> +                                               PROMOTE_SIGNAL_FILE)));
>>
>> Maybe we should unlink PROMOTE_SIGNAL_FILE before erroring.
>
> Yes, that cannot hurt.

If FreeFile() fails, unlink() would most likely fail for the same
reason.  Please note that if unlink() happens before issuing the ERROR,
saving errno would be necessary.  That's not a huge issue anyway, if a
failure happens, the operator would retry the operation.  If there is a
crash, the file gets removed at the end of recovery.  If there are no
objections, I'll look at this patch again by the end of this week in
order to get it committed.
--
Michael

Вложения

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

Предыдущее
От: Krzysztof Nienartowicz
Дата:
Сообщение: Re: Speeding up INSERTs and UPDATEs to partitioned tables
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: removing unnecessary get_att*() lsyscache functions