Re: including backend ID in relpath of temp rels - updated patch - Mailing list pgsql-hackers

From Robert Haas
Subject Re: including backend ID in relpath of temp rels - updated patch
Date
Msg-id AANLkTik7xw5M62NUNSqXCLxVBrtQVs0CVEpXgR8MSaWn@mail.gmail.com
Whole thread Raw
In response to Re: including backend ID in relpath of temp rels - updated patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: including backend ID in relpath of temp rels - updated patch
Re: including backend ID in relpath of temp rels - updated patch
List pgsql-hackers
On Thu, Aug 12, 2010 at 2:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Thu, Aug 12, 2010 at 12:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Lastly, it bothers me that you've put in code to delete files belonging
>>> to temp rels during crash restart, without any code to clean up their
>>> catalog entries.  This will therefore lead to dangling pg_class
>>> references, with uncertain but probably not very nice consequences.
>
>> I thought about this pretty carefully, and I don't believe that there
>> are any unpleasant consequences.  The code that assigns relfilenode
>> numbers is pretty careful to check that the newly assigned value is
>> unused BOTH in pg_class and in the directory where the file will be
>> created, so there should be no danger of a number getting used over
>> again while the catalog entries remain.  Also, the drop-object code
>> doesn't mind that the physical storage doesn't exist; it's perfectly
>> happy with that situation.
>
> Well, okay, but I'd suggest adding comments to the drop-table code
> pointing out that it is now NECESSARY for it to not complain if the file
> isn't there.  This was never a design goal before, AFAIR --- the fact
> that it works like that is kind of accidental.  I am also pretty sure
> that there used to be at least warning messages for that case, which we
> would now not want.

That seems like a good idea.  I'll post an updated patch.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: including backend ID in relpath of temp rels - updated patch
Next
From: Tom Lane
Date:
Subject: Re: libpq and TOO MANY CONNECTIONS