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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change pgarch_readyXlog() to return .history files first
Date: 2018-12-14 00:15:12
Message-ID: 20181214001512.GB2921@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-12-14 00:23:39 Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Previous Message Stephen Frost 2018-12-14 00:14:57 Re: [HACKERS] REINDEX CONCURRENTLY 2.0