Re: FlushRelationBuffers returned -2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FlushRelationBuffers returned -2
Date
Msg-id 18002.963932934@sss.pgh.pa.us
Whole thread Raw
In response to FlushRelationBuffers returned -2  (Magnus Hagander <mha@sollentuna.net>)
List pgsql-hackers
Magnus Hagander <mha@sollentuna.net> writes:
> I noticed my nightly vacuum process has started dying on a certain relation
> last night. When I try to vaccum verbose it, I get the following output.

> NOTICE:  FlushRelationBuffers(filelist, 310): block 0 is referenced (private
> 0, global 5)
> FATAL 1:  VACUUM (vc_repair_frag): FlushRelationBuffers returned -2

> Restarting the postmaster corrected the problem.

That's what I was about to suggest trying.  It sounds like something
crashed and left the buffer reference count incremented above zero for
one of the pages of the relation.  In fact, several somethings, five of
them to be exact.

Have you had any interesting backend crashes lately?  Are you doing
anything unusual with that table? It would seem that whatever is causing
this is at least moderately reproducible in your environment, since it's
happened more than once.  It'd be easier to track down if you could
identify what sequence of operations causes the buffer refcount to be
left incremented.

BTW, don't be afraid of the fact VACUUM aborts --- it's just being
paranoid about the possibility that someone else is using this table
that it's supposed to have an exclusive lock on.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Untrusted PL/Tcl?
Next
From: Magnus Hagander
Date:
Subject: RE: FlushRelationBuffers returned -2