summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_visibility.c')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_visibility.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
index 3c3e3d4c575..155470afe28 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
@@ -679,16 +679,25 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, W
* Set the flag if the selected tombstone is an out-of-order or mixed mode to an update. Based
* on this flag, the caller functions perform the history store truncation for this key.
*/
- if (tombstone != NULL &&
+ if (!is_hs_page && tombstone != NULL &&
!F_ISSET(tombstone, WT_UPDATE_RESTORED_FROM_DS | WT_UPDATE_RESTORED_FROM_HS)) {
upd = upd_select->upd;
- WT_ASSERT(session, upd != NULL);
+ /*
+ * The selected update can be the tombstone itself when the tombstone is globally visible.
+ * Compare the tombstone's timestamp with either the next update in the update list or the
+ * on-disk cell timestamp to determine if the tombstone is an out-of-order or mixed mode.
+ */
+ if (tombstone == upd) {
+ upd = upd->next;
- if (upd->start_ts > tombstone->start_ts)
- upd_select->ooo_tombstone = true;
+ /* Loop until a valid update is found. */
+ while (upd != NULL && upd->txnid == WT_TXN_ABORTED)
+ upd = upd->next;
+ }
- if (vpack != NULL && vpack->tw.start_ts > upd->start_ts)
+ if ((upd != NULL && upd->start_ts > tombstone->start_ts) ||
+ (vpack != NULL && vpack->tw.start_ts > tombstone->start_ts))
upd_select->ooo_tombstone = true;
}