Re: Postmaster holding unlinked files for pg_largeobject table

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <kevin(dot)grittner(at)wicourts(dot)gov>, alexk <alexk(at)commandprompt(dot)com>, Alexander Shulgin <ash(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postmaster holding unlinked files for pg_largeobject table
Date: 2011-06-06 21:59:31
Message-ID: 1307395045-sup-3303@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Excerpts from Tom Lane's message of lun jun 06 12:49:46 -0400 2011:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:

> > Instead of closing them immediately, how about flagging the FD and
> > closing all the flagged FDs at the end of each query, or something
> > like that?
>
> Hmm, there's already a mechanism for closing "temp" FDs at the end of a
> query ... maybe blind writes could use temp-like FDs?

I don't think it can be made to work exactly like that. If I understand
correctly, the code involved here is the FlushBuffer() call that happens
during BufferAlloc(), and what we have at that point is a SMgrRelation;
we're several levels removed from actually being able to set the
FD_XACT_TEMPORARY flag which is what I think you're thinking of.

What I think would make some sense is to keep a list of SMgrRelations
that we opened during FlushBuffer that are foreign to the current
database, in the current ResourceOwner. That way, when the resowner is
destroyed, we would be able to smgrclose() them. This would only be
done when called by a backend, not bgwriter.

(I'm not really sure about requiring the buffer to belong to a relation
in another database, given the report that this is also a problem with
dropped tables. However, it certainly makes no sense to try to remember
*all* buffers.)

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-06-06 22:44:02 Re: How to log query's from servers ?
Previous Message Vibhor Kumar 2011-06-06 20:52:35 Re: EnterpriseDB-xDBReplicationServer java process on OS X.

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-06-06 22:05:59 Re: WALInsertLock tuning
Previous Message Darren Duncan 2011-06-06 21:42:22 Re: Range Types and extensions