Re: Change pgarch_readyXlog() to return .history files first - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Change pgarch_readyXlog() to return .history files first
Date
Msg-id 20181214001512.GB2921@paquier.xyz
Whole thread Raw
In response to Change pgarch_readyXlog() to return .history files first  (David Steele <david@pgmasters.net>)
Responses Re: Change pgarch_readyXlog() to return .history files first  (David Steele <david@pgmasters.net>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0