Re: Calling PrepareTempTablespaces in BufFileCreateTemp - Mailing list pgsql-hackers

From Ashwin Agrawal
Subject Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Date
Msg-id CALfoeisJU5SJ-9GWvr7XyqgMpe16y8r0cpLNW-SLDw8E0ho6-w@mail.gmail.com
Whole thread Raw
In response to Re: Calling PrepareTempTablespaces in BufFileCreateTemp  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Calling PrepareTempTablespaces in BufFileCreateTemp
List pgsql-hackers

On Thu, Apr 25, 2019 at 9:45 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
However, by that argument we should change all 3 of these functions to
set up the data.  If we're eating the layering violation to the extent
of letting OpenTemporaryFile call into commands/tablespace, then there's
little reason for the other 2 not to do likewise.

I agree to that point, same logic should be used for all three calls irrespective of the approach we pick.

I still remain concerned that invoking catalog lookups from fd.c is a darn
bad idea, even if we have a fallback for it to work (for some value of
"work") in non-transactional states.  It's not really hard to envision
that kind of thing leading to infinite recursion.  I think it's safe
right now, because catalog fetches shouldn't lead to any temp-file
access, but that's sort of a rickety assumption isn't it?

Is there (easy) way to assert for that assumption? If yes, then can add the same and make it not rickety.

Though I agree any exceptions/violations coded generally bites in long run somewhere later.

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs
Next
From: Alexander Korotkov
Date:
Subject: Re: jsonpath