summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c')
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c13
1 files changed, 12 insertions, 1 deletions
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 d3c2adc3596..37269ec53f1 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
@@ -1921,9 +1921,20 @@ __rollback_to_stable(WT_SESSION_IMPL *session, bool no_ckpt)
WT_ERR(__rollback_to_stable_check(session));
- /* Update the oldest id to get a consistent view of global visibility. */
+ /*
+ * Update the global time window state to have consistent view from global visibility rules for
+ * the rollback to stable to bring back the database into a consistent state.
+ *
+ * As part of the below function call, the oldest transaction id and pinned timestamps are
+ * updated.
+ */
WT_ERR(__wt_txn_update_oldest(session, WT_TXN_OLDEST_STRICT | WT_TXN_OLDEST_WAIT));
+ WT_ASSERT_ALWAYS(session,
+ (txn_global->has_pinned_timestamp || !txn_global->has_oldest_timestamp),
+ "Database has no pinned timestamp but an oldest timestamp. Pinned timestamp is required to "
+ "find out the global visibility/obsolete of an update.");
+
/*
* Copy the stable timestamp, otherwise we'd need to lock it each time it's accessed. Even
* though the stable timestamp isn't supposed to be updated while rolling back, accessing it