summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-03-26 21:25:50 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-03-26 21:25:50 +1100
commite515ca6b1966207b5091999b9ad499ae18f5d075 (patch)
treeb7943e105a276dc4238085b9553f99e636a5bc67
parent3aa9940846b7b66875770884844cc1121ed24f1b (diff)
downloadmongo-e515ca6b1966207b5091999b9ad499ae18f5d075.tar.gz
Stop trying to cache the oldest reader: we only use it for eviction and only update it when required.
-rw-r--r--src/include/txn.h4
-rw-r--r--src/txn/txn.c11
2 files changed, 4 insertions, 11 deletions
diff --git a/src/include/txn.h b/src/include/txn.h
index e87df4bae5d..80e0a05668a 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -81,8 +81,8 @@ struct __wt_txn {
wt_txnid_t oldest_snap_min;
/* Saved global state, to avoid repeating scans. */
- wt_txnid_t last_id, last_oldest_id;
- uint32_t last_gen, last_oldest_gen;
+ wt_txnid_t last_id;
+ uint32_t last_gen;
/*
* Arrays of txn IDs in WT_UPDATE or WT_REF structures created or
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 6e2ba2d5e33..c1a72ecd671 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -79,13 +79,6 @@ __wt_txn_get_oldest(WT_SESSION_IMPL *session)
oldest_snap_min =
(txn->id != WT_TXN_NONE) ? txn->id : txn_global->current;
- /* If nothing has changed since last time, we're done. */
- if (txn->last_oldest_gen == txn_global->gen &&
- txn->last_oldest_id == oldest_snap_min)
- return;
- txn->last_oldest_gen = txn_global->gen;
- txn->last_oldest_id = oldest_snap_min;
-
WT_ORDERED_READ(session_cnt, conn->session_cnt);
for (i = 0, s = txn_global->states;
i < session_cnt;
@@ -127,7 +120,7 @@ __wt_txn_get_snapshot(
do {
/* Take a copy of the current session ID. */
- txn->last_gen = txn->last_oldest_gen = txn_global->gen;
+ txn->last_gen = txn_global->gen;
txn->last_id = oldest_snap_min = current_id =
txn_global->current;
@@ -252,7 +245,7 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
* visible.
*/
if (txn->isolation == TXN_ISO_SNAPSHOT) {
- txn->last_gen = txn->last_oldest_gen = txn_global->gen;
+ txn->last_gen = txn_global->gen;
oldest_snap_min = txn->id;
/* Copy the array of concurrent transactions. */