-
Type:
Task
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: Reconciliation, Timestamps
-
Storage Engines, Storage Engines - Transactions
-
0.038
-
SE Transactions - 2026-05-08
-
1
The WT_TIME_WINDOW_SET_START and WT_TIME_WINDOW_SET_STOP macros in src/include/timestamp_inline.h previously read txnid unconditionally before the write_prepare branch, then applied a WT_ACQUIRE_BARRIER() only in the aborted-transaction fallback path.
This change:
- Moves the txnid read inside the write_prepare branch so the correct memory ordering is applied per code path.
- In the prepare path, replaces the direct read + WT_ACQUIRE_BARRIER() with __wt_atomic_load_uint64_v_acquire, making acquire semantics explicit.
- In the non-prepare path, uses __wt_atomic_load_uint64_v_relaxed since acquire ordering is not required there.
- For the aborted-transaction fallback (upd_saved_txnid), uses __wt_atomic_load_uint64_relaxed instead of a plain read after a barrier.
This eliminates the ad-hoc barrier, makes the intended memory ordering self-documenting, and ensures only the paths that need acquire semantics pay for them.