diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-18 12:39:22 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-18 12:39:22 +1000 |
commit | 0661c0bff0e1fa7c5751397114b85cfa579a41a7 (patch) | |
tree | 59edf7c2ed4b9356ee053db4b19deb5beca7deed /src | |
parent | 08e884609d9be6bcff8bb580e3ce85ef2b5a6b5d (diff) | |
download | mongo-0661c0bff0e1fa7c5751397114b85cfa579a41a7.tar.gz |
WT-2066 Update the oldest transaction ID from eviction
(cherry picked from commit 05015655982f6a5312559420e44452032186ba09)
Diffstat (limited to 'src')
-rw-r--r-- | src/evict/evict_lru.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 6876e41d71f..4dd63d09e0b 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -478,6 +478,18 @@ __evict_pass(WT_SESSION_IMPL *session) */ __wt_cache_read_gen_incr(session); + /* + * Update the oldest ID: we use it to decide whether pages are + * candidates for eviction. Without this, if all threads are + * blocked after a long-running transaction (such as a + * checkpoint) completes, we may never start evicting again. + * + * Do this every time the eviction server wakes up, regardless + * of whether the cache is full, to prevent the oldest ID + * falling too far behind. + */ + __wt_txn_update_oldest(session, 1); + WT_RET(__evict_has_work(session, &flags)); if (flags == 0) break; @@ -923,14 +935,6 @@ __evict_walk(WT_SESSION_IMPL *session, uint32_t flags) incr = dhandle_locked = 0; retries = 0; - /* - * Update the oldest ID: we use it to decide whether pages are - * candidates for eviction. Without this, if all threads are blocked - * after a long-running transaction (such as a checkpoint) completes, - * we may never start evicting again. - */ - __wt_txn_update_oldest(session, 1); - if (cache->evict_current == NULL) WT_STAT_FAST_CONN_INCR(session, cache_eviction_queue_empty); else |