summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-01-22 02:46:20 +0000
committerAlex Gorrod <alexg@wiredtiger.com>2016-01-22 02:46:20 +0000
commit9a2fb774e9b83943f7590af1222b76512e0e7f92 (patch)
tree9a8a812134460745f50337533608dad58bcc2e54
parent8b0c0bd2822f3e453583e58e49719606ea3cf663 (diff)
downloadmongo-9a2fb774e9b83943f7590af1222b76512e0e7f92.tar.gz
WT-2130 Don't round the split_pct to an allocation size.
The value is passed in via the API, and rounding makes it likely we won't split as the user expects. Especially if the split percentage is high, when we'll likely round up to 100%.
-rw-r--r--src/reconcile/rec_write.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 332449027a9..0e25b4bde3c 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1889,8 +1889,7 @@ __wt_split_page_size(WT_BTREE *btree, uint32_t maxpagesize)
* we don't waste space when we write).
*/
a = maxpagesize; /* Don't overflow. */
- split_size = (uint32_t)
- WT_ALIGN((a * (u_int)btree->split_pct) / 100, btree->allocsize);
+ split_size = (uint32_t)((a * (u_int)btree->split_pct) / 100);
/*
* If the result of that calculation is the same as the allocation unit
@@ -3286,6 +3285,16 @@ supd_check_complete:
}
}
+ bnd->entries = r->entries;
+ /* Output a verbose message if we create a page without many entries */
+ if (WT_VERBOSE_ISSET(session, WT_VERB_SPLIT) && r->entries < 6)
+ WT_ERR(__wt_verbose(session, WT_VERB_SPLIT,
+ "Reconciling page with memory footprint %" PRIu64
+ ", %" PRIu32 " th page has"
+ " %" PRIu32 " entries, %s, split state: %d\n",
+ r->page->memory_footprint, r->bnd_next, r->entries,
+ F_ISSET(r, WT_EVICTING) ? "evict" : "checkpoint",
+ r->bnd_state));
WT_ERR(__wt_bt_write(session,
buf, addr, &addr_size, false, bnd->already_compressed));
WT_ERR(__wt_strndup(session, addr, addr_size, &bnd->addr.addr));