summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/evict/evict_lru.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-10-07 17:44:57 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-07 07:04:01 +0000
commit58971da1ef93435a9f62bf4708a81713def6e88c (patch)
treec75ff94f74016177b2eef5f82c76a7d79238e8a5 /src/third_party/wiredtiger/src/evict/evict_lru.c
parentcf4ce26ca21a836aa336313a4a10676ca91c3131 (diff)
downloadmongo-58971da1ef93435a9f62bf4708a81713def6e88c.tar.gz
Import wiredtiger: e8bf2e5fcb33197b73c7bb550742926f59e22218 from branch mongodb-4.4r4.4.10-rc0r4.4.10
ref: a9bd69a7ca..e8bf2e5fcb for: 4.4.10 WT-5270 Create wtperf script for evergreen WT-7169 Commit ts should not be lesser than the last durable ts in test_timestamp22.py WT-7392 Added evicted flag to dhandle for use by session sweep WT-7757 Skip obsolete leaf pages without having to read them WT-7924 Create a stress test for prefix search near key validation WT-7980 Create interface to "log:" cursor which switches log files before returning them WT-7992 Provide API to return the last key in a table regardless of visibility WT-8022 Verify WT_CURSOR.modify return values in format test program WT-8036 Added connection panic flag in two assert statements in wt_evict_thread_run and _wt_evict_thread_stop. WT-8048 Remove split_8 timing stress configuration WT-8055 Fix issue when compact quits when running at the same time as a checkpoint WT-8059 Add a check in salvage when no overflow items are found WT-8068 Improve __rollback_row_modify control flow WT-8069 Coverity analysis defect 120706: Redundant test WT-8070 Remove discrepancy between prefix_key and prefix_search WT-8078 Implement tiered storage local retention caching WT-8086 Create cpp test for prefix search near entries WT-8092 Prefix early exit when keys are present in the insert list WT-8101 Enable diagnostic mode for the CPP tests in evergreen WT-8115 Define macros only when necessary in cpp files WT-8119 Add targeted compact testing to the existing testing framework WT-8146 Stop the tracking component when a CPP test ends WT-8161 Reduce verbosity of CMake Evergreen smoke WT-8162 Refactor uses of SMOKE arg in 'define_c_test' helper WT-8164 Disable rollback_to_stable10 python test on Windows WT-8171 Implement a C style test in the CPP testing framework WT-8193 Wrong corner case in VLCS rollback-to-stable
Diffstat (limited to 'src/third_party/wiredtiger/src/evict/evict_lru.c')
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_lru.c18
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;
/*