From e515ca6b1966207b5091999b9ad499ae18f5d075 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Tue, 26 Mar 2013 21:25:50 +1100 Subject: Stop trying to cache the oldest reader: we only use it for eviction and only update it when required. --- src/include/txn.h | 4 ++-- src/txn/txn.c | 11 ++--------- 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. */ -- cgit v1.2.1