summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2015-02-19 22:04:40 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2015-02-19 22:04:40 +1100
commit1e57a29e70671f24d556d30fba1e673e430eb05d (patch)
tree6be2e7d196c0adb544f4b52423b8b6b072c27df5
parent37b4312246cc72819991d31f2d37f1dd81e94ce4 (diff)
downloadmongo-1e57a29e70671f24d556d30fba1e673e430eb05d.tar.gz
Keep scanning files for eviction candidates if we haven't found any at all. Otherwise, eviction will get stuck quickly and start causing transactions to rollback.
refs #1681
-rw-r--r--src/evict/evict_lru.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index d80cf10f5da..83a9aa5c8c5 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -1010,14 +1010,14 @@ retry: while (slot < max_entries && ret == 0) {
/*
* Walk the list of files a few times if we don't find enough pages.
- * Try two passes through all the files, then only keep going if we
- * are finding more candidates. Take care not to skip files on
- * subsequent passes.
+ * Try two passes through all the files, give up when we have some
+ * candidates and we aren't finding more. Take care not to skip files
+ * on subsequent passes.
*/
if (!F_ISSET(cache, WT_EVICT_CLEAR_WALKS) && ret == 0 &&
slot < max_entries && (retries < 2 ||
- (!LF_ISSET(WT_EVICT_PASS_WOULD_BLOCK) &&
- retries < 10 && slot > start_slot))) {
+ (!LF_ISSET(WT_EVICT_PASS_WOULD_BLOCK) && retries < 10 &&
+ (slot == cache->evict_entries || slot > start_slot)))) {
cache->evict_file_next = NULL;
start_slot = slot;
++retries;