diff options
author | Alexander Gorrod <alexander.gorrod@mongodb.com> | 2015-05-08 05:34:43 +0000 |
---|---|---|
committer | Alexander Gorrod <alexander.gorrod@mongodb.com> | 2015-05-08 05:34:43 +0000 |
commit | cddb4b8f5a193e32d1400963cd177fe47c8570df (patch) | |
tree | dade044e688956af69505fc796244f229d40241c /src/third_party/wiredtiger/src/include/txn.i | |
parent | 3a8bcdfb23ab85b57e5da308fb4d3c607ce77a49 (diff) | |
download | mongo-cddb4b8f5a193e32d1400963cd177fe47c8570df.tar.gz |
Import wiredtiger-wiredtiger-2.5.3-486-g4f9aa1c.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/include/txn.i')
-rw-r--r-- | src/third_party/wiredtiger/src/include/txn.i | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/src/include/txn.i b/src/third_party/wiredtiger/src/include/txn.i index 4141d829f1d..b1cfba4257d 100644 --- a/src/third_party/wiredtiger/src/include/txn.i +++ b/src/third_party/wiredtiger/src/include/txn.i @@ -139,20 +139,20 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) txn = &session->txn; - /* - * Eviction only sees globally visible updates, or if there is a - * checkpoint transaction running, use its transaction. - */ - if (txn->isolation == TXN_ISO_EVICTION) - return (__wt_txn_visible_all(session, id)); + /* Changes with no associated transaction are always visible. */ + if (id == WT_TXN_NONE) + return (1); /* Nobody sees the results of aborted transactions. */ if (id == WT_TXN_ABORTED) return (0); - /* Changes with no associated transaction are always visible. */ - if (id == WT_TXN_NONE) - return (1); + /* + * Eviction only sees globally visible updates, or if there is a + * checkpoint transaction running, use its transaction. + */ + if (txn->isolation == TXN_ISO_EVICTION) + return (__wt_txn_visible_all(session, id)); /* * Read-uncommitted transactions see all other changes. @@ -222,7 +222,14 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]) if (txn->isolation == TXN_ISO_SNAPSHOT) { if (session->ncursors > 0) WT_RET(__wt_session_copy_values(session)); - __wt_txn_refresh(session, 1); + + /* + * We're about to allocate a snapshot: if we need to block for + * eviction, it's better to do it beforehand. + */ + WT_RET(__wt_cache_full_check(session)); + + __wt_txn_get_snapshot(session); } F_SET(txn, TXN_RUNNING); @@ -429,7 +436,7 @@ __wt_txn_cursor_op(WT_SESSION_IMPL *session) if (txn->isolation != TXN_ISO_READ_UNCOMMITTED && !F_ISSET(txn, TXN_HAS_SNAPSHOT)) - __wt_txn_refresh(session, 1); + __wt_txn_get_snapshot(session); } /* |