summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile/rec_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_write.c')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c95
1 files changed, 28 insertions, 67 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index eb0c166c44c..d3caa23ed02 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -47,11 +47,11 @@ typedef struct {
/* Track the page's min/maximum transactions. */
uint64_t max_txn;
- WT_DECL_TIMESTAMP(max_timestamp)
+ wt_timestamp_t max_timestamp;
/* Lookaside boundary tracking. */
uint64_t unstable_txn;
- WT_DECL_TIMESTAMP(unstable_timestamp)
+ wt_timestamp_t unstable_timestamp;
u_int updates_seen; /* Count of updates seen. */
u_int updates_unstable; /* Count of updates not visible_all. */
@@ -440,11 +440,9 @@ __wt_reconcile(WT_SESSION_IMPL *session, WT_REF *ref,
*/
if (LF_ISSET(WT_REC_EVICT)) {
mod->last_eviction_id = oldest_id;
-#ifdef HAVE_TIMESTAMPS
if (S2C(session)->txn_global.has_pinned_timestamp)
__wt_txn_pinned_timestamp(
session, &mod->last_eviction_timestamp);
-#endif
mod->last_evict_pass_gen = S2C(session)->cache->evict_pass_gen;
}
@@ -503,16 +501,12 @@ __wt_reconcile(WT_SESSION_IMPL *session, WT_REF *ref,
else
WT_TRET(__rec_write_wrapup_err(session, r, page));
-#ifdef HAVE_TIMESTAMPS
/*
* If reconciliation completes successfully, save the stable timestamp.
*/
if (ret == 0 && S2C(session)->txn_global.has_stable_timestamp)
- WT_WITH_TIMESTAMP_READLOCK(session,
- &S2C(session)->txn_global.rwlock,
- __wt_timestamp_set(&mod->last_stable_timestamp,
- &S2C(session)->txn_global.stable_timestamp));
-#endif
+ mod->last_stable_timestamp =
+ S2C(session)->txn_global.stable_timestamp;
/* Release the reconciliation lock. */
WT_PAGE_UNLOCK(session, page);
@@ -701,7 +695,7 @@ __rec_write_page_status(WT_SESSION_IMPL *session, WT_RECONCILE *r)
* we can evict a clean page and discard its history).
*/
mod->rec_max_txn = r->max_txn;
- __wt_timestamp_set(&mod->rec_max_timestamp, &r->max_timestamp);
+ mod->rec_max_timestamp = r->max_timestamp;
/*
* Track the tree's maximum transaction ID (used to decide if
@@ -714,12 +708,8 @@ __rec_write_page_status(WT_SESSION_IMPL *session, WT_RECONCILE *r)
if (!F_ISSET(r, WT_REC_EVICT)) {
if (WT_TXNID_LT(btree->rec_max_txn, r->max_txn))
btree->rec_max_txn = r->max_txn;
-#ifdef HAVE_TIMESTAMPS
- if (__wt_timestamp_cmp(
- &btree->rec_max_timestamp, &r->max_timestamp) < 0)
- __wt_timestamp_set(&btree->rec_max_timestamp,
- &r->max_timestamp);
-#endif
+ if (btree->rec_max_timestamp < r->max_timestamp)
+ btree->rec_max_timestamp = r->max_timestamp;
}
/*
@@ -951,17 +941,15 @@ __rec_init(WT_SESSION_IMPL *session,
*/
r->las_skew_newest =
LF_ISSET(WT_REC_LOOKASIDE) && LF_ISSET(WT_REC_VISIBLE_ALL);
-#ifdef HAVE_TIMESTAMPS
if (r->las_skew_newest &&
!__wt_btree_immediately_durable(session) &&
txn_global->has_stable_timestamp &&
((btree->checkpoint_gen != __wt_gen(session, WT_GEN_CHECKPOINT) &&
txn_global->stable_is_pinned) ||
FLD_ISSET(page->modify->restore_state, WT_PAGE_RS_LOOKASIDE) ||
- __wt_timestamp_cmp(&page->modify->last_stable_timestamp,
- &txn_global->stable_timestamp) == 0))
+ page->modify->last_stable_timestamp ==
+ txn_global->stable_timestamp))
r->las_skew_newest = false;
-#endif
/*
* When operating on the lookaside table, we should never try
@@ -992,7 +980,7 @@ __rec_init(WT_SESSION_IMPL *session,
/* Track the page's min/maximum transaction */
r->max_txn = WT_TXN_NONE;
- __wt_timestamp_set_zero(&r->max_timestamp);
+ r->max_timestamp = 0;
/*
* Track the first unstable transaction (when skewing newest this is
@@ -1002,10 +990,10 @@ __rec_init(WT_SESSION_IMPL *session,
*/
if (r->las_skew_newest) {
r->unstable_txn = WT_TXN_NONE;
- __wt_timestamp_set_zero(&r->unstable_timestamp);
+ r->unstable_timestamp = 0;
} else {
r->unstable_txn = WT_TXN_ABORTED;
- __wt_timestamp_set_inf(&r->unstable_timestamp);
+ r->unstable_timestamp = UINT64_MAX;
}
/* Track if updates were used and/or uncommitted. */
@@ -1257,7 +1245,7 @@ __rec_append_orig_value(WT_SESSION_IMPL *session,
*/
if (upd->type == WT_UPDATE_BIRTHMARK) {
append->txnid = upd->txnid;
- __wt_timestamp_set(&append->timestamp, &upd->timestamp);
+ append->timestamp = upd->timestamp;
append->next = upd->next;
}
@@ -1285,23 +1273,18 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
bool *upd_savedp, WT_UPDATE **updp)
{
WT_PAGE *page;
- WT_UPDATE *first_txn_upd, *first_upd, *upd;
- wt_timestamp_t *timestampp;
+ WT_UPDATE *first_ts_upd, *first_txn_upd, *first_upd, *upd;
+ wt_timestamp_t timestamp;
size_t upd_memsize;
uint64_t max_txn, txnid;
bool all_visible, prepared, skipped_birthmark, uncommitted;
-#ifdef HAVE_TIMESTAMPS
- WT_UPDATE *first_ts_upd;
- first_ts_upd = NULL;
-#endif
-
if (upd_savedp != NULL)
*upd_savedp = false;
*updp = NULL;
page = r->page;
- first_txn_upd = NULL;
+ first_ts_upd = first_txn_upd = NULL;
upd_memsize = 0;
max_txn = WT_TXN_NONE;
prepared = skipped_birthmark = uncommitted = false;
@@ -1356,12 +1339,9 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
continue;
}
-#ifdef HAVE_TIMESTAMPS
/* Track the first update with non-zero timestamp. */
- if (first_ts_upd == NULL &&
- !__wt_timestamp_iszero(&upd->timestamp))
+ if (first_ts_upd == NULL && upd->timestamp != 0)
first_ts_upd = upd;
-#endif
/*
* Find the first update we can use.
@@ -1454,12 +1434,9 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
if (WT_TXNID_LT(r->max_txn, max_txn))
r->max_txn = max_txn;
-#ifdef HAVE_TIMESTAMPS
/* Update the maximum timestamp. */
- if (first_ts_upd != NULL &&
- __wt_timestamp_cmp(&r->max_timestamp, &first_ts_upd->timestamp) < 0)
- __wt_timestamp_set(&r->max_timestamp, &first_ts_upd->timestamp);
-#endif
+ if (first_ts_upd != NULL && r->max_timestamp < first_ts_upd->timestamp)
+ r->max_timestamp = first_ts_upd->timestamp;
/*
* If the update we chose was a birthmark, or we are doing
@@ -1479,15 +1456,11 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
* order), so we track the maximum transaction ID and the newest update
* with a timestamp (if any).
*/
-#ifdef HAVE_TIMESTAMPS
- timestampp = first_ts_upd == NULL ? NULL : &first_ts_upd->timestamp;
-#else
- timestampp = NULL;
-#endif
+ timestamp = first_ts_upd == NULL ? 0 : first_ts_upd->timestamp;
all_visible = upd == first_txn_upd && !(uncommitted || prepared) &&
(F_ISSET(r, WT_REC_VISIBLE_ALL) ?
- __wt_txn_visible_all(session, max_txn, timestampp) :
- __wt_txn_visible(session, max_txn, timestampp));
+ __wt_txn_visible_all(session, max_txn, timestamp) :
+ __wt_txn_visible(session, max_txn, timestamp));
if (all_visible)
goto check_original_value;
@@ -1544,13 +1517,9 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
if (F_ISSET(r, WT_REC_LOOKASIDE) && r->las_skew_newest) {
if (WT_TXNID_LT(r->unstable_txn, first_upd->txnid))
r->unstable_txn = first_upd->txnid;
-#ifdef HAVE_TIMESTAMPS
if (first_ts_upd != NULL &&
- __wt_timestamp_cmp(&r->unstable_timestamp,
- &first_ts_upd->timestamp) < 0)
- __wt_timestamp_set(&r->unstable_timestamp,
- &first_ts_upd->timestamp);
-#endif
+ r->unstable_timestamp < first_ts_upd->timestamp)
+ r->unstable_timestamp = first_ts_upd->timestamp;
} else if (F_ISSET(r, WT_REC_LOOKASIDE)) {
for (upd = first_upd; upd != *updp; upd = upd->next) {
if (upd->txnid == WT_TXN_ABORTED)
@@ -1559,12 +1528,8 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
if (upd->txnid != WT_TXN_NONE &&
WT_TXNID_LT(upd->txnid, r->unstable_txn))
r->unstable_txn = upd->txnid;
-#ifdef HAVE_TIMESTAMPS
- if (__wt_timestamp_cmp(&upd->timestamp,
- &r->unstable_timestamp) < 0)
- __wt_timestamp_set(&r->unstable_timestamp,
- &upd->timestamp);
-#endif
+ if (upd->timestamp < r->unstable_timestamp)
+ r->unstable_timestamp = upd->timestamp;
}
}
@@ -3434,12 +3399,8 @@ done: if (F_ISSET(r, WT_REC_LOOKASIDE)) {
multi->page_las.max_txn = r->max_txn;
multi->page_las.unstable_txn = r->unstable_txn;
WT_ASSERT(session, r->unstable_txn != WT_TXN_NONE);
-#ifdef HAVE_TIMESTAMPS
- __wt_timestamp_set(&multi->page_las.max_timestamp,
- &r->max_timestamp);
- __wt_timestamp_set(&multi->page_las.unstable_timestamp,
- &r->unstable_timestamp);
-#endif
+ multi->page_las.max_timestamp = r->max_timestamp;
+ multi->page_las.unstable_timestamp = r->unstable_timestamp;
}
err: __wt_scr_free(session, &key);