summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile/rec_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_write.c')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index 67b43057c8a..a2a8a330c1d 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -1628,15 +1628,18 @@ __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)WT_ALIGN_NEAREST(
+ (a * (u_int)btree->split_pct) / 100, btree->allocsize);
/*
- * If the result of that calculation is the same as the allocation unit
- * (that happens if the maximum size is the same size as an allocation
- * unit, use a percentage of the maximum page size).
+ * Respect the configured split percentage if the calculated split
+ * size is either zero or a full page. The user has either configured
+ * an allocation size that matches the page size, or a split
+ * percentage that is close to zero or one hundred. Rounding is going
+ * to provide a worse outcome than having a split point that doesn't
+ * fall on an allocation size boundary in those cases.
*/
- if (split_size == btree->allocsize)
+ if (split_size == 0 || split_size == maxpagesize)
split_size = (uint32_t)((a * (u_int)btree->split_pct) / 100);
return (split_size);
@@ -2957,6 +2960,17 @@ skip_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,
+ "Reconciliation creating a page with %" PRIu32
+ " entries, memory footprint %" PRIu64
+ ", page count %" PRIu32 ", %s, split state: %d\n",
+ r->entries, r->page->memory_footprint, r->bnd_next,
+ 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));