summaryrefslogtreecommitdiff
path: root/src/evict
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2015-10-28 22:45:30 -0400
committersueloverso <sue@mongodb.com>2015-10-28 22:45:30 -0400
commit91ee6a2fc7392a4a9e2c8b57c5319ede0f98b44e (patch)
treee422be70916175bbf276ed56138def7a7bcf4f29 /src/evict
parent35d46c3a0e7b4c87849df7283544d2e6208d5edd (diff)
parenta4290da8a633f7ba692b84673b13417e728f7dcc (diff)
downloadmongo-91ee6a2fc7392a4a9e2c8b57c5319ede0f98b44e.tar.gz
Merge pull request #2266 from wiredtiger/wt-2170
WT-2170 Move metadata read uncommitted to search
Diffstat (limited to 'src/evict')
-rw-r--r--src/evict/evict_file.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c
index 448de57d88e..b586ac8df35 100644
--- a/src/evict/evict_file.c
+++ b/src/evict/evict_file.c
@@ -18,8 +18,11 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop)
WT_DECL_RET;
WT_PAGE *page;
WT_REF *next_ref, *ref;
+ WT_TXN *txn;
bool evict_reset;
+ txn = &session->txn;
+
/*
* We need exclusive access to the file -- disable ordinary eviction
* and drain any blocks already queued.
@@ -56,8 +59,11 @@ __wt_evict_file(WT_SESSION_IMPL *session, int syncop)
* and the write will fail with EBUSY. Our caller handles that
* error, retrying later.
*/
- if (syncop == WT_SYNC_CLOSE && __wt_page_is_modified(page))
+ if (syncop == WT_SYNC_CLOSE && __wt_page_is_modified(page)) {
+ if (txn->isolation == WT_ISO_READ_COMMITTED)
+ __wt_txn_get_snapshot(session);
WT_ERR(__wt_reconcile(session, ref, NULL, WT_EVICTING));
+ }
/*
* We can't evict the page just returned to us (it marks our
@@ -107,5 +113,8 @@ err: /* On error, clear any left-over tree walk. */
if (evict_reset)
__wt_evict_file_exclusive_off(session);
+ if (txn->isolation == WT_ISO_READ_COMMITTED && session->ncursors == 0)
+ __wt_txn_release_snapshot(session);
+
return (ret);
}