Skip to content

Commit 954523c

Browse files
committed
Fix bug in the new B-tree incomplete-split code.
Inserting a downlink to an internal page clears the incomplete-split flag of the child's left sibling, so the left sibling's LSN also needs to be updated.
1 parent f753429 commit 954523c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/access/nbtree/nbtinsert.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,10 @@ _bt_insertonpg(Relation rel,
910910
{
911911
PageSetLSN(metapg, recptr);
912912
}
913+
if (BufferIsValid(cbuf))
914+
{
915+
PageSetLSN(BufferGetPage(cbuf), recptr);
916+
}
913917

914918
PageSetLSN(page, recptr);
915919
}
@@ -1402,6 +1406,10 @@ _bt_split(Relation rel, Buffer buf, Buffer cbuf, OffsetNumber firstright,
14021406
{
14031407
PageSetLSN(spage, recptr);
14041408
}
1409+
if (!isleaf)
1410+
{
1411+
PageSetLSN(BufferGetPage(cbuf), recptr);
1412+
}
14051413
}
14061414

14071415
END_CRIT_SECTION();

0 commit comments

Comments
 (0)