Commit 954523cd authored by Heikki Linnakangas's avatar Heikki Linnakangas

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.
parent f7534296
...@@ -910,6 +910,10 @@ _bt_insertonpg(Relation rel, ...@@ -910,6 +910,10 @@ _bt_insertonpg(Relation rel,
{ {
PageSetLSN(metapg, recptr); PageSetLSN(metapg, recptr);
} }
if (BufferIsValid(cbuf))
{
PageSetLSN(BufferGetPage(cbuf), recptr);
}
PageSetLSN(page, recptr); PageSetLSN(page, recptr);
} }
...@@ -1402,6 +1406,10 @@ _bt_split(Relation rel, Buffer buf, Buffer cbuf, OffsetNumber firstright, ...@@ -1402,6 +1406,10 @@ _bt_split(Relation rel, Buffer buf, Buffer cbuf, OffsetNumber firstright,
{ {
PageSetLSN(spage, recptr); PageSetLSN(spage, recptr);
} }
if (!isleaf)
{
PageSetLSN(BufferGetPage(cbuf), recptr);
}
} }
END_CRIT_SECTION(); END_CRIT_SECTION();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment