summaryrefslogtreecommitdiff
path: root/src/reconcile
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-02-05 06:21:22 +0000
committerAlex Gorrod <alexg@wiredtiger.com>2015-02-05 06:21:22 +0000
commit5b557bb00056db67888f4f669e433c5620f27cdf (patch)
tree85b27a5def44d7b4f30bc4f0d5eae9cc574e5c82 /src/reconcile
parent733dc5d71a32a32417217b18b1796a0c3f0d3d98 (diff)
downloadmongo-5b557bb00056db67888f4f669e433c5620f27cdf.tar.gz
Fixup reconciliation now that I (think I) understand the code.
We need the SPLIT_MAX code to avoid adding an unnecessary split boundary, and generating small pages. Refs #1630
Diffstat (limited to 'src/reconcile')
-rw-r--r--src/reconcile/rec_write.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 315cb75208c..5564dd2303a 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1997,15 +1997,16 @@ __rec_split(WT_SESSION_IMPL *session, WT_RECONCILE *r, size_t next_len)
/*
* Set the space available to another split-size chunk, if we
- * have one. If we don't have room for another split chunk,
- * add whatever space remains in this page.
+ * have one. If we don't have room for another split chunk
+ * or we have exactly enough space for a split chunk
+ * add whatever space remains in this page and avoid creating
+ * another split boundary before fixing up.
*/
len = WT_PTRDIFF32(r->first_free, dsk);
- if (len + r->split_size <= r->page_size) {
+ if (len + r->split_size < r->page_size)
r->space_avail =
r->split_size - WT_PAGE_HEADER_BYTE_SIZE(btree);
- return (0);
- } else {
+ else {
r->bnd_state = SPLIT_MAX;
WT_ASSERT(session, r->page_size >=
(WT_PAGE_HEADER_BYTE_SIZE(btree) + len));
@@ -2024,7 +2025,7 @@ __rec_split(WT_SESSION_IMPL *session, WT_RECONCILE *r, size_t next_len)
*
* Cycle through the saved split-point information, writing the
* split chunks we have tracked. The underlying fixup function
- * sets the space available and other information, and copied
+ * sets the space available and other information, and copies
* any unwritten chunk of data to the beginning of the buffer.
*/
WT_RET(__rec_split_fixup(session, r));