Re: Failure while inserting parent tuple to B-tree is not fun - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Failure while inserting parent tuple to B-tree is not fun
Date
Msg-id 3673.1382469880@sss.pgh.pa.us
Whole thread Raw
In response to Re: Failure while inserting parent tuple to B-tree is not fun  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Failure while inserting parent tuple to B-tree is not fun  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: Failure while inserting parent tuple to B-tree is not fun  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2013-10-22 21:29:13 +0300, Heikki Linnakangas wrote:
>> We could put a critical section around the whole recursion that inserts the
>> downlinks, so that you would get a PANIC and the incomplete split mechanism
>> would fix it at recovery. But that would hardly be an improvement.

> For me this clearly *has* to be in a critical section with the current
> code. I had always assumed all multi-part actions would be.

No, that's hardly a good idea.  As Heikki says, that would amount to
converting an entirely foreseeable situation into a PANIC.

Note also that the problem might be persistent, eg if you're out of disk
space.  In that case, you'd just get the PANIC again at recovery, so now
not only have you crashed all your sessions but you have a database that
won't start up.

I wonder whether Heikki's approach could be used to remove the need for
the incomplete-split-fixup code altogether, thus eliminating a class of
recovery failure possibilities.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reasons not to like asprintf
Next
From: Dimitri Fontaine
Date:
Subject: Re: Location for external scripts for Extensions?