summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-24 11:02:23 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-24 11:02:23 +0200
commit2f3afc09793da3a30f2878f34eda30a71060da7e (patch)
tree56741e1ebe6810d6d0246f1458845ab228a91e45 /src
parent3ed249b74133bc567a4efcfb90eb69d445097c1b (diff)
Remove dead code and add comments.
'cbuffer' variable was left over from an earlier version of the patch to rewrite the incomplete split handling.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/nbtree/nbtxlog.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c
index 665e60b7bd2..7e37a4ca58d 100644
--- a/src/backend/access/nbtree/nbtxlog.c
+++ b/src/backend/access/nbtree/nbtxlog.c
@@ -130,7 +130,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
{
xl_btree_insert *xlrec = (xl_btree_insert *) XLogRecGetData(record);
Buffer buffer;
- Buffer cbuffer = InvalidBuffer;
Page page;
char *datapos;
int datalen;
@@ -158,6 +157,15 @@ btree_xlog_insert(bool isleaf, bool ismeta,
datalen -= sizeof(xl_btree_metadata);
}
+ /*
+ * Insertion to an internal page finishes an incomplete split at the
+ * child level. Clear the incomplete-split flag in the child. Note:
+ * during normal operation, the child and parent pages are locked at the
+ * same time, so that clearing the flag and inserting the downlink appear
+ * atomic to other backends. We don't bother with that during replay,
+ * because readers don't care about the incomplete-split flag and there
+ * cannot be updates happening.
+ */
if (!isleaf)
{
if (record->xl_info & XLR_BKP_BLOCK(0))
@@ -194,9 +202,6 @@ btree_xlog_insert(bool isleaf, bool ismeta,
}
}
- if (BufferIsValid(cbuffer))
- UnlockReleaseBuffer(cbuffer);
-
/*
* Note: in normal operation, we'd update the metapage while still holding
* lock on the page we inserted into. But during replay it's not
@@ -273,7 +278,8 @@ btree_xlog_split(bool onleft, bool isroot,
/*
* Clear the incomplete split flag on the left sibling of the child page
- * this is a downlink for.
+ * this is a downlink for. (Like in btree_xlog_insert, this can be done
+ * before locking the other pages)
*/
if (!isleaf)
{