summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-11-02 15:02:42 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2015-11-02 15:02:42 +1100
commitdb3fce5ea2034855a3f88dec9426cf7e5aa4f837 (patch)
tree65f77456fbcaee3c8c80ce1ab5297939afad62c8
parentfb6ebe75207c3221314ed318595489a838ef1db0 (diff)
downloadmongo-db3fce5ea2034855a3f88dec9426cf7e5aa4f837.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.2.0-rc1-197-g62c1a7a.tar.gz from wiredtiger branch mongodb-3.2
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_page.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c
index 7202da7927c..2c0312a6f60 100644
--- a/src/third_party/wiredtiger/src/evict/evict_page.c
+++ b/src/third_party/wiredtiger/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) {
/*