@@ -1628,15 +1628,18 @@ __wt_split_page_size(WT_BTREE *btree, uint32_t maxpagesize)
16281628 * we don't waste space when we write).
16291629 */
16301630 a = maxpagesize ; /* Don't overflow. */
1631- split_size = (uint32_t )
1632- WT_ALIGN ( (a * (u_int )btree -> split_pct ) / 100 , btree -> allocsize );
1631+ split_size = (uint32_t )WT_ALIGN_NEAREST (
1632+ (a * (u_int )btree -> split_pct ) / 100 , btree -> allocsize );
16331633
16341634 /*
1635- * If the result of that calculation is the same as the allocation unit
1636- * (that happens if the maximum size is the same size as an allocation
1637- * unit, use a percentage of the maximum page size).
1635+ * Respect the configured split percentage if the calculated split
1636+ * size is either zero or a full page. The user has either configured
1637+ * an allocation size that matches the page size, or a split
1638+ * percentage that is close to zero or one hundred. Rounding is going
1639+ * to provide a worse outcome than having a split point that doesn't
1640+ * fall on an allocation size boundary in those cases.
16381641 */
1639- if (split_size == btree -> allocsize )
1642+ if (split_size == 0 || split_size == maxpagesize )
16401643 split_size = (uint32_t )((a * (u_int )btree -> split_pct ) / 100 );
16411644
16421645 return (split_size );
@@ -2957,6 +2960,17 @@ __rec_split_write(WT_SESSION_IMPL *session,
29572960 }
29582961 }
29592962
2963+ bnd -> entries = r -> entries ;
2964+ /* Output a verbose message if we create a page without many entries */
2965+ if (WT_VERBOSE_ISSET (session , WT_VERB_SPLIT ) && r -> entries < 6 )
2966+ WT_ERR (__wt_verbose (session , WT_VERB_SPLIT ,
2967+ "Reconciliation creating a page with %" PRIu32
2968+ " entries, memory footprint %" PRIu64
2969+ ", page count %" PRIu32 ", %s, split state: %d\n" ,
2970+ r -> entries , r -> page -> memory_footprint , r -> bnd_next ,
2971+ F_ISSET (r , WT_EVICTING ) ? "evict" : "checkpoint" ,
2972+ r -> bnd_state ));
2973+
29602974 WT_ERR (__wt_bt_write (session ,
29612975 buf , addr , & addr_size , false, bnd -> already_compressed ));
29622976 WT_ERR (__wt_strndup (session , addr , addr_size , & bnd -> addr .addr ));
0 commit comments