Re: Change pgarch_readyXlog() to return .history files first

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Change pgarch_readyXlog() to return .history files first
Дата
Msg-id 20181214001512.GB2921@paquier.xyz
обсуждение исходный текст
Ответ на Change pgarch_readyXlog() to return .history files first  (David Steele <david@pgmasters.net>)
Ответы Re: Change pgarch_readyXlog() to return .history files first  (David Steele <david@pgmasters.net>)
Список pgsql-hackers
On Thu, Dec 13, 2018 at 11:53:53AM -0500, David Steele wrote:
> I also think we should consider back-patching this change.  It's hard to
> imagine that archive commands would have trouble with this reordering
> and the current ordering causes real pain in HA clusters.

I would like to hear opinion from other though if we should consider
that as an improvement or an actual bug fix.  Changing the order of the
files to map with what the startup process does when promoting does not
sound like a bug fix to me, still this is not really invasive, so we
could really consider it worth back-patching to reduce common pain from
users when it comes to timeline handling.

> -    if (!found)
> +    /* Is this a history file? */
> +        bool history = basenamelen >= sizeof(".history") &&
> +            strcmp(rlde->d_name + (basenamelen - sizeof(".history") + 1),
> +                   ".history.ready") == 0;

Or you could just use IsTLHistoryFileName here?

If one wants to simply check this code, you can just create dummy orphan
files in archive_status and see in which order they get removed.
--
Michael

Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] REINDEX CONCURRENTLY 2.0