Re: smgrsettransient mechanism is full of bugs

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: smgrsettransient mechanism is full of bugs
Date: 2012-10-16 19:39:42
Message-ID: 20121016193941.GA10361@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> After further review, I have become convinced that in fact it's
> completely broken and needs to be redone from scratch. The temp-file
> marking at the fd.c level can easily get out of sync with the marking
> at the smgr level, and that marking isn't too consistent with reality
> either, which means we have all of the following problems:

Oops. Sorry about this. Fortunately, as far as I can see, it only
results in excessive resource consumption, not data corruption or loss.

> I believe that we probably ought to revert this mechanism entirely, and
> build a new implementation based on these concepts:
>
> * An SMgrRelation is transient if and only if it doesn't have an
> "owning" relcache entry. Keep a list of all such SmgrRelations, and
> close them all at transaction end. (Obviously, an SMgrRelation gets
> removed from the list if it acquires an owner mid-transaction.)
>
> * There's no such concept as FD_XACT_TRANSIENT at the fd.c level.
> Rather, we close and delete the VFD entry when told to by SmgrRelation
> closure.

Makes sense. It does seem simpler than the original approach.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2012-10-16 20:18:00 Re: embedded list
Previous Message Stafford, David x78061 2012-10-16 18:12:10 Re: Truncate if exists