Re: "ERROR: could not read block 6 ...: read only 0 of 8192 bytes" after autovacuum cancelled

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "ERROR: could not read block 6 ...: read only 0 of 8192 bytes" after autovacuum cancelled
Date: 2009-11-06 17:18:15
Message-ID: 20091106171814.GG3840@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > Tom Lane wrote:
> >> I would argue that once we've truncated, it's too late to abort. The
> >> interrupt facility should be disabled from just before issuing the
> >> truncate till after commit. It would probably be relatively painless to
> >> do that with some manipulation of the interrupt holdoff stuff.
>
> > That cures my (admittedly simplistic) testcase. The patch is a bit ugly
> > because the interrupts are held off in lazy_vacuum_rel and need to be
> > released by its caller. I don't see any other way around the problem
> > though.
>
> I wonder whether we shouldn't extend this into VACUUM FULL too, to
> prevent cancel once it's done that internal commit. It would fix
> the "PANIC: can't abort a committed transaction" problem V.F. has.

Hmm, it seems to work. The attached is for 8.1.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Attachment Content-Type Size
vactrunc-nointerrupt-2-81.patch text/x-diff 9.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-06 17:36:22 Re: "ERROR: could not read block 6 ...: read only 0 of 8192 bytes" after autovacuum cancelled
Previous Message abindra 2009-11-06 16:30:03 Re: Freebsd & autoconf-2.63