Re: Calling PrepareTempTablespaces in BufFileCreateTemp

From: Ashwin Agrawal <aagrawal(at)pivotal(dot)io>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Date: 2019-04-25 17:40:01
Message-ID: CALfoeisJU5SJ-9GWvr7XyqgMpe16y8r0cpLNW-SLDw8E0ho6-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 25, 2019 at 9:45 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-04-25 18:03:54 Re: jsonpath
Previous Message Robert Haas 2019-04-25 17:34:54 Re: POC: Cleaning up orphaned files using undo logs