diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-10-23 19:07:13 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-10-24 10:07:13 +1100 |
commit | fa029c290a19d67c5a376de3467273d132366515 (patch) | |
tree | 26133c6cdf6bfdd4c13009bbd48a6bbf8a35cabb /src/btree/bt_read.c | |
parent | 27b7bf6c0f4f1b5da42924409d932f9e57cccb25 (diff) | |
download | mongo-fa029c290a19d67c5a376de3467273d132366515.tar.gz |
WT-2954 Enable fast appends with small in-memory pages. (#3094)
Eviction tuning to help improve the workload
Diffstat (limited to 'src/btree/bt_read.c')
-rw-r--r-- | src/btree/bt_read.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c index 679f20bdac5..90188498535 100644 --- a/src/btree/bt_read.c +++ b/src/btree/bt_read.c @@ -327,25 +327,28 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) if (__wt_hazard_count(session, page) > 1) return (false); + /* If we can do an in-memory split, do it. */ + if (__wt_leaf_page_can_split(session, page)) + return (true); + if (page->memory_footprint < btree->maxmempage) + return (false); + + /* Bump the oldest ID, we're about to do some visibility checks. */ + WT_IGNORE_RET(__wt_txn_update_oldest(session, 0)); + /* * Allow some leeway if the transaction ID isn't moving forward since * it is unlikely eviction will be able to evict the page. Don't keep * skipping the page indefinitely or large records can lead to * extremely large memory footprints. */ - if (page->memory_footprint < btree->maxmempage && + if (page->modify->update_restored && page->modify->last_eviction_id == __wt_txn_oldest_id(session)) return (false); - if (page->memory_footprint < btree->maxmempage) - return (__wt_leaf_page_can_split(session, page)); - /* Trigger eviction on the next page release. */ __wt_page_evict_soon(session, ref); - /* Bump the oldest ID, we're about to do some visibility checks. */ - WT_IGNORE_RET(__wt_txn_update_oldest(session, 0)); - /* If eviction cannot succeed, don't try. */ return (__wt_page_can_evict(session, ref, NULL)); } |