Re: Re: [COMMITTERS] pgsql: Repair two places where SIGTERM exit couldleave shared memory - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Repair two places where SIGTERM exit couldleave shared memory
Date
Msg-id 20559.1208447321@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Repair two places where SIGTERM exit couldleave shared memory  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Re: [COMMITTERS] pgsql: Repair two places where SIGTERM exit couldleave shared memory  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> Is this so? This happened to me the other day (hence the question about
> having COPY note failure earlier) because the disk filled up. I was
> confused because du showed nothing. Eventually I did an lsof and found
> the postgres backend had a large number of open file handles to deleted
> files (each one gigabyte).

The backend, or the bgwriter?  Please be specific.

The bgwriter should drop open file references after the next checkpoint,
but I don't recall any forcing function for regular backends to close
open files.

8.3 and HEAD should ftruncate() the first segment of a relation but I
think they just unlink the rest.  Is it sane to think of ftruncate then
unlink on the non-first segments, to alleviate the disk-space issue when
someone else is holding the file open?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Repair two places where SIGTERM exit couldleave shared memory
Next
From: Tom Lane
Date:
Subject: Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout