diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-03-18 15:07:02 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-18 04:28:44 +0000 |
commit | d1d1bd5258a14092b4d5b482a2250364bc6858d2 (patch) | |
tree | 658f49f53fc8a3efc2dc67483dc83aa547bf683e | |
parent | 0a9102423f7199472f99197539680375df467524 (diff) | |
download | mongo-d1d1bd5258a14092b4d5b482a2250364bc6858d2.tar.gz |
Import wiredtiger: 3b6a65170adf05883a55b5d0175547ab6e3c6912 from branch mongodb-5.0
ref: 8c170bbf34..3b6a65170a
for: 5.0.7
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 4cc9a0bd40f..94395d21a68 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.0", - "commit": "8c170bbf340667285f3720fa7b09836e3d34c786" + "commit": "3b6a65170adf05883a55b5d0175547ab6e3c6912" } diff --git a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c index ea11fa1587a..64ff9d361ae 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c @@ -717,16 +717,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; } |