diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c index 4b54170cf1..24dbfee6d3 100644 --- a/src/btree/bt_handle.c +++ b/src/btree/bt_handle.c @@ -435,7 +435,7 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt, bool is_ckpt) if (ret == 0) btree->flush_most_recent_secs = (uint64_t)cval.val; - btree->flush_most_recent_ts = 0; + btree->flush_most_recent_ts = WT_TS_NONE; ret = __wt_config_gets(session, cfg, "flush_timestamp", &cval); WT_RET_NOTFOUND_OK(ret); if (ret == 0 && cval.len != 0) diff --git a/src/btree/bt_vrfy.c b/src/btree/bt_vrfy.c index b149326a8a..53de1b0dc2 100644 --- a/src/btree/bt_vrfy.c +++ b/src/btree/bt_vrfy.c @@ -928,7 +928,7 @@ __verify_key_hs( * transaction-ids are wiped out on start, we could possibly have a start txn-id of WT_TXN_NONE, * in which case we initialize our newest with the max txn-id. */ - older_stop_ts = 0; + older_stop_ts = WT_TS_NONE; /* * Open a history store cursor positioned at the end of the data store key (the newest record) @@ -1047,7 +1047,7 @@ __verify_page_content_fix( WT_CELL_UNPACK_KV unpack; WT_DECL_RET; WT_PAGE *page; - uint64_t start_ts; + wt_timestamp_t start_ts; uint32_t cell_num, numtws, recno_offset, tw; uint8_t *p; diff --git a/src/history/hs_verify.c b/src/history/hs_verify.c index df2f84ff14..db8a347769 100644 --- a/src/history/hs_verify.c +++ b/src/history/hs_verify.c @@ -160,7 +160,7 @@ __wt_hs_verify(WT_SESSION_IMPL *session) ds_cursor = hs_cursor = NULL; WT_ERR(__wt_scr_alloc(session, 0, &buf)); WT_CLEAR(key); - hs_start_ts = 0; + hs_start_ts = WT_TS_NONE; hs_counter = 0; btree_id = WT_BTREE_ID_INVALID; uri_data = NULL; diff --git a/src/include/btree.h b/src/include/btree.h index 9d4112ae07..46c414a8e5 100644 --- a/src/include/btree.h +++ b/src/include/btree.h @@ -225,9 +225,9 @@ struct __wt_btree { * We flush pages from the tree (in order to make checkpoint faster), without a high-level lock. * To avoid multiple threads flushing at the same time, lock the tree. */ - WT_SPINLOCK flush_lock; /* Lock to flush the tree's pages */ - uint64_t flush_most_recent_secs; /* Wall clock time for the most recent flush */ - uint64_t flush_most_recent_ts; /* Timestamp of the most recent flush */ + WT_SPINLOCK flush_lock; /* Lock to flush the tree's pages */ + wt_timestamp_t flush_most_recent_ts; /* Timestamp of the most recent flush */ + uint64_t flush_most_recent_secs; /* Wall clock time for the most recent flush */ /* * All of the following fields live at the end of the structure so it's easier to clear everything diff --git a/src/include/meta.h b/src/include/meta.h index 3010ce42c7..27ed619a6c 100644 --- a/src/include/meta.h +++ b/src/include/meta.h @@ -179,9 +179,9 @@ struct __wt_ckpt { * Snapshot and timestamp information associated with a checkpoint. */ struct __wt_ckpt_snapshot { + wt_timestamp_t oldest_ts; + wt_timestamp_t stable_ts; uint64_t ckpt_id; - uint64_t oldest_ts; - uint64_t stable_ts; uint64_t snapshot_write_gen; uint64_t snapshot_min; uint64_t snapshot_max; diff --git a/src/include/optrack.h b/src/include/optrack.h index 370715a103..4a306e4f16 100644 --- a/src/include/optrack.h +++ b/src/include/optrack.h @@ -44,9 +44,9 @@ struct __wt_optrack_header { * from it. */ struct __wt_optrack_record { - uint64_t op_timestamp; /* timestamp */ - uint16_t op_id; /* function ID */ - uint16_t op_type; /* start/stop */ + wt_timestamp_t op_timestamp; /* timestamp */ + uint16_t op_id; /* function ID */ + uint16_t op_type; /* start/stop */ uint8_t padding[4]; }; diff --git a/src/include/reconcile_inline.h b/src/include/reconcile_inline.h index 66261b319c..91fce58b37 100644 --- a/src/include/reconcile_inline.h +++ b/src/include/reconcile_inline.h @@ -88,11 +88,11 @@ __rec_cell_tw_stats(WT_RECONCILE *r, WT_TIME_WINDOW *tw) static inline void __rec_page_time_stats_clear(WT_RECONCILE *r) { - r->count_durable_start_ts = 0; - r->count_start_ts = 0; + r->count_durable_start_ts = WT_TS_NONE; + r->count_start_ts = WT_TS_NONE; r->count_start_txn = 0; - r->count_durable_stop_ts = 0; - r->count_stop_ts = 0; + r->count_durable_stop_ts = WT_TS_NONE; + r->count_stop_ts = WT_TS_NONE; r->count_stop_txn = 0; r->count_prepare = 0; @@ -107,7 +107,7 @@ static inline void __rec_page_time_stats(WT_SESSION_IMPL *session, WT_RECONCILE *r) { /* Time window statistics */ - if (r->count_durable_start_ts != 0) { + if (r->count_durable_start_ts != WT_TS_NONE) { WT_STAT_CONN_DATA_INCR(session, rec_time_window_pages_durable_start_ts); WT_STAT_CONN_DATA_INCRV( session, rec_time_window_bytes_ts, r->count_durable_start_ts * sizeof(wt_timestamp_t)); @@ -115,7 +115,7 @@ __rec_page_time_stats(WT_SESSION_IMPL *session, WT_RECONCILE *r) session, rec_time_window_durable_start_ts, r->count_durable_start_ts); r->rec_page_cell_with_ts = true; } - if (r->count_start_ts != 0) { + if (r->count_start_ts != WT_TS_NONE) { WT_STAT_CONN_DATA_INCRV( session, rec_time_window_bytes_ts, r->count_start_ts * sizeof(wt_timestamp_t)); WT_STAT_CONN_DATA_INCRV(session, rec_time_window_start_ts, r->count_start_ts); @@ -129,14 +129,14 @@ __rec_page_time_stats(WT_SESSION_IMPL *session, WT_RECONCILE *r) WT_STAT_CONN_DATA_INCR(session, rec_time_window_pages_start_txn); r->rec_page_cell_with_txn_id = true; } - if (r->count_durable_stop_ts != 0) { + if (r->count_durable_stop_ts != WT_TS_NONE) { WT_STAT_CONN_DATA_INCRV( session, rec_time_window_bytes_ts, r->count_durable_stop_ts * sizeof(wt_timestamp_t)); WT_STAT_CONN_DATA_INCRV(session, rec_time_window_durable_stop_ts, r->count_durable_stop_ts); WT_STAT_CONN_DATA_INCR(session, rec_time_window_pages_durable_stop_ts); r->rec_page_cell_with_ts = true; } - if (r->count_stop_ts != 0) { + if (r->count_stop_ts != WT_TS_NONE) { WT_STAT_CONN_DATA_INCRV( session, rec_time_window_bytes_ts, r->count_stop_ts * sizeof(wt_timestamp_t)); WT_STAT_CONN_DATA_INCRV(session, rec_time_window_stop_ts, r->count_stop_ts); diff --git a/src/include/tiered.h b/src/include/tiered.h index cac9f9c1e5..671fec88a2 100644 --- a/src/include/tiered.h +++ b/src/include/tiered.h @@ -120,15 +120,15 @@ struct __wt_tiered { * this object and how to access it. */ struct __wt_tiered_object { - const char *uri; /* Data source for this object */ - WT_TIERED_TREE *tree; /* Pointer to tree this object is part of */ - uint64_t count; /* Approximate count of records */ - uint64_t size; /* Final size of object */ - uint64_t switch_txn; /* Largest txn that can write to this object */ - uint64_t switch_ts; /* Timestamp for switching */ - uint32_t id; /* This object's id */ - uint32_t generation; /* Do we need this?? */ - uint32_t refcnt; /* Number of references */ + const char *uri; /* Data source for this object */ + WT_TIERED_TREE *tree; /* Pointer to tree this object is part of */ + uint64_t count; /* Approximate count of records */ + uint64_t size; /* Final size of object */ + uint64_t switch_txn; /* Largest txn that can write to this object */ + wt_timestamp_t switch_ts; /* Timestamp for switching */ + uint32_t id; /* This object's id */ + uint32_t generation; /* Do we need this?? */ + uint32_t refcnt; /* Number of references */ /* AUTOMATIC FLAG VALUE GENERATION START 0 */ #define WT_TIERED_OBJ_LOCAL 0x1u /* Local resident also */ diff --git a/src/include/txn_inline.h b/src/include/txn_inline.h index 2d99fa26fd..bd46e82f34 100644 --- a/src/include/txn_inline.h +++ b/src/include/txn_inline.h @@ -610,7 +610,7 @@ __wt_txn_pinned_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *pinned_tsp) WT_READ_BARRIER(); checkpoint_ts = txn_global->checkpoint_timestamp; - if (checkpoint_ts != 0 && checkpoint_ts < pinned_ts) + if (checkpoint_ts != WT_TS_NONE && checkpoint_ts < pinned_ts) *pinned_tsp = checkpoint_ts; } diff --git a/src/txn/txn.c b/src/txn/txn.c index 1e660b8be8..906d01bc8e 100644 --- a/src/txn/txn.c +++ b/src/txn/txn.c @@ -2393,7 +2393,7 @@ __wt_txn_stats_update(WT_SESSION_IMPL *session) durable_timestamp - txn_global->oldest_timestamp); __wt_txn_get_pinned_timestamp(session, &oldest_active_read_timestamp, 0); - if (oldest_active_read_timestamp == 0) { + if (oldest_active_read_timestamp == WT_TS_NONE) { WT_STAT_SET(session, stats, txn_timestamp_oldest_active_read, 0); WT_STAT_SET(session, stats, txn_pinned_timestamp_reader, 0); } else { diff --git a/src/txn/txn_timestamp.c b/src/txn/txn_timestamp.c index 469d519dce..ccbd465052 100644 --- a/src/txn/txn_timestamp.c +++ b/src/txn/txn_timestamp.c @@ -281,7 +281,7 @@ __wt_txn_update_pinned_timestamp(WT_SESSION_IMPL *session, bool force) /* Scan to find the global pinned timestamp. */ __wt_txn_get_pinned_timestamp(session, &pinned_timestamp, WT_TXN_TS_INCLUDE_OLDEST); - if (pinned_timestamp == 0) + if (pinned_timestamp == WT_TS_NONE) return; if (txn_global->has_pinned_timestamp && !force) { @@ -299,7 +299,7 @@ __wt_txn_update_pinned_timestamp(WT_SESSION_IMPL *session, bool force) __wt_txn_get_pinned_timestamp( session, &pinned_timestamp, WT_TXN_TS_ALREADY_LOCKED | WT_TXN_TS_INCLUDE_OLDEST); - if (pinned_timestamp != 0 && + if (pinned_timestamp != WT_TS_NONE && (!txn_global->has_pinned_timestamp || force || txn_global->pinned_timestamp < pinned_timestamp)) { txn_global->pinned_timestamp = pinned_timestamp; @@ -631,7 +631,7 @@ __wt_txn_validate_durable_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t dur txn_global = &S2C(session)->txn_global; /* Added this redundant initialization to circumvent build failure. */ - oldest_ts = stable_ts = 0; + oldest_ts = stable_ts = WT_TS_NONE; /* * Compare against the oldest and the stable timestamp. Return an error if the given timestamp