summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtienne Petrel <etienne.petrel@mongodb.com>2022-03-14 04:17:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-14 04:53:58 +0000
commitf5da0ae928daf0366aeba3391b2865147c83f4eb (patch)
tree0b127845fedf6e7698aaf53fa4eae819044b8980
parent5511d55145e07df732209de362e551582d5e5bc3 (diff)
downloadmongo-f5da0ae928daf0366aeba3391b2865147c83f4eb.tar.gz
Import wiredtiger: 23e5746ea948e3b1ac903f2cce3ea209e19329a1 from branch mongodb-master
ref: 5e2e0e9d66..23e5746ea9 for: 6.0.0 WT-8879 Set the OOO flag when the selected tombstone is globally visible
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_visibility.c19
2 files changed, 15 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 4d057dd5fbb..86408a28926 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "5e2e0e9d66e7c02b5643257871280e63be420ab5"
+ "commit": "23e5746ea948e3b1ac903f2cce3ea209e19329a1"
}
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;
}