diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/evict/evict_lru.c')
-rw-r--r-- | src/third_party/wiredtiger/src/evict/evict_lru.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c index 0488f2346f6..0bfaf1c9f33 100644 --- a/src/third_party/wiredtiger/src/evict/evict_lru.c +++ b/src/third_party/wiredtiger/src/evict/evict_lru.c @@ -285,7 +285,7 @@ __wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread) * busy and then opens a different file (in this case, the HS file), it can deadlock with a * thread waiting for the first file to drain from the eviction queue. See WT-5946 for details. */ - WT_RET(__wt_curhs_cache(session)); + WT_ERR(__wt_curhs_cache(session)); if (conn->evict_server_running && __wt_spin_trylock(session, &cache->evict_pass_lock) == 0) { /* * Cannot use WT_WITH_PASS_LOCK because this is a try lock. Fix when that is supported. We @@ -349,10 +349,11 @@ __wt_evict_thread_stop(WT_SESSION_IMPL *session, WT_THREAD *thread) WT_WITH_PASS_LOCK(session, ret = __evict_clear_all_walks(session)); WT_ERR(ret); /* - * The only two cases when the eviction server is expected to stop are when recovery is finished - * or when the connection is closing. + * The only cases when the eviction server is expected to stop are when recovery is finished, + * when the connection is closing or when an error has occurred and connection panic flag is + * set. */ - WT_ASSERT(session, F_ISSET(conn, WT_CONN_CLOSING | WT_CONN_RECOVERING)); + WT_ASSERT(session, F_ISSET(conn, WT_CONN_CLOSING | WT_CONN_PANIC | WT_CONN_RECOVERING)); /* Clear the eviction thread session flag. */ F_CLR(session, WT_SESSION_EVICTION); @@ -2046,9 +2047,14 @@ fast: */ if (pages_queued < target_pages / 2 && !urgent_queued) btree->evict_walk_period = WT_MIN(WT_MAX(1, 2 * btree->evict_walk_period), 100); - else if (pages_queued == target_pages) + else if (pages_queued == target_pages) { btree->evict_walk_period = 0; - else if (btree->evict_walk_period > 0) + /* + * If there's a chance the Btree was fully evicted, update the evicted flag in the handle. + */ + if (__wt_btree_bytes_evictable(session) == 0) + F_SET(session->dhandle, WT_DHANDLE_EVICTED); + } else if (btree->evict_walk_period > 0) btree->evict_walk_period /= 2; /* |