Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)
Date: 2010-08-16 01:11:10
Message-ID: AANLkTinOSX8-EUr4P7EkY_oqeWeCaC2NRAj+f2J8=KWH@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sun, Aug 15, 2010 at 5:39 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Could we avoid this
>> altogether by allocating a new relfilenode on truncate?
>
> Then we'd have to copy all the data we *didn't* truncate, which is
> hardly likely to be a win.

Oh, sorry. I was thinking we were talking about complete truncation
rather than partial truncation. I'm still pretty unhappy with the
proposed fix, though, because it gives up performance in a broad range
of cases to cater to an extremely narrow failure case. Considering
the rarity of the proposed problem, are we sure that it isn't better
to adopt a solution like what Heikki proposed? If truncation fails,
try to zero the pages; if that also fails, PANIC. I'm really
reluctant to back-patch a performance regression. Perhaps, as Greg
Stark says, there are a variety of ways that this can happen - but
they're all pretty rare, and seem to require a fairly substantial
amount of broken-ness. If we're in a situation where we can't
reliably update our disk files, it seems optimistic to assume that
keeping on running is going to be a whole lot better than PANICing.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-08-16 01:12:48 Re: Unable to create serial column even with permissions
Previous Message Tom Lane 2010-08-15 21:59:06 Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-16 01:13:46 Re: patch: utf8_to_unicode (trivial)
Previous Message Tom Lane 2010-08-16 00:35:43 Re: PL/pgSQL EXECUTE '..' USING with unknown