Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 0B59F6326ED for ; Thu, 5 Aug 2010 17:29:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 15260-06 for ; Thu, 5 Aug 2010 20:29:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 04C6E632400 for ; Thu, 5 Aug 2010 17:29:32 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o75KTQ5Y029286; Thu, 5 Aug 2010 16:29:26 -0400 (EDT) To: Heikki Linnakangas cc: Alvaro Herrera , Hitesh Bhambhani , pgsql-bugs Subject: Re: BUG #5599: Vacuum fails due to index corruption issues In-reply-to: <4C5B1A44.1080504@enterprisedb.com> References: <201008042147.o74LlCge057659@wwwmaster.postgresql.org> <1280978913-sup-5475@alvh.no-ip.org> <8B7319E089E48047A0B688CE9CF54FD855C3C916@USRES8MAIL.asg.com> <1880.1281020817@sss.pgh.pa.us> <1281025234-sup-1704@alvh.no-ip.org> <16374.1281026184@sss.pgh.pa.us> <1281027356-sup-6865@alvh.no-ip.org> <23590.1281028781@sss.pgh.pa.us> <1281029938-sup-3072@alvh.no-ip.org> <25994.1281031275@sss.pgh.pa.us> <1281032780-sup-1394@alvh.no-ip.org> <4C5B1A44.1080504@enterprisedb.com> Comments: In-reply-to Heikki Linnakangas message dated "Thu, 05 Aug 2010 23:08:36 +0300" Date: Thu, 05 Aug 2010 16:29:26 -0400 Message-ID: <29285.1281040166@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/144 X-Sequence-Number: 27727 Heikki Linnakangas writes: > On 05/08/10 21:28, Alvaro Herrera wrote: >> Excerpts from Tom Lane's message of jue ago 05 14:01:15 -0400 2010: >>> Maybe write-the-buffers-first is a sufficient longterm solution. >> >> Yeah, perhaps it is, though it's a pity that a single platform problem >> is going to slow down everyone else. > How about performing the truncate as usual, but if it fails, fill the > truncated portion with zeros instead? This is blithely assuming that you're going to be able to do anything at all to the file after having failed to truncate it. The permissions problem might be persistent, or you might crash, or several other things. If we could do this safely, we could also do the original #3 solution (write the dirty buffers for the to-be-truncated block range only after failing to truncate). regards, tom lane