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 20181221031921.GE1886@paquier.xyz
Whole thread Raw
In response to Re: Change pgarch_readyXlog() to return .history files first  (David Steele <david@pgmasters.net>)
Responses Re: Change pgarch_readyXlog() to return .history files first
List pgsql-hackers
On Thu, Dec 20, 2018 at 01:57:30PM +0200, David Steele wrote:
> Good point.  The new patch uses IsTLHistoryFileName().

OK, I have been reviewing the patch and the logic is correct, still I
could not resist reducing the number of inner if's for readability.  I
also did not like the high-jacking of rlde->d_name so instead let's use
an intermediate variable to store the basename of a scanned entry.  The
format of the if/elif with comments in-between was not really consistent
with the common practice as well.  pg_indent has also been applied.

> Ah, I see.  Yes, that's exactly how I tested it, in addition to doing real
> promotions.

OK, so am I doing.

Attached is an updated patch.  Does that look fine to you?  The base
logic is unchanged, and after a promotion history files get archived
before the last partial segment.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Macros bundling RELKIND_* conditions
Next
From: Edmund Horner
Date:
Subject: Re: Tid scan improvements