Skip to content

Commit 264639b

Browse files
wt-vendoring-bot[bot]wt-vendoring-bot
authored and
MongoDB Bot
committed
Import wiredtiger: bdea91c074bef759333480fcb124315b5b2a5e04 from branch mongodb-master (#36492)
Co-authored-by: wt-vendoring-bot <[email protected]> GitOrigin-RevId: 763e80763c6078adfad26f1a0a5cbb68f2a616c9
1 parent a88f782 commit 264639b

File tree

14 files changed

+159
-58
lines changed

14 files changed

+159
-58
lines changed

src/third_party/wiredtiger/import.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"vendor": "wiredtiger",
33
"github": "wiredtiger/wiredtiger",
44
"branch": "mongodb-master",
5-
"commit": "9646ff2464ec0cf662904a32661b3789bf5aa6fb"
5+
"commit": "bdea91c074bef759333480fcb124315b5b2a5e04"
66
}

src/third_party/wiredtiger/src/btree/bt_sync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ __sync_checkpoint_can_skip(WT_SESSION_IMPL *session, WT_REF *ref)
4040
/* The checkpoint's snapshot includes the first dirty update on the page. */
4141
txn = session->txn;
4242
mod = ref->page->modify;
43-
if (!WT_TXNID_LT(txn->snapshot_data.snap_max, mod->first_dirty_txn))
43+
if (txn->snapshot_data.snap_max >= mod->first_dirty_txn)
4444
return (false);
4545

