summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-07-07 18:52:06 +1000
committerLuke Chen <luke.chen@mongodb.com>2021-07-07 18:52:06 +1000
commit5ecdb834013bb9b3a267bc6c73e2101a2f8a73b1 (patch)
tree696efcb7565bfa437ed355eb842f6d8d5b960e82
parentf851ef3784a4fbe9ce516947a85b6f9d39a908a2 (diff)
downloadmongo-r5.0.0-rc8.tar.gz
Import wiredtiger: cca84e5abd6c9e14a75d8ab28bf7299d13b5b47b from branch mongodb-5.0r5.0.0-rc8
ref: f66db27218..cca84e5abd for: 5.0.0-rc8 WT-7783 Fix RTS to restore tombstone when an on-disk update is out of order prepare update
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c13
2 files changed, 9 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 83a52630cf7..6c642b85229 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": "f66db272184f1597839500e12b11a6eb9470b517"
+ "commit": "cca84e5abd6c9e14a75d8ab28bf7299d13b5b47b"
}
diff --git a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
index bae70f90ac4..a79c4d2bc4c 100644
--- a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
+++ b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
@@ -491,15 +491,18 @@ __rollback_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_REF *ref, WT_PAGE *page
WT_STAT_CONN_DATA_INCR(session, txn_rts_hs_restore_updates);
/*
- * We have a tombstone on the original update chain and it is behind or equal to the
- * stable timestamp, we need to restore that as well.
+ * We have a tombstone on the original update chain and it is stable according to the
+ * timestamp and txnid, we need to restore that as well.
*/
- if (hs_stop_durable_ts <= rollback_timestamp) {
+ if (!__rollback_check_if_txnid_non_committed(session, hs_tw->stop_txn) &&
+ hs_stop_durable_ts <= rollback_timestamp) {
/*
- * The restoring tombstone timestamp must be less than previous update start
+ * The restoring tombstone timestamp must be zero or less than previous update start
* timestamp or the on-disk update is an out of order prepared.
*/
- WT_ASSERT(session, hs_stop_durable_ts < newer_hs_durable_ts || unpack->tw.prepare);
+ WT_ASSERT(session,
+ hs_stop_durable_ts == WT_TS_NONE || hs_stop_durable_ts < newer_hs_durable_ts ||
+ unpack->tw.prepare);
WT_ERR(__wt_upd_alloc_tombstone(session, &tombstone, NULL));
/*