diff options
author | Etienne Petrel <etienne.petrel@mongodb.com> | 2022-03-16 03:39:44 +0000 |
---|---|---|
committer | Etienne Petrel <etienne.petrel@mongodb.com> | 2022-03-16 03:39:44 +0000 |
commit | d3212c756a97c47989239bbd440a3617a2bc2115 (patch) | |
tree | f0e149d9958989c900d5346a0d9c259fcc4265fc | |
parent | 9f501796f236d4fcd1d5f502dab778020603eddd (diff) | |
download | mongo-d3212c756a97c47989239bbd440a3617a2bc2115.tar.gz |
Import wiredtiger: fc1d5325d2a36711d0618211a72d38f1e8d4d139 from branch mongodb-5.3
ref: 09610264e1..fc1d5325d2
for: 5.3.0-rc4
WT-8879 Set the OOO flag when the selected tombstone is globally visible
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/reconcile/rec_visibility.c | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 220a8b55129..38f623e6983 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-5.3", - "commit": "09610264e13a80c67c83f72814a22865c2f43f41" + "commit": "fc1d5325d2a36711d0618211a72d38f1e8d4d139" } diff --git a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c index 8d92a123813..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; - while (upd != NULL && upd->txnid == WT_TXN_ABORTED) + + /* + * 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 != NULL && 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; } |