diff --git a/src/txn/txn_rollback_to_stable.c b/src/txn/txn_rollback_to_stable.c
index 90ec9389d..66e7b3407 100644
--- a/src/txn/txn_rollback_to_stable.c
+++ b/src/txn/txn_rollback_to_stable.c
@@ -8,6 +8,14 @@
 
 #include "wt_internal.h"
 
+/*
+ * Simple struct to store the rollback timestamp and rollback transaction id.
+ */
+typedef struct {
+    wt_timestamp_t rollback_timestamp;
+    uint64_t rollback_txnid;
+} WT_ROLLBACK_TIME_TXN_PAIR;
+
 /*
  * __rollback_abort_newer_update --
  *     Abort updates in an update change with timestamps newer than the rollback timestamp. Also,
@@ -15,7 +23,7 @@
  */
 static void
 __rollback_abort_newer_update(WT_SESSION_IMPL *session, WT_UPDATE *first_upd,
-  wt_timestamp_t rollback_timestamp, bool *stable_update_found)
+  WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair, bool *stable_update_found)
 {
     WT_UPDATE *upd;
     char ts_string[2][WT_TS_INT_STRING_SIZE];
@@ -26,7 +34,7 @@ __rollback_abort_newer_update(WT_SESSION_IMPL *session, WT_UPDATE *first_upd,
         if (upd->txnid == WT_TXN_ABORTED) {
             if (upd == first_upd)
                 first_upd = upd->next;
-        } else if (rollback_timestamp < upd->durable_ts ||
+        } else if (rollback_time_txn_pair->rollback_timestamp < upd->durable_ts ||
           upd->prepare_state == WT_PREPARE_INPROGRESS) {
             /*
              * If any updates are aborted, all newer updates better be aborted as well.
@@ -44,8 +52,8 @@ __rollback_abort_newer_update(WT_SESSION_IMPL *session, WT_UPDATE *first_upd,
               "rollback to stable update aborted with txnid: %" PRIu64
               " durable timestamp: %s and stable timestamp: %s, prepared: %s",
               upd->txnid, __wt_timestamp_to_string(upd->durable_ts, ts_string[0]),
-              __wt_timestamp_to_string(rollback_timestamp, ts_string[1]),
-              rollback_timestamp < upd->durable_ts ? "false" : "true");
+              __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[1]),
+              rollback_time_txn_pair->rollback_timestamp < upd->durable_ts ? "false" : "true");
 
             upd->txnid = WT_TXN_ABORTED;
             WT_STAT_CONN_INCR(session, txn_rts_upd_aborted);
@@ -75,7 +83,7 @@ __rollback_abort_newer_update(WT_SESSION_IMPL *session, WT_UPDATE *first_upd,
  */
 static void
 __rollback_abort_newer_insert(
-  WT_SESSION_IMPL *session, WT_INSERT_HEAD *head, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_INSERT_HEAD *head, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_INSERT *ins;
     bool stable_update_found;
@@ -83,7 +91,7 @@ __rollback_abort_newer_insert(
     WT_SKIP_FOREACH (ins, head)
         if (ins->upd != NULL)
             __rollback_abort_newer_update(
-              session, ins->upd, rollback_timestamp, &stable_update_found);
+              session, ins->upd, rollback_time_txn_pair, &stable_update_found);
 }
 
 /*
@@ -153,7 +161,7 @@ err:
  */
 static int
 __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip,
-  wt_timestamp_t rollback_timestamp, bool replace)
+  WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair, bool replace)
 {
     WT_CELL_UNPACK_KV *unpack, _unpack;
     WT_CURSOR *hs_cursor;
@@ -278,23 +286,23 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW
          * update chain. Also it confirms that history store doesn't contains any newer version than
          * the current version for the key.
          */
-        if (!replace && hs_stop_durable_ts <= rollback_timestamp) {
+        if (!replace && hs_stop_durable_ts <= rollback_time_txn_pair->rollback_timestamp) {
             __wt_verbose(session, WT_VERB_RTS,
               "history store update valid with stop timestamp: %s and stable timestamp: %s",
               __wt_timestamp_to_string(hs_stop_durable_ts, ts_string[0]),
-              __wt_timestamp_to_string(rollback_timestamp, ts_string[1]));
+              __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[1]));
             break;
         }
 
         /* Stop processing when we find a stable update according to the given timestamp. */
-        if (hs_durable_ts <= rollback_timestamp) {
+        if (hs_durable_ts <= rollback_time_txn_pair->rollback_timestamp) {
             __wt_verbose(session, WT_VERB_RTS,
               "history store update valid with start timestamp: %s, durable timestamp: %s, stop "
               "timestamp: %s and stable timestamp: %s",
               __wt_timestamp_to_string(hs_start_ts, ts_string[0]),
               __wt_timestamp_to_string(hs_durable_ts, ts_string[1]),
               __wt_timestamp_to_string(hs_stop_durable_ts, ts_string[2]),
-              __wt_timestamp_to_string(rollback_timestamp, ts_string[3]));
+              __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[3]));
             valid_update_found = true;
             break;
         }
