From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)
Date: Sun, 15 Aug 2010 21:25:54 -0400
Message-ID: <10048.1281921954@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinOSX8-EUr4P7EkY_oqeWeCaC2NRAj+f2J8=KWH@mail.gmail.com>
References: <201008042147.o74LlCge057659@wwwmaster.postgresql.org>
<1280978913-sup-5475@alvh.no-ip.org>
<8B7319E089E48047A0B688CE9CF54FD855C3C916@USRES8MAIL.asg.com>
<1880.1281020817@sss.pgh.pa.us>
<3092.1281898690@sss.pgh.pa.us>
<AANLkTimcna8WUNfEGpAzpp5PEJ5pX+zP072NJXWTaN-D@mail.gmail.com>
<5884.1281908348@sss.pgh.pa.us>
<AANLkTinOSX8-EUr4P7EkY_oqeWeCaC2NRAj+f2J8=KWH@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> 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.
It doesn't matter: broken is broken, and failure to recover from a
truncate() error is broken. You mustn't think that this is a
Windows-only problem.
> 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.
... and PANIC is absolutely, entirely, 100% unacceptable here. I don't
think you understand the context. We've already written the truncate
action to WAL (as we must: WAL before data change). If we PANIC, that
means we'll PANIC again during WAL replay. So that solution means a
down, and perhaps unrecoverably broken, database. There's also the
little problem that "zero the page" is only a safe recovery action for
heap pages not index pages; smgrtruncate is certainly not entitled to
assume its working on a heap.
I think the performance argument is based on fear not facts anyway.
In practice, in modern installations, you're only going to be talking
about marginally more work in autovacuum. ISTM we should fix the bug,
in a simple/reliable/backpatchable way, and then anyone who's worried
about performance can measure the size of the problem, and try to
think of a workable solution if he doesn't like the results.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)
In-Reply-To: <10048.1281921954@sss.pgh.pa.us>
References: <201008042147.o74LlCge057659@wwwmaster.postgresql.org> <1280978913-sup-5475@alvh.no-ip.org> <8B7319E089E48047A0B688CE9CF54FD855C3C916@USRES8MAIL.asg.com> <1880.1281020817@sss.pgh.pa.us> <3092.1281898690@sss.pgh.pa.us> <AANLkTimcna8WUNfEGpAzpp5PEJ5pX+zP072NJXWTaN-D@mail.gmail.com> <5884.1281908348@sss.pgh.pa.us> <AANLkTinOSX8-EUr4P7EkY_oqeWeCaC2NRAj+f2J8=KWH@mail.gmail.com> <10048.1281921954@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox