Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f34283

Browse files
Correct obsolete nbtree page split comment.
Commit40dae7e, which made the nbtree page split algorithm morerobust, made _bt_insert_parent() only unlock the right child of theparent page before inserting a new downlink into the parent. Update acomment from the Berkeley days claiming that both left and right childpages are unlocked before the new downlink actually gets inserted.The claim that it is okay to release both locks early based on Lehmanand Yao's say-so never made much sense. Lehman and Yao must sometimes"couple" buffer locks across a pair of internal pages when relocating adownlink, unlike the corresponding code within _bt_getstack().
1 parentf1d85aa commit3f34283

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/access/nbtree/nbtinsert.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,10 @@ _bt_insertonpg(Relation rel,
908908
*
909909
* We're ready to do the parent insertion. We need to hold onto the
910910
* locks for the child pages until we locate the parent, but we can
911-
* release them before doing the actual insertion (see Lehman and Yao
912-
* for the reasoning).
911+
* at least release the lock on the right child before doing the
912+
* actual insertion. The lock on the left child will be released
913+
* last of all by parent insertion, where it is the 'cbuf' of parent
914+
* page.
913915
*----------
914916
*/
915917
_bt_insert_parent(rel,buf,rbuf,stack,is_root,is_only);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp