Thread: Re: [HACKERS] Aborted Transaction During Vacuum

Re: [HACKERS] Aborted Transaction During Vacuum

From
"G. Anthony Reina"
Date:
Tom and Oliver,
   I added the patch and re-built everything. No more problems with the
vacuum analyze (knock on wood since this is still Friday the 13th).
   Tom, does this patch address the problem you found in your
EndPortalAllocMode comments? I'm just wondering whether another patch
will be needed or if this one should cover the problem.

Thanks again for the help guys.
-Tony


Tom wrote:
> (a) vacuum.c does a CommitTransaction to commit its final table's
>   worth of fixes.

> (b) CommitTransaction calls EndPortalAllocMode.

> (c) vacuum calls vc_shutdown, which tries to remove pg_vlock,   and reports an error when the unlink() call fails.

> (d) during error cleanup, AbortTransaction is called.

> (e) AbortTransaction calls EndPortalAllocMode.  There has been no
>   intervening StartPortalAllocMode, so the portal's context stack
>    is empty.  EndPortalAllocMode tries to free a nonexistent memory
>   context (or, if you have asserts turned on, dies with an assert
>    failure).  Ka-boom.





Re: [HACKERS] Aborted Transaction During Vacuum

From
Tom Lane
Date:
"G. Anthony Reina" <reina@nsi.edu> writes:
>     Tom, does this patch address the problem you found in your
> EndPortalAllocMode comments? I'm just wondering whether another patch
> will be needed or if this one should cover the problem.

I think you need not worry.  EndPortalAllocMode has a bug that ought to
be fixed IMHO, but it's only triggered if an error is reported outside
of any transaction context, and there is darn little backend processing
that happens outside of any transaction context.  This vacuum shutdown
check might be the only such error, in fact.  In short, it's something
to clean up for 6.6, but I doubt it's worth issuing a 6.5 patch for.
        regards, tom lane