Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 77fe2b6

Browse files
committed
Fix bug in new B-tree page deletion code.
When modifying a page, must hold an exclusive lock. A shared lock is obviously not good enough.
1 parent 7e30c18 commit 77fe2b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/nbtree/nbtpage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ _bt_lock_branch_parent(Relation rel, BlockNumber child, BTStack stack,
996996

997997
/* Locate the parent's downlink (updating the stack entry if needed) */
998998
ItemPointerSet(&(stack->bts_btentry.t_tid), child, P_HIKEY);
999-
pbuf = _bt_getstackbuf(rel, stack, BT_READ);
999+
pbuf = _bt_getstackbuf(rel, stack, BT_WRITE);
10001000
if (pbuf == InvalidBuffer)
10011001
elog(ERROR, "failed to re-find parent key in index \"%s\" for deletion target page %u",
10021002
RelationGetRelationName(rel), child);

0 commit comments

Comments
 (0)