summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-10-13 17:03:42 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-10-13 17:03:42 +1100
commitd22f66daf97e88ec86144a2b9c60ccd215ee986d (patch)
tree817b5252f8c51035c12c29b6445d88540a251228
parentf1d85cad7d28532b54e8316a1197995f590c99b4 (diff)
downloadmongo-d22f66daf97e88ec86144a2b9c60ccd215ee986d.tar.gz
If restored a tombstone WT_UPDATE after splitting, calculate the correct size.
-rw-r--r--src/btree/row_modify.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/btree/row_modify.c b/src/btree/row_modify.c
index e3f3b72dc39..8d54f0f402c 100644
--- a/src/btree/row_modify.c
+++ b/src/btree/row_modify.c
@@ -70,7 +70,9 @@ __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt,
/* Avoid WT_CURSOR.update data copy. */
cbt->modify_update = upd;
} else {
- upd_size = sizeof(WT_UPDATE) + upd->size;
+ upd_size = sizeof(WT_UPDATE) +
+ (WT_UPDATE_DELETED_ISSET(upd) ? 0 : upd->size);
+
/*
* We are restoring updates that couldn't be evicted,
* there should only be one update list per key.
@@ -139,7 +141,9 @@ __wt_row_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt,
/* Avoid WT_CURSOR.update data copy. */
cbt->modify_update = upd;
} else
- upd_size = sizeof(WT_UPDATE) + upd->size;
+ upd_size = sizeof(WT_UPDATE) +
+ (WT_UPDATE_DELETED_ISSET(upd) ? 0 : upd->size);
+
ins->upd = upd;
ins_size += upd_size;