summaryrefslogtreecommitdiff
path: root/src/include/txn.i
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-10-29 10:32:18 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-10-29 10:32:18 +1100
commitc031e0d257a416486336ba43cb0d612055258a6c (patch)
tree30898e52aadb81d0ce4f5cf0c4fda72ce281288b /src/include/txn.i
parent862211f6d1c4646b663e24aa060fbfc83c57ec07 (diff)
downloadmongo-c031e0d257a416486336ba43cb0d612055258a6c.tar.gz
Release snapshots on transaction commit, check if a new snapshot is required on the next cursor operation.
Diffstat (limited to 'src/include/txn.i')
-rw-r--r--src/include/txn.i34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/include/txn.i b/src/include/txn.i
index ebb088b70d2..127176c67ea 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -6,7 +6,6 @@
*/
static inline int __wt_txn_id_check(WT_SESSION_IMPL *session);
-static inline void __wt_txn_read_first(WT_SESSION_IMPL *session);
static inline void __wt_txn_read_last(WT_SESSION_IMPL *session);
/*
@@ -293,35 +292,6 @@ __wt_txn_update_check(WT_SESSION_IMPL *session, WT_UPDATE *upd)
}
/*
- * __wt_txn_read_first --
- * Called for the first page read for a session.
- */
-static inline void
-__wt_txn_read_first(WT_SESSION_IMPL *session)
-{
- WT_TXN *txn;
-
- txn = &session->txn;
-
-#ifdef HAVE_DIAGNOSTIC
- {
- WT_TXN_GLOBAL *txn_global;
- WT_TXN_STATE *txn_state;
- txn_global = &S2C(session)->txn_global;
- txn_state = &txn_global->states[session->id];
-
- WT_ASSERT(session, F_ISSET(txn, TXN_HAS_SNAPSHOT) ||
- txn_state->snap_min == WT_TXN_NONE);
- }
-#endif
-
- if (txn->isolation == TXN_ISO_READ_COMMITTED ||
- (txn->isolation == TXN_ISO_SNAPSHOT &&
- !F_ISSET(txn, TXN_HAS_SNAPSHOT)))
- __wt_txn_refresh(session, 1);
-}
-
-/*
* __wt_txn_read_last --
* Called when the last page for a session is released.
*/
@@ -373,6 +343,10 @@ __wt_txn_cursor_op(WT_SESSION_IMPL *session)
!F_ISSET(txn, TXN_HAS_ID) &&
TXNID_LT(txn_state->snap_min, txn_global->last_running))
txn_state->snap_min = txn_global->last_running;
+
+ if (txn->isolation != TXN_ISO_READ_UNCOMMITTED &&
+ !F_ISSET(txn, TXN_HAS_SNAPSHOT))
+ __wt_txn_refresh(session, 1);
}
/*