Re: Nasty VACUUM/bgwriter/segmentation bug

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Josh Berkus" <josh(at)agliodbs(dot)com>, <pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Nasty VACUUM/bgwriter/segmentation bug
Date: 2006-11-19 20:22:03
Message-ID: 4560BCEB.6050206@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Florian G. Pflug wrote:
> Joshua D. Drake wrote:
>> On Sun, 2006-11-19 at 11:28 -0800, Josh Berkus wrote:
>>> Tom,
>>>> Let's go with the easy fix. With regular 1GB segment size, having a few
>>>> empty files in the data directory isn't going to hurt anyone.
>>> No, but it will confuse DBAs ("What the heck are all these 0B
>>> files?"). Maybe we should add code to VACUUM to look for these empty
>>> file segments and unlink them if they haven't been touched in a while
>>> (say, a day?).
>>
>> I don't buy this argument. A smart DBA isn't going to do any such thing.
>> If you go around deleting unknown files you deserve everything you get.
>> Especially if you are in the middle of a PostgreSQL cluster tree.
>
> Couldn't some application trigger this problem regularly (Say, once a
> day while
> importing new data), and therefore create an ever increasing number of
> empty
> files that you can't get rid of without backup,reinit and restore?

No, the old empty files would get reused if the relation grows again.
And they would get deleted if you truncate or drop the relation.

> Maybe postgres could delete them during recovery?

Yes, though it would have to run not only when recovering from WAL, but
on normal startup as well. It would require sweeping through the data
directory, looking for the empty files, which would increase the startup
time a bit. We discussed a solution like that to find orphaned relation
files some time ago, which IMHO is a real problem, but that idea got
forgotten.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2006-11-19 20:28:49 Re: Nasty VACUUM/bgwriter/segmentation bug
Previous Message Florian G. Pflug 2006-11-19 20:10:56 Re: Nasty VACUUM/bgwriter/segmentation bug