aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-04-01 22:45:10 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-04-01 22:49:47 +0300
commit8bbbcb91bae1489471d11fef269533bc4df2f766 (patch)
tree4347d4d192b152b73b693326e142ed037ad50fe8 /src
parent6eff0accfe6b6170d10b91df769ea523b50927b8 (diff)
downloadpostgresql-8bbbcb91bae1489471d11fef269533bc4df2f766.tar.gz
postgresql-8bbbcb91bae1489471d11fef269533bc4df2f766.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/gin/ginbtree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/access/gin/ginbtree.c b/src/backend/access/gin/ginbtree.c
index a133a34e8d5..9b0f82fc904 100644
--- a/src/backend/access/gin/ginbtree.c
+++ b/src/backend/access/gin/ginbtree.c
@@ -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();