summaryrefslogtreecommitdiff
path: root/src/evict
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-08-25 14:44:50 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-08-25 14:44:50 -0400
commit417f5d55f71d527673bb6234ea37e375a40502c2 (patch)
treecba0fa042106ebf54c97c804a047a2882b3b457d /src/evict
parentd34e3e8ae5522f3434d2764ee6dae5b915c1c4c5 (diff)
parent55110bae04cd5c9d5dc639d8fbe4cd6a73926176 (diff)
downloadmongo-417f5d55f71d527673bb6234ea37e375a40502c2.tar.gz
Merge branch 'develop' into wt-1967-evict-any
Diffstat (limited to 'src/evict')
-rw-r--r--src/evict/evict_file.c21
-rw-r--r--src/evict/evict_lru.c17
2 files changed, 19 insertions, 19 deletions
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c
index da1faf836e4..35ff0e4329e 100644
--- a/src/evict/evict_file.c
+++ b/src/evict/evict_file.c
@@ -79,22 +79,21 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop)
WT_ERR(__wt_evict(session, ref, 1));
break;
case WT_SYNC_DISCARD:
- WT_ASSERT(session,
- __wt_page_can_evict(session, page, 0, NULL));
- __wt_evict_page_clean_update(session, ref, 1);
- break;
- case WT_SYNC_DISCARD_FORCE:
/*
- * Forced discard of the page, whether clean or dirty.
- * If we see a dirty page in a forced discard, clean
- * the page, both to keep statistics correct, and to
- * let the page-discard function assert no dirty page
- * is ever discarded.
+ * If we see a dirty page in a dead handle, clean the
+ * page, both to keep statistics correct, and to let
+ * the page-discard function assert no dirty page is
+ * ever discarded.
*/
- if (__wt_page_is_modified(page)) {
+ if (F_ISSET(session->dhandle, WT_DHANDLE_DEAD) &&
+ __wt_page_is_modified(page)) {
page->modify->write_gen = 0;
__wt_cache_dirty_decr(session, page);
}
+
+ WT_ASSERT(session,
+ F_ISSET(session->dhandle, WT_DHANDLE_DEAD) ||
+ __wt_page_can_evict(session, page, 0, NULL));
__wt_evict_page_clean_update(session, ref, 1);
break;
WT_ILLEGAL_VALUE_ERR(session);
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index d09e5281109..ca1d3726587 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -175,7 +175,7 @@ __evict_server(void *arg)
* otherwise we can block applications evicting large pages.
*/
if (!F_ISSET(cache, WT_CACHE_STUCK)) {
- WT_ERR(__evict_clear_walks(session));
+ WT_ERR(__evict_clear_all_walks(session));
/* Next time we wake up, reverse the sweep direction. */
cache->flags ^= WT_CACHE_WALK_REVERSE;
@@ -1251,14 +1251,15 @@ fast: /* If the page can't be evicted, give up. */
* If we happen to end up on the root page, clear it. We have to track
* hazard pointers, and the root page complicates that calculation.
*
- * Also clear the walk if we land on a page requiring forced eviction.
- * The eviction server may go to sleep, and we want this page evicted
- * as quickly as possible.
+ * If we land on a page requiring forced eviction, move on to the next
+ * page: we want this page evicted as quickly as possible.
*/
- if ((ref = btree->evict_ref) != NULL && (__wt_ref_is_root(ref) ||
- ref->page->read_gen == WT_READGEN_OLDEST)) {
- btree->evict_ref = NULL;
- WT_RET(__wt_page_release(session, ref, WT_READ_NO_EVICT));
+ if ((ref = btree->evict_ref) != NULL) {
+ if (__wt_ref_is_root(ref))
+ WT_RET(__evict_clear_walk(session));
+ else if (ref->page->read_gen == WT_READGEN_OLDEST)
+ WT_RET_NOTFOUND_OK(__wt_tree_walk(session,
+ &btree->evict_ref, &pages_walked, walk_flags));
}
WT_STAT_FAST_CONN_INCRV(session, cache_eviction_walk, pages_walked);