summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-11-02 13:10:32 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-11-02 13:10:32 +1100
commit4ba56985d6cb290e1981018fd04b017f5dcdad90 (patch)
tree08cf1d35e301f3a5d7f16f15bfd005e55850866d
parent2daed113d9d055c6c26695ce317f917213a650f2 (diff)
parent72efdadb71084ba15887e5950e81998277435392 (diff)
downloadmongo-4ba56985d6cb290e1981018fd04b017f5dcdad90.tar.gz
Merge pull request #2281 from wiredtiger/evict-clean-internal
WT-2192 Fix the logic around checking whether internal page is evictable.
-rw-r--r--src/evict/evict_page.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c
index 7202da7927c..2c0312a6f60 100644
--- a/src/evict/evict_page.c
+++ b/src/evict/evict_page.c
@@ -378,14 +378,6 @@ __evict_review(
/* Now that we have exclusive access, review the page. */
page = ref->page;
- modified = __wt_page_is_modified(page);
-
- /*
- * Clean pages can't be evicted when running in memory only. This
- * should be uncommon - we don't add clean pages to the queue.
- */
- if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY) && !modified && !closing)
- return (EBUSY);
/*
* Fail if an internal has active children, the children must be evicted
@@ -399,6 +391,20 @@ __evict_review(
WT_RET(ret);
}
+ /*
+ * Retrieve the modified state of the page. This must happen after the
+ * check for evictable internal pages otherwise there is a race where a
+ * page could be marked modified whilst performing the check.
+ */
+ modified = __wt_page_is_modified(page);
+
+ /*
+ * Clean pages can't be evicted when running in memory only. This
+ * should be uncommon - we don't add clean pages to the queue.
+ */
+ if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY) && !modified && !closing)
+ return (EBUSY);
+
/* Check if the page can be evicted. */
if (!closing) {
/*