Fix bug in the new GIN 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 and it needs to be marked dirty. The codepath for an insertion got
this right, but the case where the internal node is split because of
inserting the new downlink missed that.
This commit is contained in:
Heikki Linnakangas 2014-04-01 22:45:10 +03:00
parent 6eff0accfe
commit 8bbbcb91ba
1 changed files with 4 additions and 0 deletions

View File

@ -543,6 +543,8 @@ ginPlaceToPage(GinBtree btree, GinBtreeStack *stack,
MarkBufferDirty(rbuffer);
MarkBufferDirty(stack->buffer);
if (BufferIsValid(childbuf))
MarkBufferDirty(childbuf);
/*
* Restore the temporary copies over the real buffers. But don't free
@ -571,6 +573,8 @@ ginPlaceToPage(GinBtree btree, GinBtreeStack *stack,
PageSetLSN(BufferGetPage(rbuffer), recptr);
if (stack->parent == NULL)
PageSetLSN(BufferGetPage(lbuffer), recptr);
if (BufferIsValid(childbuf))
PageSetLSN(childpage, recptr);
}
END_CRIT_SECTION();