summaryrefslogtreecommitdiff
path: root/src/reconcile
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-02-03 13:55:52 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2016-02-03 13:55:52 +1100
commitbba822f810fe56603b6f826de0aa12818bb83d47 (patch)
treeb97a6665be15294acbf443545274548e4d5061e9 /src/reconcile
parent590e35722d6dcb5c4a05f32025fd0d99e5ea0796 (diff)
downloadmongo-bba822f810fe56603b6f826de0aa12818bb83d47.tar.gz
Change split percentage calculation to round to the nearest allocation size.
Rather than always rounding up to the next allocation size. Avoid rounding where it puts us at the start or end of the page size.
Diffstat (limited to 'src/reconcile')
-rw-r--r--src/reconcile/rec_write.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index f6521013ed9..2a37f0f8189 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1889,7 +1889,15 @@ __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)((a * (u_int)btree->split_pct) / 100);
+ split_size = (uint32_t)WT_ALIGN_NEAREST(
+ (a * (u_int)btree->split_pct) / 100, btree->allocsize);
+
+ /*
+ * Respect the configured split percentage if the calculated split
+ * size is either zero or a full page.
+ */
+ if (split_size == 0 || split_size == maxpagesize)
+ split_size = (uint32_t)((a * (u_int)btree->split_pct) / 100);
return (split_size);
}