summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-05-21 17:27:38 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-21 07:53:11 +0000
commit86a73ffa9f6d38f878420e4e2da68deb4d01d66b (patch)
tree01f990c201cd0d341588d7687efbfbdf959f8d00 /src/third_party/wiredtiger/src/reconcile/rec_visibility.c
parent607a0ac8c11e32af57aafe56f8adfd80f5d03b4b (diff)
downloadmongo-86a73ffa9f6d38f878420e4e2da68deb4d01d66b.tar.gz
Import wiredtiger: 25c305c94d2ba492841a7c2a270d9a92ea1fb284 from branch mongodb-4.4
ref: 7bf362af19..25c305c94d for: 4.4.0-rc7 WT-6212 Dump failure message to Evergreen log for checkpoint-stress-test WT-6232 Fix the logic that incorrectly returns EINVAL for in_mem config with prepared transactions WT-6238 Fix salvage panic seeing prepared updates restored from disk WT-6248 Add HS records to page dumps WT-6285 Only retry reading if the prepared update is restored from the disk
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_visibility.c')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_visibility.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
index 9e9dd627be2..758a47c00d4 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_visibility.c
@@ -314,11 +314,11 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v
continue;
}
- /* Ignore prepared updates if it is not eviction. */
+ /* Ignore prepared updates if it is checkpoint. */
if (upd->prepare_state == WT_PREPARE_LOCKED ||
upd->prepare_state == WT_PREPARE_INPROGRESS) {
WT_ASSERT(session, upd_select->upd == NULL || upd_select->upd->txnid == upd->txnid);
- if (!F_ISSET(r, WT_REC_EVICT)) {
+ if (F_ISSET(r, WT_REC_CHECKPOINT)) {
has_newer_updates = true;
if (upd->start_ts > max_ts)
max_ts = upd->start_ts;
@@ -330,8 +330,18 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v
if (upd->start_ts < r->min_skipped_ts)
r->min_skipped_ts = upd->start_ts;
continue;
- } else
+ } else {
+ /*
+ * For prepared updates written to the date store in salvage, we write the same
+ * prepared value to the date store. If there is still content for that key left in
+ * the history store, rollback to stable will bring it back to the data store.
+ * Otherwise, it removes the key.
+ */
+ WT_ASSERT(session, F_ISSET(r, WT_REC_EVICT) ||
+ (F_ISSET(r, WT_REC_VISIBILITY_ERR) &&
+ F_ISSET(upd, WT_UPDATE_PREPARE_RESTORED_FROM_DISK)));
WT_ASSERT(session, upd->prepare_state == WT_PREPARE_INPROGRESS);
+ }
}
/* Track the first update with non-zero timestamp. */