Fix "failed to re-find parent key" btree VACUUM failure by revising page

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 70ce5c908202ada7616f7afded8a91bbf2742471
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2006-11-01T19:43:17Z
Releases: 8.2.0
Fix "failed to re-find parent key" btree VACUUM failure by revising page
deletion code to avoid the case where an upper-level btree page remains "half
dead" for a significant period of time, and to block insertions into a key
range that is in process of being re-assigned to the right sibling of the
deleted page's parent.  This prevents the scenario reported by Ed L. wherein
index keys could become out-of-order in the grandparent index level.

Since this is a moderately invasive fix, I'm applying it only to HEAD.
The bug exists back to 7.4, but the back branches will get a different patch.

Files