Re: [Patch] Make pg_checksums skip foreign tablespace directories

From: David Steele <david(at)pgmasters(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, michael(dot)banck(at)credativ(dot)de, pgsql-hackers(at)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: [Patch] Make pg_checksums skip foreign tablespace directories
Date: 2020-02-21 13:13:34
Message-ID: 498eb329-19a6-14bc-cd75-39187d7bc1fb@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael,

On 2/20/20 11:07 PM, Michael Paquier wrote:
> On Thu, Feb 20, 2020 at 07:37:15AM -0600, David Steele wrote:
>> But since the name includes the backend's pid you would need to get
lucky
>> and have a new backend with the same pid create the file after a
restart. I
>> tried it and the old temp file was left behind after restart and first
>> connection to the database.
>>
>> I doubt this is a big issue in the field, but it seems like it would
be nice
>> to do something about it.
>
> The natural area to do that would be around ResetUnloggedRelations().
> Still that would require combine both operations to not do any
> unnecessary lookups at the data folder paths.

Yeah, that's what I was thinking as well, since there is already a
directory scan there and doing the check would be very cheap. It's not
obvious how to combine these in the right way without moving a lot of
code around to non-obvious places.

One solution might be to have each subsystem register a function that
does checks/cleanup as each path/file is found in a common scan
function. That's a pretty major rework though, and I doubt there would
be much appetite for it to solve such a minor problem.

>> I'm not excited about the amount of code duplication between these three
>> tools. I know this was because of back-patching various issues in
the past,
>> but I really think we need to unify these data structures/functions
in HEAD.
>
> The lists are duplicated because we have never really figured out how
> to combine this code in one place. The idea was to have all the data
> folder path logic and the lists within one header shared between the
> frontend and backend but there was not much support for that on HEAD.

Do you have the thread? I'd like to see what was proposed and what the
objections were.

Regards,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2020-02-21 13:18:51 Re: [Patch] Make pg_checksums skip foreign tablespace directories
Previous Message Juan José Santamaría Flecha 2020-02-21 13:02:40 Re: False failure during repeated windows build.