summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-09-03 00:34:20 +1000
committersueloverso <sue@mongodb.com>2016-09-02 10:34:20 -0400
commitfa0b203b79d181e56fa73696ce744cbaf90a3c40 (patch)
treed4e70a4ae635ec51a0b4e2177192e24c44193a37 /src
parenta2ac6fc18aab97ccb08cb2d658669f7a01a52db8 (diff)
downloadmongo-fa0b203b79d181e56fa73696ce744cbaf90a3c40.tar.gz
WT-2872 Ensure tests with tiny caches don't get stuck due to the dirty trigger. (#3017)
Diffstat (limited to 'src')
-rw-r--r--src/btree/bt_handle.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c
index 02580bca4a8..9591023e163 100644
--- a/src/btree/bt_handle.c
+++ b/src/btree/bt_handle.c
@@ -688,18 +688,21 @@ __btree_page_sizes(WT_SESSION_IMPL *session)
/*
* Don't let pages grow large compared to the cache size or we can end
- * up in a situation where nothing can be evicted. Take care getting
- * the cache size: with a shared cache, it may not have been set.
- * Don't forget to update the API documentation if you alter the
- * bounds for any of the parameters here.
+ * up in a situation where nothing can be evicted. Make sure at least
+ * 10 pages fit in cache when it is at the dirty trigger where threads
+ * stall.
+ *
+ * Take care getting the cache size: with a shared cache, it may not
+ * have been set. Don't forget to update the API documentation if you
+ * alter the bounds for any of the parameters here.
*/
WT_RET(__wt_config_gets(session, cfg, "memory_page_max", &cval));
btree->maxmempage = (uint64_t)cval.val;
- if (!F_ISSET(conn, WT_CONN_CACHE_POOL)) {
- if ((cache_size = conn->cache_size) > 0)
- btree->maxmempage =
- WT_MIN(btree->maxmempage, cache_size / 10);
- }
+ if (!F_ISSET(conn, WT_CONN_CACHE_POOL) &&
+ (cache_size = conn->cache_size) > 0)
+ btree->maxmempage = WT_MIN(btree->maxmempage,
+ (conn->cache->eviction_dirty_trigger * cache_size) / 1000);
+
/* Enforce a lower bound of a single disk leaf page */
btree->maxmempage = WT_MAX(btree->maxmempage, btree->maxleafpage);