mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.144 2006/10/04 00:29:48 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.145 2006/11/01 19:43:17 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1337,8 +1337,8 @@ _bt_insert_parent(Relation rel,
|
||||
|
||||
/* Check for error only after writing children */
|
||||
if (pbuf == InvalidBuffer)
|
||||
elog(ERROR, "failed to re-find parent key in \"%s\"",
|
||||
RelationGetRelationName(rel));
|
||||
elog(ERROR, "failed to re-find parent key in \"%s\" for split pages %u/%u",
|
||||
RelationGetRelationName(rel), bknum, rbknum);
|
||||
|
||||
/* Recursively update the parent */
|
||||
_bt_insertonpg(rel, pbuf, stack->bts_parent,
|
||||
|
Reference in New Issue
Block a user