4646
/*
@@ -197,7 +197,7 @@ __wt_sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
197197
*/
198198
page = walk->page;
199199
if (__wt_page_is_modified(page) &&
200-
WT_TXNID_LT(__wt_atomic_load64(&page->modify->update_txn), oldest_id)) {
200+
__wt_atomic_load64(&page->modify->update_txn) < oldest_id) {
201201
if (txn->isolation == WT_ISO_READ_COMMITTED)
202202
__wt_txn_get_snapshot(session);
203203
leaf_bytes += __wt_atomic_loadsize(&page->memory_footprint);

src/third_party/wiredtiger/src/checkpoint/checkpoint_txn.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,8 @@ __checkpoint_prepare(WT_SESSION_IMPL *session, bool *trackingp, const char *cfg[
853853
* Sanity check that the oldest ID hasn't moved on before we have cleared our entry.
854854
*/
855855
WT_ASSERT(session,
856-
WT_TXNID_LE(
857-
__wt_atomic_loadv64(&txn_global->oldest_id), __wt_atomic_loadv64(&txn_shared->id)) &&
858-
WT_TXNID_LE(__wt_atomic_loadv64(&txn_global->oldest_id),
856+
(__wt_atomic_loadv64(&txn_global->oldest_id) <= __wt_atomic_loadv64(&txn_shared->id)) &&
857+
(__wt_atomic_loadv64(&txn_global->oldest_id) <=
859858
__wt_atomic_loadv64(&txn_shared->pinned_id)));
860859

861860
/*

src/third_party/wiredtiger/src/evict/evict_lru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ __evict_update_work(WT_SESSION_IMPL *session)
732732
LF_SET(WT_EVICT_CACHE_DIRTY);
733733

734734
/*
735-
* Scrub dirty pages and keep them in cache if we are less than half way to the clean, dirty or
735+
* Scrub dirty pages and keep them in cache if we are less than half way to the clean, dirty and
736736
* updates triggers.
737737
*/
738738
if (bytes_inuse < (uint64_t)((target + trigger) * bytes_max) / 200) {

src/third_party/wiredtiger/src/evict/evict_page.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -911,15 +911,25 @@ __evict_reconcile(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t evict_flags)
911911
LF_SET(WT_REC_HS);
912912

913913
/*
914-
* Scrub and we're supposed to or toss it in sometimes if we are in debugging mode.
914+
* Scrub if we're supposed to or toss it in sometimes if we are in debugging mode.
915915
*
916916
* Note that don't scrub if checkpoint is running on the tree.
917917
*/
918-
if (!WT_SESSION_BTREE_SYNC(session) &&
919-
(F_ISSET(evict, WT_EVICT_CACHE_SCRUB) ||
920-
(FLD_ISSET(conn->debug_flags, WT_CONN_DEBUG_EVICT_AGGRESSIVE_MODE) &&
921-
__wt_random(&session->rnd_random) % 3 == 0)))
922-
LF_SET(WT_REC_SCRUB);
918+
if (!WT_SESSION_BTREE_SYNC(session)) {
919+
bool can_scrub = (F_ISSET(evict, WT_EVICT_CACHE_SCRUB) ||
920+
(FLD_ISSET(conn->debug_flags, WT_CONN_DEBUG_EVICT_AGGRESSIVE_MODE) &&
921+
__wt_random(&session->rnd_random) % 3 == 0));
922+
923+
/*
924+
* Scrub only if cache is under the clean eviction target or the page has high read
925+
* generation (the page is hot and we want to keep it in cache).
926+
*/
927+
if (can_scrub &&
928+
(!__wt_evict_clean_needed(session, NULL) ||
929+
ref->page->read_gen > __evict_read_gen(session))) {
930+
LF_SET(WT_REC_SCRUB);
931+
}
932+
}
923933
}
924934

925935
/*

src/third_party/wiredtiger/src/include/btree_inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page)
660660
}
661661

662662
/* Check if this is the largest transaction ID to update the page. */
663-
if (WT_TXNID_LT(__wt_atomic_load64(&page->modify->update_txn), session->txn->id))
663+
if (__wt_atomic_load64(&page->modify->update_txn) < session->txn->id)
664664
__wt_atomic_store64(&page->modify->update_txn, session->txn->id);
665665
}
666666

src/third_party/wiredtiger/src/include/txn.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ typedef enum { WT_OPCTX_TRANSACTION, WT_OPCTX_RECONCILATION } WT_OP_CONTEXT;
6262
* WT_TXN_ABORTED is the largest possible ID (never visible to a running transaction), WT_TXN_NONE
6363
* is smaller than any possible ID (visible to all running transactions).
6464
*/
65-
#define WT_TXNID_LE(t1, t2) ((t1) <= (t2))
6665

6766
#define WT_TXNID_LT(t1, t2) ((t1) < (t2))
6867

src/third_party/wiredtiger/src/include/txn_inline.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ __txn_next_op(WT_SESSION_IMPL *session, WT_TXN_OP **opp)
295295
txn_id = txn->id;
296296
WT_ASSERT_ALWAYS(session, txn_id != WT_TXN_ABORTED,
297297
"Assert failure: session: %s: txn->id == WT_TXN_ABORTED", session->name);
298-
while (WT_TXNID_LT(btree_txn_id_prev, txn_id)) {
298+
while (btree_txn_id_prev < txn_id) {
299299
if (__wt_atomic_cas64(&op->btree->max_upd_txn, btree_txn_id_prev, txn_id))
300300
break;
301301
btree_txn_id_prev = op->btree->max_upd_txn;
@@ -784,7 +784,7 @@ __wt_txn_oldest_id(WT_SESSION_IMPL *session)
784784
* active checkpoint, keep changes until checkpoint is finished.
785785
*/
786786
checkpoint_pinned = __wt_atomic_loadv64(&txn_global->checkpoint_txn_shared.pinned_id);
787-
if (checkpoint_pinned == WT_TXN_NONE || WT_TXNID_LT(oldest_id, checkpoint_pinned))
787+
if (checkpoint_pinned == WT_TXN_NONE || oldest_id < checkpoint_pinned)
788788
return (oldest_id);
789789
return (checkpoint_pinned);
790790
} else {
@@ -793,7 +793,7 @@ __wt_txn_oldest_id(WT_SESSION_IMPL *session)
793793
* changes until the recovery is finished.
794794
*/
795795
recovery_ckpt_snap_min = conn->recovery_ckpt_snap_min;
796-
if (recovery_ckpt_snap_min == WT_TXN_NONE || WT_TXNID_LT(oldest_id, recovery_ckpt_snap_min))
796+
if (recovery_ckpt_snap_min == WT_TXN_NONE || oldest_id < recovery_ckpt_snap_min)
797797
return (oldest_id);
798798
return (recovery_ckpt_snap_min);
799799
}
@@ -893,7 +893,7 @@ __txn_visible_all_id(WT_SESSION_IMPL *session, uint64_t id)
893893
txn->snapshot_data.snapshot, txn->snapshot_data.snapshot_count));
894894
oldest_id = __wt_txn_oldest_id(session);
895895

896-
return (WT_TXNID_LT(id, oldest_id));
896+
return (id < oldest_id);
897897
}
898898

899899
/*
@@ -1085,9 +1085,9 @@ __wt_txn_visible_id_snapshot(
10851085
* ids < snap_min are visible,
10861086
* everything else is visible unless it is found in the snapshot.
10871087
*/
1088-
if (WT_TXNID_LE(snap_max, id))
1088+
if (snap_max <= id)
10891089
return (false);
1090-
if (snapshot_count == 0 || WT_TXNID_LT(id, snap_min))
1090+
if (snapshot_count == 0 || id < snap_min)
10911091
return (true);
10921092

10931093
WT_BINARY_SEARCH(id, snapshot, snapshot_count, found);
@@ -1174,7 +1174,7 @@ __wt_txn_snap_min_visible(
11741174
WT_ASSERT(session, F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT));
11751175

11761176
/* Transaction snapshot minimum check. */
1177-
if (!WT_TXNID_LT(id, session->txn->snapshot_data.snap_min))
1177+
if (id >= session->txn->snapshot_data.snap_min)
11781178
return (false);
11791179

11801180
/* Transactions read their writes, regardless of timestamps. */

src/third_party/wiredtiger/src/reconcile/rec_visibility.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ __rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *first_up
601601
* ok to undo the work of the previous reconciliations.
602602
*/
603603
if (!F_ISSET(upd, WT_UPDATE_SELECT_FOR_DS) && !is_hs_page &&
604-
(F_ISSET(r, WT_REC_VISIBLE_ALL) ? WT_TXNID_LE(r->last_running, txnid) :
604+
(F_ISSET(r, WT_REC_VISIBLE_ALL) ? (r->last_running <= txnid) :
605605
!__txn_visible_id(session, txnid))) {
606606
/*
607607
* Rare case: metadata writes at read uncommitted isolation level, eviction may see a
@@ -655,7 +655,7 @@ __rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *first_up
655655
upd_select->upd = upd;
656656

657657
/* Track the selected update transaction id and timestamp. */
658-
if (WT_TXNID_LT(max_txn, txnid))
658+
if (max_txn < txnid)
659659
max_txn = txnid;
660660

661661
if (upd->start_ts > max_ts)
@@ -675,7 +675,7 @@ __rec_upd_select(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *first_up
675675
* reconciliation in the service of checkpoints, it is used to avoid discarding trees from
676676
* memory when they have changes required to satisfy a snapshot read.
677677
*/
678-
if (WT_TXNID_LT(r->max_txn, max_txn))
678+
if (r->max_txn < max_txn)
679679
r->max_txn = max_txn;
680680

681681
/* Update the maximum timestamp. */

src/third_party/wiredtiger/src/reconcile/rec_write.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ __reconcile_save_evict_state(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t fla
139139
* Check that transaction time always moves forward for a given page. If this check fails,
140140
* reconciliation can free something that a future reconciliation will need.
141141
*/
142-
WT_ASSERT(session, WT_TXNID_LE(mod->last_oldest_id, oldest_id));
142+
WT_ASSERT(session, mod->last_oldest_id <= oldest_id);
143143
mod->last_oldest_id = oldest_id;
144144
#endif
145145
}
@@ -413,7 +413,7 @@ __rec_write_page_status(WT_SESSION_IMPL *session, WTI_RECONCILE *r)
413413
* Track the tree's maximum transaction ID (used to decide if it's safe to discard the tree) and
414414
* maximum timestamp.
415415
*/
416-
if (WT_TXNID_LT(btree->rec_max_txn, r->max_txn))
416+
if (btree->rec_max_txn < r->max_txn)
417417
btree->rec_max_txn = r->max_txn;
418418
if (btree->rec_max_timestamp < r->max_ts)
419419
btree->rec_max_timestamp = r->max_ts;
@@ -632,7 +632,7 @@ __rec_init(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags, WT_SALVAGE_COO
632632
*/
633633
if (WT_IS_METADATA(session->dhandle)) {
634634
WT_ACQUIRE_READ_WITH_BARRIER(ckpt_txn, txn_global->checkpoint_txn_shared.id);
635-
if (ckpt_txn != WT_TXN_NONE && WT_TXNID_LT(ckpt_txn, r->last_running))
635+
if (ckpt_txn != WT_TXN_NONE && (ckpt_txn < r->last_running))
636636
r->last_running = ckpt_txn;
637637
}
638638
/* When operating on the history store table, we should never try history store eviction. */

src/third_party/wiredtiger/src/reconcile/reconcile_private.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
* Due to a difference in transaction id based visibility and timestamp visibility the timestamp
3232
* comparison is inclusive whereas the transaction id comparison isn't.
3333
*/
34-
#define WTI_REC_TW_START_VISIBLE_ALL(r, tw) \
35-
(WT_TXNID_LT((tw)->start_txn, (r)->rec_start_oldest_id) && \
36-
((tw)->durable_start_ts == WT_TS_NONE || \
37-
((r)->rec_start_pinned_ts != WT_TS_NONE && \
34+
#define WTI_REC_TW_START_VISIBLE_ALL(r, tw) \
35+
(((tw)->start_txn < (r)->rec_start_oldest_id) && \
36+
((tw)->durable_start_ts == WT_TS_NONE || \
37+
((r)->rec_start_pinned_ts != WT_TS_NONE && \
3838
(tw)->durable_start_ts <= (r)->rec_start_pinned_ts)))
3939

4040
/*

src/third_party/wiredtiger/src/session/session_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,8 +2193,7 @@ __session_transaction_pinned_range(WT_SESSION *wt_session, uint64_t *prange)
21932193

21942194
/* Assign pinned to the lesser of id or snap_min */
21952195
if (__wt_atomic_loadv64(&txn_shared->id) != WT_TXN_NONE &&
2196-
WT_TXNID_LT(
2197-
__wt_atomic_loadv64(&txn_shared->id), __wt_atomic_loadv64(&txn_shared->pinned_id)))
2196+
__wt_atomic_loadv64(&txn_shared->id) < __wt_atomic_loadv64(&txn_shared->pinned_id))
21982197
pinned = __wt_atomic_loadv64(&txn_shared->id);
21992198
else
22002199
pinned = __wt_atomic_loadv64(&txn_shared->pinned_id);

src/third_party/wiredtiger/src/txn/txn.c

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ __txn_remove_from_global_table(WT_SESSION_IMPL *session)
7777
txn_global = &S2C(session)->txn_global;
7878
txn_shared = WT_SESSION_TXN_SHARED(session);
7979

80-
WT_ASSERT(session, !WT_TXNID_LT(txn->id, __wt_atomic_loadv64(&txn_global->last_running)));
80+
WT_ASSERT(session, txn->id >= __wt_atomic_loadv64(&txn_global->last_running));
8181
WT_ASSERT(
8282
session, txn->id != WT_TXN_NONE && __wt_atomic_loadv64(&txn_shared->id) != WT_TXN_NONE);
8383
#else
@@ -104,7 +104,7 @@ __txn_sort_snapshot(WT_SESSION_IMPL *session, uint32_t n, uint64_t snap_max)
104104

105105
txn->snapshot_data.snapshot_count = n;
106106
txn->snapshot_data.snap_max = snap_max;
107-
txn->snapshot_data.snap_min = (n > 0 && WT_TXNID_LE(txn->snapshot_data.snapshot[0], snap_max)) ?
107+
txn->snapshot_data.snap_min = (n > 0 && txn->snapshot_data.snapshot[0] <= snap_max) ?
108108
txn->snapshot_data.snapshot[0] :
109109
snap_max;
110110
F_SET(txn, WT_TXN_HAS_SNAPSHOT);
@@ -174,7 +174,7 @@ __wt_txn_active(WT_SESSION_IMPL *session, uint64_t txnid)
174174
__wt_readlock(session, &txn_global->rwlock);
175175
oldest_id = __wt_atomic_loadv64(&txn_global->oldest_id);
176176

177-
if (WT_TXNID_LT(txnid, oldest_id)) {
177+
if (txnid < oldest_id) {
178178
active = false;
179179
goto done;
180180
}
@@ -277,7 +277,7 @@ __txn_get_snapshot_int(WT_SESSION_IMPL *session, bool update_shared_state)
277277
* not be visible to the current snapshot.
278278
*/
279279
while (s != txn_shared && (id = __wt_atomic_loadv64(&s->id)) != WT_TXN_NONE &&
280-
WT_TXNID_LE(prev_oldest_id, id) && WT_TXNID_LT(id, current_id)) {
280+
(prev_oldest_id <= id) && (id < current_id)) {
281281
/*
282282
* If the transaction is still allocating its ID, then we spin here until it gets its
283283
* valid ID.
@@ -293,7 +293,7 @@ __txn_get_snapshot_int(WT_SESSION_IMPL *session, bool update_shared_state)
293293
WT_ACQUIRE_BARRIER();
294294
if (id == __wt_atomic_loadv64(&s->id)) {
295295
txn->snapshot_data.snapshot[n++] = id;
296-
if (WT_TXNID_LT(id, pinned_id))
296+
if (id < pinned_id)
297297
pinned_id = id;
298298
break;
299299
}
@@ -306,7 +306,7 @@ __txn_get_snapshot_int(WT_SESSION_IMPL *session, bool update_shared_state)
306306
/*
307307
* If we got a new snapshot, update the published pinned ID for this session.
308308
*/
309-
WT_ASSERT(session, WT_TXNID_LE(prev_oldest_id, pinned_id));
309+
WT_ASSERT(session, prev_oldest_id <= pinned_id);
310310
WT_ASSERT(session, prev_oldest_id == __wt_atomic_loadv64(&txn_global->oldest_id));
311311
done:
312312
if (update_shared_state)
@@ -425,8 +425,8 @@ __txn_oldest_scan(WT_SESSION_IMPL *session, uint64_t *oldest_idp, uint64_t *last
425425
WT_STAT_CONN_INCR(session, txn_walk_sessions);
426426
for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) {
427427
/* Update the last running transaction ID. */
428-
while ((id = __wt_atomic_loadv64(&s->id)) != WT_TXN_NONE &&
429-
WT_TXNID_LE(prev_oldest_id, id) && WT_TXNID_LT(id, last_running)) {
428+
while ((id = __wt_atomic_loadv64(&s->id)) != WT_TXN_NONE && prev_oldest_id <= id &&
429+
id < last_running) {
430430
/*
431431
* If the transaction is still allocating its ID, then we spin here until it gets its
432432
* valid ID.
@@ -449,8 +449,7 @@ __txn_oldest_scan(WT_SESSION_IMPL *session, uint64_t *oldest_idp, uint64_t *last
449449
}
450450

451451
/* Update the metadata pinned ID. */
452-
if ((id = __wt_atomic_loadv64(&s->metadata_pinned)) != WT_TXN_NONE &&
453-
WT_TXNID_LT(id, metadata_pinned))
452+
if ((id = __wt_atomic_loadv64(&s->metadata_pinned)) != WT_TXN_NONE && id < metadata_pinned)
454453
metadata_pinned = id;
455454

456455
/*
@@ -461,19 +460,18 @@ __txn_oldest_scan(WT_SESSION_IMPL *session, uint64_t *oldest_idp, uint64_t *last
461460
* table. See the comment in __wt_txn_cursor_op for more
462461
* details.
463462
*/
464-
if ((id = __wt_atomic_loadv64(&s->pinned_id)) != WT_TXN_NONE &&
465-
WT_TXNID_LT(id, oldest_id)) {
463+
if ((id = __wt_atomic_loadv64(&s->pinned_id)) != WT_TXN_NONE && id < oldest_id) {
466464
oldest_id = id;
467465
oldest_session = &WT_CONN_SESSIONS_GET(conn)[i];
468466
}
469467
}
470468
WT_STAT_CONN_INCRV(session, txn_sessions_walked, i);
471469

472-
if (WT_TXNID_LT(last_running, oldest_id))
470+
if (last_running < oldest_id)
473471
oldest_id = last_running;
474472

475473
/* The metadata pinned ID can't move past the oldest ID. */
476-
if (WT_TXNID_LT(oldest_id, metadata_pinned))
474+
if (oldest_id < metadata_pinned)
477475
metadata_pinned = oldest_id;
478476

479477
*last_runningp = last_running;
@@ -522,7 +520,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags)
522520
* behind, avoid scanning.
523521
*/
524522
if ((prev_oldest_id == current_id && prev_metadata_pinned == current_id) ||
525-
(!strict && WT_TXNID_LT(current_id, prev_oldest_id + non_strict_min_threshold)))
523+
(!strict && current_id < prev_oldest_id + non_strict_min_threshold))
526524
return (0);
527525

528526
/* First do a read-only scan. */
@@ -537,9 +535,9 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags)
537535
* If the state hasn't changed (or hasn't moved far enough for non-forced updates), give up.
538536
*/
539537
if ((oldest_id == prev_oldest_id ||
540-
(!strict && WT_TXNID_LT(oldest_id, prev_oldest_id + non_strict_min_threshold))) &&
538+
(!strict && (oldest_id < prev_oldest_id + non_strict_min_threshold))) &&
541539
((last_running == prev_last_running) ||
542-
(!strict && WT_TXNID_LT(last_running, prev_last_running + non_strict_min_threshold))) &&
540+
(!strict && last_running < prev_last_running + non_strict_min_threshold)) &&
543541
metadata_pinned == prev_metadata_pinned)
544542
return (0);
545543

@@ -552,9 +550,9 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags)
552550
/*
553551
* If the oldest ID has been updated while we waited, don't bother scanning.
554552
*/
555-
if (WT_TXNID_LE(oldest_id, __wt_atomic_loadv64(&txn_global->oldest_id)) &&
556-
WT_TXNID_LE(last_running, __wt_atomic_loadv64(&txn_global->last_running)) &&
557-
WT_TXNID_LE(metadata_pinned, __wt_atomic_loadv64(&txn_global->metadata_pinned)))
553+
if (oldest_id <= __wt_atomic_loadv64(&txn_global->oldest_id) &&
554+
last_running <= __wt_atomic_loadv64(&txn_global->last_running) &&
555+
metadata_pinned <= __wt_atomic_loadv64(&txn_global->metadata_pinned))
558556
goto done;
559557

560558
/*
@@ -565,19 +563,19 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, uint32_t flags)
565563
__txn_oldest_scan(session, &oldest_id, &last_running, &metadata_pinned, &oldest_session);
566564

567565
/* Update the public IDs. */
568-
if (WT_TXNID_LT(__wt_atomic_loadv64(&txn_global->metadata_pinned), metadata_pinned))
566+
if (__wt_atomic_loadv64(&txn_global->metadata_pinned) < metadata_pinned)
569567
__wt_atomic_storev64(&txn_global->metadata_pinned, metadata_pinned);
570-
if (WT_TXNID_LT(__wt_atomic_loadv64(&txn_global->oldest_id), oldest_id))
568+
if (__wt_atomic_loadv64(&txn_global->oldest_id) < oldest_id)
571569
__wt_atomic_storev64(&txn_global->oldest_id, oldest_id);
572-
if (WT_TXNID_LT(__wt_atomic_loadv64(&txn_global->last_running), last_running)) {
570+
if (__wt_atomic_loadv64(&txn_global->last_running) < last_running) {
573571
__wt_atomic_storev64(&txn_global->last_running, last_running);
574572

575573
/*
576574
* Output a verbose message about long-running transactions, but only when some progress is
577575
* being made.
578576
*/
579577
current_id = __wt_atomic_loadv64(&txn_global->current);
580-
WT_ASSERT(session, WT_TXNID_LE(oldest_id, current_id));
578+
WT_ASSERT(session, oldest_id <= current_id);
581579
if (WT_VERBOSE_ISSET(session, WT_VERB_TRANSACTION) &&
582580
current_id - oldest_id > (10 * WT_THOUSAND) && oldest_session != NULL) {
583581
__wt_verbose(session, WT_VERB_TRANSACTION,

0 commit comments

Comments
 (0)