@@ -305,7 +313,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW
           __wt_timestamp_to_string(hs_start_ts, ts_string[0]),
           __wt_timestamp_to_string(hs_durable_ts, ts_string[1]),
           __wt_timestamp_to_string(hs_stop_durable_ts, ts_string[2]),
-          __wt_timestamp_to_string(rollback_timestamp, ts_string[3]));
+          __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[3]));
 
         /*
          * Start time point of the current record may be used as stop time point of the previous
@@ -352,7 +360,7 @@ __rollback_row_ondisk_fixup_key(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW
              * We have a tombstone on the original update chain and it is behind the stable
              * timestamp, we need to restore that as well.
              */
-            if (hs_stop_durable_ts <= rollback_timestamp &&
+            if (hs_stop_durable_ts <= rollback_time_txn_pair->rollback_timestamp &&
               hs_stop_durable_ts < newer_hs_durable_ts) {
                 WT_ERR(__wt_upd_alloc_tombstone(session, &tombstone, NULL));
                 tombstone->txnid = cbt->upd_value->tw.stop_txn;
@@ -414,8 +422,8 @@ err:
  *     Fix the on-disk row K/V version according to the given timestamp.
  */
 static int
-__rollback_abort_row_ondisk_kv(
-  WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, wt_timestamp_t rollback_timestamp)
+__rollback_abort_row_ondisk_kv(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip,
+  WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_CELL_UNPACK_KV *vpack, _vpack;
     WT_DECL_RET;
@@ -436,7 +444,8 @@ __rollback_abort_row_ondisk_kv(
          * timestamp or the updates with max stop timestamp which implies that they are associated
          * with prepared transactions.
          */
-        if (vpack->tw.durable_stop_ts > rollback_timestamp || vpack->tw.stop_ts == WT_TS_MAX) {
+        if (vpack->tw.durable_stop_ts > rollback_time_txn_pair->rollback_timestamp ||
+          vpack->tw.stop_ts == WT_TS_MAX) {
             __wt_verbose(session, WT_VERB_RTS,
               "hs update aborted with start durable/commit timestamp: %s, %s, stop durable/commit "
               "timestamp: %s, %s and stable timestamp: %s",
@@ -444,22 +453,23 @@ __rollback_abort_row_ondisk_kv(
               __wt_timestamp_to_string(vpack->tw.start_ts, ts_string[1]),
               __wt_timestamp_to_string(vpack->tw.durable_stop_ts, ts_string[2]),
               __wt_timestamp_to_string(vpack->tw.stop_ts, ts_string[3]),
-              __wt_timestamp_to_string(rollback_timestamp, ts_string[4]));
+              __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[4]));
             WT_RET(__wt_upd_alloc_tombstone(session, &upd, NULL));
             WT_STAT_CONN_INCR(session, txn_rts_sweep_hs_keys);
             WT_STAT_DATA_INCR(session, txn_rts_sweep_hs_keys);
         } else
             return (0);
-    } else if (vpack->tw.durable_start_ts > rollback_timestamp ||
+    } else if (vpack->tw.durable_start_ts > rollback_time_txn_pair->rollback_timestamp ||
       (!WT_TIME_WINDOW_HAS_STOP(&vpack->tw) && prepared)) {
         __wt_verbose(session, WT_VERB_RTS,
           "on-disk update aborted with start durable timestamp: %s, commit timestamp: %s, "
           "prepared: %s and stable timestamp: %s",
           __wt_timestamp_to_string(vpack->tw.durable_start_ts, ts_string[0]),
           __wt_timestamp_to_string(vpack->tw.start_ts, ts_string[1]), prepared ? "true" : "false",
-          __wt_timestamp_to_string(rollback_timestamp, ts_string[2]));
+          __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[2]));
         if (!F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
-            return (__rollback_row_ondisk_fixup_key(session, page, rip, rollback_timestamp, true));
+            return (
+              __rollback_row_ondisk_fixup_key(session, page, rip, rollback_time_txn_pair, true));
         else {
             /*
              * In-memory database don't have a history store to provide a stable update, so remove
@@ -470,7 +480,7 @@ __rollback_abort_row_ondisk_kv(
             WT_STAT_DATA_INCR(session, txn_rts_keys_removed);
         }
     } else if (WT_TIME_WINDOW_HAS_STOP(&vpack->tw) &&
-      (vpack->tw.durable_stop_ts > rollback_timestamp || prepared)) {
+      (vpack->tw.durable_stop_ts > rollback_time_txn_pair->rollback_timestamp || prepared)) {
         /*
          * Clear the remove operation from the key by inserting the original on-disk value as a
          * standard update.
@@ -513,7 +523,7 @@ err:
  */
 static void
 __rollback_abort_newer_col_var(
-  WT_SESSION_IMPL *session, WT_PAGE *page, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_COL *cip;
     WT_INSERT_HEAD *ins;
@@ -522,11 +532,11 @@ __rollback_abort_newer_col_var(
     /* Review the changes to the original on-page data items */
     WT_COL_FOREACH (page, cip, i)
         if ((ins = WT_COL_UPDATE(page, cip)) != NULL)
-            __rollback_abort_newer_insert(session, ins, rollback_timestamp);
+            __rollback_abort_newer_insert(session, ins, rollback_time_txn_pair);
 
     /* Review the append list */
     if ((ins = WT_COL_APPEND(page)) != NULL)
-        __rollback_abort_newer_insert(session, ins, rollback_timestamp);
+        __rollback_abort_newer_insert(session, ins, rollback_time_txn_pair);
 }
 
 /*
@@ -536,17 +546,17 @@ __rollback_abort_newer_col_var(
  */
 static void
 __rollback_abort_newer_col_fix(
-  WT_SESSION_IMPL *session, WT_PAGE *page, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_INSERT_HEAD *ins;
 
     /* Review the changes to the original on-page data items */
     if ((ins = WT_COL_UPDATE_SINGLE(page)) != NULL)
-        __rollback_abort_newer_insert(session, ins, rollback_timestamp);
+        __rollback_abort_newer_insert(session, ins, rollback_time_txn_pair);
 
     /* Review the append list */
     if ((ins = WT_COL_APPEND(page)) != NULL)
-        __rollback_abort_newer_insert(session, ins, rollback_timestamp);
+        __rollback_abort_newer_insert(session, ins, rollback_time_txn_pair);
 }
 
 /*
@@ -555,7 +565,7 @@ __rollback_abort_newer_col_fix(
  */
 static int
 __rollback_abort_row_reconciled_page_internal(WT_SESSION_IMPL *session, const void *image,
-  const uint8_t *addr, size_t addr_size, wt_timestamp_t rollback_timestamp)
+  const uint8_t *addr, size_t addr_size, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_DECL_RET;
     WT_ITEM tmp;
@@ -584,7 +594,7 @@ __rollback_abort_row_reconciled_page_internal(WT_SESSION_IMPL *session, const vo
     tmp.mem = NULL;
     WT_ROW_FOREACH (mod_page, rip, i)
         WT_ERR_NOTFOUND_OK(
-          __rollback_row_ondisk_fixup_key(session, mod_page, rip, rollback_timestamp, false),
+          __rollback_row_ondisk_fixup_key(session, mod_page, rip, rollback_time_txn_pair, false),
           false);
 
 err:
@@ -601,7 +611,7 @@ err:
  */
 static int
 __rollback_abort_row_reconciled_page(
-  WT_SESSION_IMPL *session, WT_PAGE *page, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_MULTI *multi;
     WT_PAGE_MODIFY *mod;
@@ -612,20 +622,20 @@ __rollback_abort_row_reconciled_page(
         return (0);
 
     if (mod->rec_result == WT_PM_REC_REPLACE &&
-      (mod->mod_replace.ta.newest_start_durable_ts > rollback_timestamp ||
-        mod->mod_replace.ta.newest_stop_durable_ts > rollback_timestamp ||
+      (mod->mod_replace.ta.newest_start_durable_ts > rollback_time_txn_pair->rollback_timestamp ||
+        mod->mod_replace.ta.newest_stop_durable_ts > rollback_time_txn_pair->rollback_timestamp ||
         mod->mod_replace.ta.prepare)) {
         __wt_verbose(session, WT_VERB_RTS,
           "reconciled replace block page history store update removal on-disk with start durable "
           "timestamp: %s, stop durable timestamp: %s and stable timestamp: %s",
           __wt_timestamp_to_string(mod->mod_replace.ta.newest_start_durable_ts, ts_string[0]),
           __wt_timestamp_to_string(mod->mod_replace.ta.newest_stop_durable_ts, ts_string[1]),
-          __wt_timestamp_to_string(rollback_timestamp, ts_string[2]));
+          __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[2]));
 
         /* Remove the history store newer updates. */
         if (!WT_IS_HS(S2BT(session)))
             WT_RET(__rollback_abort_row_reconciled_page_internal(session, mod->u1.r.disk_image,
-              mod->u1.r.replace.addr, mod->u1.r.replace.size, rollback_timestamp));
+              mod->u1.r.replace.addr, mod->u1.r.replace.size, rollback_time_txn_pair));
 
         /*
          * As this page has newer aborts that are aborted, make sure to mark the page as dirty to
@@ -636,20 +646,22 @@ __rollback_abort_row_reconciled_page(
     } else if (mod->rec_result == WT_PM_REC_MULTIBLOCK) {
         for (multi = mod->mod_multi, multi_entry = 0; multi_entry < mod->mod_multi_entries;
              ++multi, ++multi_entry)
-            if (multi->addr.ta.newest_start_durable_ts > rollback_timestamp ||
-              multi->addr.ta.newest_stop_durable_ts > rollback_timestamp ||
+            if (multi->addr.ta.newest_start_durable_ts >
+                rollback_time_txn_pair->rollback_timestamp ||
+              multi->addr.ta.newest_stop_durable_ts > rollback_time_txn_pair->rollback_timestamp ||
               multi->addr.ta.prepare) {
                 __wt_verbose(session, WT_VERB_RTS,
                   "reconciled multi block page history store update removal on-disk with start "
                   "durable timestamp: %s, stop durable timestamp: %s and stable timestamp: %s",
                   __wt_timestamp_to_string(multi->addr.ta.newest_start_durable_ts, ts_string[0]),
                   __wt_timestamp_to_string(multi->addr.ta.newest_stop_durable_ts, ts_string[1]),
-                  __wt_timestamp_to_string(rollback_timestamp, ts_string[2]));
+                  __wt_timestamp_to_string(
+                    rollback_time_txn_pair->rollback_timestamp, ts_string[2]));
 
                 /* Remove the history store newer updates. */
                 if (!WT_IS_HS(S2BT(session)))
                     WT_RET(__rollback_abort_row_reconciled_page_internal(session, multi->disk_image,
-                      multi->addr.addr, multi->addr.size, rollback_timestamp));
+                      multi->addr.addr, multi->addr.size, rollback_time_txn_pair));
 
                 /*
                  * As this page has newer aborts that are aborted, make sure to mark the page as
@@ -670,7 +682,7 @@ __rollback_abort_row_reconciled_page(
  */
 static int
 __rollback_abort_newer_row_leaf(
-  WT_SESSION_IMPL *session, WT_PAGE *page, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_INSERT_HEAD *insert;
     WT_ROW *rip;
@@ -682,7 +694,7 @@ __rollback_abort_newer_row_leaf(
      * Review the insert list for keys before the first entry on the disk page.
      */
     if ((insert = WT_ROW_INSERT_SMALLEST(page)) != NULL)
-        __rollback_abort_newer_insert(session, insert, rollback_timestamp);
+        __rollback_abort_newer_insert(session, insert, rollback_time_txn_pair);
 
     /*
      * Review updates that belong to keys that are on the disk image, as well as for keys inserted
@@ -691,16 +703,17 @@ __rollback_abort_newer_row_leaf(
     WT_ROW_FOREACH (page, rip, i) {
         stable_update_found = false;
         if ((upd = WT_ROW_UPDATE(page, rip)) != NULL)
-            __rollback_abort_newer_update(session, upd, rollback_timestamp, &stable_update_found);
+            __rollback_abort_newer_update(
+              session, upd, rollback_time_txn_pair, &stable_update_found);
 
         if ((insert = WT_ROW_INSERT(page, rip)) != NULL)
-            __rollback_abort_newer_insert(session, insert, rollback_timestamp);
+            __rollback_abort_newer_insert(session, insert, rollback_time_txn_pair);
 
         /*
          * If there is no stable update found in the update list, abort any on-disk value.
          */
         if (!stable_update_found)
-            WT_RET(__rollback_abort_row_ondisk_kv(session, page, rip, rollback_timestamp));
+            WT_RET(__rollback_abort_row_ondisk_kv(session, page, rip, rollback_time_txn_pair));
     }
 
     /*
@@ -708,7 +721,7 @@ __rollback_abort_newer_row_leaf(
      * of data store.
      */
     if (!F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
-        WT_RET(__rollback_abort_row_reconciled_page(session, page, rollback_timestamp));
+        WT_RET(__rollback_abort_row_reconciled_page(session, page, rollback_time_txn_pair));
     return (0);
 }
 
@@ -737,7 +750,7 @@ __rollback_get_ref_max_durable_timestamp(WT_SESSION_IMPL *session, WT_TIME_AGGRE
  */
 static bool
 __rollback_page_needs_abort(
-  WT_SESSION_IMPL *session, WT_REF *ref, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_REF *ref, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_ADDR *addr;
     WT_CELL_UNPACK_ADDR vpack;
@@ -767,7 +780,7 @@ __rollback_page_needs_abort(
         tag = "reconciled replace block";
         durable_ts = __rollback_get_ref_max_durable_timestamp(session, &mod->mod_replace.ta);
         prepared = mod->mod_replace.ta.prepare;
-        result = (durable_ts > rollback_timestamp) || prepared;
+        result = (durable_ts > rollback_time_txn_pair->rollback_timestamp) || prepared;
     } else if (mod != NULL && mod->rec_result == WT_PM_REC_MULTIBLOCK) {
         tag = "reconciled multi block";
         /* Calculate the max durable timestamp by traversing all multi addresses. */
@@ -777,19 +790,19 @@ __rollback_page_needs_abort(
             if (multi->addr.ta.prepare)
                 prepared = true;
         }
-        result = (durable_ts > rollback_timestamp) || prepared;
+        result = (durable_ts > rollback_time_txn_pair->rollback_timestamp) || prepared;
     } else if (!__wt_off_page(ref->home, addr)) {
         tag = "on page cell";
         /* Check if the page is obsolete using the page disk address. */
         __wt_cell_unpack_addr(session, ref->home->dsk, (WT_CELL *)addr, &vpack);
         durable_ts = __rollback_get_ref_max_durable_timestamp(session, &vpack.ta);
         prepared = vpack.ta.prepare;
-        result = (durable_ts > rollback_timestamp) || prepared;
+        result = (durable_ts > rollback_time_txn_pair->rollback_timestamp) || prepared;
     } else if (addr != NULL) {
         tag = "address";
         durable_ts = __rollback_get_ref_max_durable_timestamp(session, &addr->ta);
         prepared = addr->ta.prepare;
-        result = (durable_ts > rollback_timestamp) || prepared;
+        result = (durable_ts > rollback_time_txn_pair->rollback_timestamp) || prepared;
     }
 
     __wt_verbose(session, WT_VERB_RTS,
@@ -805,12 +818,13 @@ __rollback_page_needs_abort(
  */
 static int
 __rollback_abort_newer_updates(
-  WT_SESSION_IMPL *session, WT_REF *ref, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_REF *ref, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_PAGE *page;
 
     /* Review deleted page saved to the ref. */
-    if (ref->page_del != NULL && rollback_timestamp < ref->page_del->durable_timestamp) {
+    if (ref->page_del != NULL &&
+      rollback_time_txn_pair->rollback_timestamp < ref->page_del->durable_timestamp) {
         __wt_verbose(session, WT_VERB_RTS, "%p: deleted page rolled back", (void *)ref);
         WT_RET(__wt_delete_page_rollback(session, ref));
     }
@@ -823,7 +837,7 @@ __rollback_abort_newer_updates(
     WT_ASSERT(session, ref->page != NULL);
     page = ref->page;
     if (!__wt_page_is_modified(page) &&
-      !__rollback_page_needs_abort(session, ref, rollback_timestamp)) {
+      !__rollback_page_needs_abort(session, ref, rollback_time_txn_pair)) {
         __wt_verbose(session, WT_VERB_RTS, "%p: page skipped", (void *)ref);
         return (0);
     }
@@ -834,10 +848,10 @@ __rollback_abort_newer_updates(
 
     switch (page->type) {
     case WT_PAGE_COL_FIX:
-        __rollback_abort_newer_col_fix(session, page, rollback_timestamp);
+        __rollback_abort_newer_col_fix(session, page, rollback_time_txn_pair);
         break;
     case WT_PAGE_COL_VAR:
-        __rollback_abort_newer_col_var(session, page, rollback_timestamp);
+        __rollback_abort_newer_col_var(session, page, rollback_time_txn_pair);
         break;
     case WT_PAGE_COL_INT:
     case WT_PAGE_ROW_INT:
@@ -848,7 +862,7 @@ __rollback_abort_newer_updates(
          */
         break;
     case WT_PAGE_ROW_LEAF:
-        WT_RET(__rollback_abort_newer_row_leaf(session, page, rollback_timestamp));
+        WT_RET(__rollback_abort_newer_row_leaf(session, page, rollback_time_txn_pair));
         break;
     default:
         WT_RET(__wt_illegal_value(session, page->type));
@@ -863,10 +877,11 @@ __rollback_abort_newer_updates(
  */
 static int
 __rollback_abort_fast_truncate(
-  WT_SESSION_IMPL *session, WT_REF *ref, wt_timestamp_t rollback_timestamp)
+  WT_SESSION_IMPL *session, WT_REF *ref, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     /* Review deleted page saved to the ref. */
-    if (ref->page_del != NULL && rollback_timestamp < ref->page_del->durable_timestamp) {
+    if (ref->page_del != NULL &&
+      rollback_time_txn_pair->rollback_timestamp < ref->page_del->durable_timestamp) {
         __wt_verbose(session, WT_VERB_RTS, "%p: deleted page rolled back", (void *)ref);
         WT_RET(__wt_delete_page_rollback(session, ref));
     }
@@ -881,9 +896,10 @@ __rollback_abort_fast_truncate(
 int
 __wt_rts_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *context, bool *skipp)
 {
-    wt_timestamp_t rollback_timestamp;
+    // wt_timestamp_t rollback_timestamp;
+    WT_ROLLBACK_TIME_TXN_PAIR rollback_time_txn_pair;
 
-    rollback_timestamp = *(wt_timestamp_t *)(context);
+    rollback_time_txn_pair = *(WT_ROLLBACK_TIME_TXN_PAIR *)(context);
     *skipp = false; /* Default to reading */
 
     /* If the page state is other than on disk, we want to look at it. */
@@ -891,7 +907,7 @@ __wt_rts_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *context, bool *s
         return (0);
 
     /* Check whether this ref has any possible updates to be aborted. */
-    if (!__rollback_page_needs_abort(session, ref, rollback_timestamp)) {
+    if (!__rollback_page_needs_abort(session, ref, &rollback_time_txn_pair)) {
         *skipp = true;
         __wt_verbose(session, WT_VERB_RTS, "%p: page walk skipped", (void *)ref);
         WT_STAT_CONN_INCR(session, txn_rts_tree_walk_skip_pages);
@@ -905,23 +921,24 @@ __wt_rts_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *context, bool *s
  *     Called for each open handle - choose to either skip or wipe the commits
  */
 static int
-__rollback_to_stable_btree_walk(WT_SESSION_IMPL *session, wt_timestamp_t rollback_timestamp)
+__rollback_to_stable_btree_walk(
+  WT_SESSION_IMPL *session, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_DECL_RET;
     WT_REF *child_ref, *ref;
 
     /* Walk the tree, marking commits aborted where appropriate. */
     ref = NULL;
-    while ((ret = __wt_tree_walk_custom_skip(session, &ref, __wt_rts_page_skip, &rollback_timestamp,
-              WT_READ_NO_EVICT | WT_READ_WONT_NEED)) == 0 &&
+    while ((ret = __wt_tree_walk_custom_skip(session, &ref, __wt_rts_page_skip,
+              rollback_time_txn_pair, WT_READ_NO_EVICT | WT_READ_WONT_NEED)) == 0 &&
       ref != NULL)
         if (F_ISSET(ref, WT_REF_FLAG_INTERNAL)) {
             WT_INTL_FOREACH_BEGIN (session, ref->page, child_ref) {
-                WT_RET(__rollback_abort_fast_truncate(session, child_ref, rollback_timestamp));
+                WT_RET(__rollback_abort_fast_truncate(session, child_ref, rollback_time_txn_pair));
             }
             WT_INTL_FOREACH_END;
         } else
-            WT_RET(__rollback_abort_newer_updates(session, ref, rollback_timestamp));
+            WT_RET(__rollback_abort_newer_updates(session, ref, rollback_time_txn_pair));
 
     return (ret);
 }
@@ -931,7 +948,8 @@ __rollback_to_stable_btree_walk(WT_SESSION_IMPL *session, wt_timestamp_t rollbac
  *     Called for each object handle - choose to either skip or wipe the commits
  */
 static int
-__rollback_to_stable_btree(WT_SESSION_IMPL *session, wt_timestamp_t rollback_timestamp)
+__rollback_to_stable_btree(
+  WT_SESSION_IMPL *session, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_BTREE *btree;
     WT_CONNECTION_IMPL *conn;
@@ -967,7 +985,8 @@ __rollback_to_stable_btree(WT_SESSION_IMPL *session, wt_timestamp_t rollback_tim
     if (btree->root.page == NULL)
         return (0);
 
-    WT_WITH_PAGE_INDEX(session, ret = __rollback_to_stable_btree_walk(session, rollback_timestamp));
+    WT_WITH_PAGE_INDEX(
+      session, ret = __rollback_to_stable_btree_walk(session, rollback_time_txn_pair));
     return (ret);
 }
 
@@ -1086,7 +1105,8 @@ err:
  *     timestamp.
  */
 static int
-__rollback_to_stable_hs_final_pass(WT_SESSION_IMPL *session, wt_timestamp_t rollback_timestamp)
+__rollback_to_stable_hs_final_pass(
+  WT_SESSION_IMPL *session, WT_ROLLBACK_TIME_TXN_PAIR *rollback_time_txn_pair)
 {
     WT_CONFIG ckptconf;
     WT_CONFIG_ITEM cval, durableval, key;
@@ -1126,15 +1146,15 @@ __rollback_to_stable_hs_final_pass(WT_SESSION_IMPL *session, wt_timestamp_t roll
      * The rollback operation should be performed on the history store file when the checkpoint
      * durable start/stop timestamp is greater than the rollback timestamp.
      */
-    if (max_durable_ts > rollback_timestamp) {
+    if (max_durable_ts > rollback_time_txn_pair->rollback_timestamp) {
         __wt_verbose(session, WT_VERB_RTS, "tree rolled back with durable timestamp: %s",
           __wt_timestamp_to_string(max_durable_ts, ts_string[0]));
-        WT_TRET(__rollback_to_stable_btree(session, rollback_timestamp));
+        WT_TRET(__rollback_to_stable_btree(session, rollback_time_txn_pair));
     } else
         __wt_verbose(session, WT_VERB_RTS,
           "tree skipped with durable timestamp: %s and stable timestamp: %s",
           __wt_timestamp_to_string(max_durable_ts, ts_string[0]),
-          __wt_timestamp_to_string(rollback_timestamp, ts_string[1]));
+          __wt_timestamp_to_string(rollback_time_txn_pair->rollback_timestamp, ts_string[1]));
 
     WT_TRET(__wt_session_release_dhandle(session));
 
@@ -1155,16 +1175,18 @@ __rollback_to_stable_btree_apply(WT_SESSION_IMPL *session)
     WT_CONFIG_ITEM cval, value, key;
     WT_CURSOR *cursor;
     WT_DECL_RET;
+    WT_ROLLBACK_TIME_TXN_PAIR rollback_time_txnid_pair;
     WT_TXN_GLOBAL *txn_global;
     wt_timestamp_t max_durable_ts, newest_start_durable_ts, newest_stop_durable_ts,
       rollback_timestamp;
+    uint64_t rollback_txnid;
     size_t addr_size;
     char ts_string[2][WT_TS_INT_STRING_SIZE];
     const char *config, *uri;
     bool durable_ts_found, prepared_updates;
 
     txn_global = &S2C(session)->txn_global;
-    addr_size = 0;
+    addr_size = rollback_txnid = 0;
 
     /*
      * Copy the stable timestamp, otherwise we'd need to lock it each time it's accessed. Even
@@ -1221,6 +1243,10 @@ __rollback_to_stable_btree_apply(WT_SESSION_IMPL *session)
             if (ret == 0)
                 addr_size = value.len;
             WT_ERR_NOTFOUND_OK(ret, false);
+            ret = __wt_config_subgets(session, &cval, "newest_txn", &value);
+            if (value.len != 0)
+                rollback_txnid = (uint64_t)value.val;
+            WT_ERR_NOTFOUND_OK(ret, false);
         }
         max_durable_ts = WT_MAX(newest_start_durable_ts, newest_stop_durable_ts);
 
@@ -1261,7 +1287,10 @@ __rollback_to_stable_btree_apply(WT_SESSION_IMPL *session)
          * 1. The tree is modified.
          * 2. The checkpoint durable start/stop timestamp is greater than the rollback timestamp.
          * 3. There is no durable timestamp in any checkpoint.
+         * 4. The checkpoint newest txn is greater than snapshot min txn id
          */
+        // if (S2BT(session)->modified || max_durable_ts > rollback_timestamp || prepared_updates ||
+        // rollback_txnid > S2C(session)->recovery_ckpt_snap_min ||
         if (S2BT(session)->modified || max_durable_ts > rollback_timestamp || prepared_updates ||
           !durable_ts_found) {
             __wt_verbose(session, WT_VERB_RTS,
@@ -1270,7 +1299,9 @@ __rollback_to_stable_btree_apply(WT_SESSION_IMPL *session)
               __wt_timestamp_to_string(max_durable_ts, ts_string[0]),
               S2BT(session)->modified ? "true" : "false", prepared_updates ? "true" : "false",
               !durable_ts_found ? "true" : "false");
-            WT_TRET(__rollback_to_stable_btree(session, rollback_timestamp));
+            rollback_time_txnid_pair.rollback_timestamp = rollback_timestamp;
+            rollback_time_txnid_pair.rollback_txnid = rollback_txnid;
+            WT_TRET(__rollback_to_stable_btree(session, &rollback_time_txnid_pair));
         } else
             __wt_verbose(session, WT_VERB_RTS,
               "tree skipped with durable timestamp: %s and stable timestamp: %s",
@@ -1296,7 +1327,7 @@ __rollback_to_stable_btree_apply(WT_SESSION_IMPL *session)
     WT_ERR_NOTFOUND_OK(ret, false);
 
     if (F_ISSET(S2C(session), WT_CONN_RECOVERING))
-        WT_ERR(__rollback_to_stable_hs_final_pass(session, rollback_timestamp));
+        WT_ERR(__rollback_to_stable_hs_final_pass(session, &rollback_time_txnid_pair));
 
 err:
     WT_TRET(__wt_metadata_cursor_release(session, &cursor));
