Re: Nasty VACUUM/bgwriter/segmentation bug - Mailing list pgsql-hackers

From Bort, Paul
Subject Re: Nasty VACUUM/bgwriter/segmentation bug
Date
Msg-id DB106B1B5B8F734B8FF3E155A3A556C20548CF50@clemail1.tmwsystems.com
Whole thread Raw
In response to Nasty VACUUM/bgwriter/segmentation bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
>
> I think that the easiest fix might be to not remove no-longer-used
> segment files during a truncate, but simply reduce them to zero size
> rather than delete them.  Then any open file pointers aren't
> invalidated.  The only alternative I can see is to invent some new
> signaling mechanism to force closure of open files, but that seems
> ugly, complex, and perhaps subject to race conditions.
>

Setting the files to zero size seems to make sense all around, as when
the bgwriter wants to use one of those segments it can 'figure out' that
there's nothing in the file and it should start at offset zero.

Regards,
Paul Bort


pgsql-hackers by date:

Previous
From: Kai-Uwe Sattler
Date:
Subject: Re: [Fwd: Index Advisor]
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: Nasty VACUUM/bgwriter/segmentation bug