summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-06-29 14:31:44 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2015-06-29 14:31:44 +1000
commit5499cc46b946671cbe4b11d4ba193bc9633a326e (patch)
treebf07e2388285b76412a840b88e0c03a6e7cf08ee /src/include
parent6a667b9b0f00fcbf4e03360f2d9fd6c7a08abdb6 (diff)
downloadmongo-5499cc46b946671cbe4b11d4ba193bc9633a326e.tar.gz
WT-1907 Improve performance of transaction refresh
(cherry picked from commit 5f8d5b4a84e36ae366fbee9a2026995af58e07a9)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/extern.h2
-rw-r--r--src/include/txn.h3
-rw-r--r--src/include/txn.i20
3 files changed, 11 insertions, 14 deletions
diff --git a/src/include/extern.h b/src/include/extern.h
index 6069bb0dcf2..be002681d9c 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -660,8 +660,8 @@ extern void __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats);
extern void __wt_stat_refresh_connection_stats(void *stats_arg);
extern int WT_CDECL __wt_txnid_cmp(const void *v1, const void *v2);
extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session);
+extern void __wt_txn_get_snapshot(WT_SESSION_IMPL *session);
extern void __wt_txn_update_oldest(WT_SESSION_IMPL *session);
-extern void __wt_txn_refresh(WT_SESSION_IMPL *session, int get_snapshot);
extern int __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]);
extern void __wt_txn_release(WT_SESSION_IMPL *session);
extern int __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]);
diff --git a/src/include/txn.h b/src/include/txn.h
index 927ab09d5f9..62f565c0535 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -42,9 +42,6 @@ struct __wt_txn_global {
*/
volatile uint64_t oldest_id;
- /* The oldest session found in the last scan. */
- uint32_t oldest_session;
-
/* Count of scanning threads, or -1 for exclusive access. */
volatile int32_t scan_count;
diff --git a/src/include/txn.i b/src/include/txn.i
index 4ae80231c65..9e8d9cee748 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -154,20 +154,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.
@@ -418,7 +418,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);
}
/*