diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-08-29 22:22:24 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-08-29 22:22:24 +1000 |
commit | 7d3c0f9f50862798270cf38663255202e5bcf3fd (patch) | |
tree | e3a9cf534da8ba6ea318cb88c0271a4c9dcbf01b /src | |
parent | 2566118fc68b0124187e806bed52eb7cdbcb1be0 (diff) | |
parent | 8b40b2f8051dd88044d1437d2fe483c5c92e72b5 (diff) | |
download | mongodb-3.3.12.tar.gz |
Merge branch 'develop' into mongodb-3.4mongodb-3.3.12
Diffstat (limited to 'src')
-rw-r--r-- | src/btree/bt_read.c | 7 | ||||
-rw-r--r-- | src/btree/bt_split.c | 8 | ||||
-rw-r--r-- | src/evict/evict_lru.c | 8 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c index fd9c371f8c3..b096fd432e9 100644 --- a/src/btree/bt_read.c +++ b/src/btree/bt_read.c @@ -327,6 +327,13 @@ __evict_force_check(WT_SESSION_IMPL *session, WT_REF *ref) if (__wt_hazard_count(session, page) > 1) return (false); + /* + * If we have already tried and the transaction state has not moved on, + * eviction is highly likely to fail. + */ + if (page->modify->last_oldest_id == __wt_txn_oldest_id(session)) + return (false); + if (page->memory_footprint < btree->maxmempage) return (__wt_leaf_page_can_split(session, page)); diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index 700c2f3b192..490e8aae788 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -2239,6 +2239,14 @@ __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi) WT_ERR(__split_multi_inmem(session, page, multi, new)); /* + * If the new page is modified, save the oldest ID from reconciliation + * to avoid repeatedly attempting eviction on the same page. + */ + if (new->page->modify != NULL) + new->page->modify->last_oldest_id = + page->modify->last_oldest_id; + + /* * The rewrite succeeded, we can no longer fail. * * Finalize the move, discarding moved update lists from the original diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 44031729e82..5a9f4dabb08 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -573,7 +573,7 @@ __evict_pass(WT_SESSION_IMPL *session) if (cache->evict_empty_score < WT_EVICT_EMPTY_SCORE_CUTOFF || (!WT_EVICT_HAS_WORKERS(session) && !__evict_queue_empty(cache->evict_urgent_queue))) - WT_RET_NOTFOUND_OK(__evict_lru_pages(session, true)); + WT_RET(__evict_lru_pages(session, true)); /* * If we're making progress, keep going; if we're not making @@ -801,12 +801,10 @@ __evict_lru_pages(WT_SESSION_IMPL *session, bool is_server) /* If a worker thread found the queue empty, pause. */ if (ret == WT_NOTFOUND && !is_server && - F_ISSET(S2C(session), WT_CONN_EVICTION_RUN)) { - ret = 0; + F_ISSET(S2C(session), WT_CONN_EVICTION_RUN)) __wt_cond_wait(session, conn->evict_threads.wait_cond, 10000); - } - return (ret); + return (ret == WT_NOTFOUND ? 0 : ret); } /* |