summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSiddhartha Mahajan <siddhartha.mahajan8899@mongodb.com>2022-11-04 00:16:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-04 00:45:59 +0000
commitf02acba54fd16b0ffd84a97a138e0208dd6e8b5c (patch)
tree0a51a9a046c1ad9e4fe1f17ca921984256a2e03c /src
parent83c60c5c0becf03dc65cc49de1ac5ae4feb8654e (diff)
downloadmongo-f02acba54fd16b0ffd84a97a138e0208dd6e8b5c.tar.gz
Import wiredtiger: a69bf663f43889880669a5e9e5fd76107f9951b5 from branch mongodb-master
ref: 0cafef49af..a69bf663f4 for: 6.2.0-rc0 WT-9846 Use oldest unstable timestamp to clean history store when no stable updates are on chain
Diffstat (limited to 'src')
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/history/hs_rec.c3
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c16
-rwxr-xr-xsrc/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py15
4 files changed, 34 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 7eab2c8fd9f..bf61673d55c 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-master",
- "commit": "0cafef49af3bba2529c6ca5e87339a4713f2cd9a"
+ "commit": "a69bf663f43889880669a5e9e5fd76107f9951b5"
}
diff --git a/src/third_party/wiredtiger/src/history/hs_rec.c b/src/third_party/wiredtiger/src/history/hs_rec.c
index ba1c8e8d6f0..d6cfadd4757 100644
--- a/src/third_party/wiredtiger/src/history/hs_rec.c
+++ b/src/third_party/wiredtiger/src/history/hs_rec.c
@@ -911,7 +911,8 @@ __hs_delete_reinsert_from_pos(WT_SESSION_IMPL *session, WT_CURSOR *hs_cursor, ui
* If we find a key with a timestamp larger than or equal to the specified timestamp then the
* specified timestamp must be mixed mode.
*
- * FIXME-WT-9846: Change this back to WT_ASSERT_ALWAYS once WT-9846 is resolved
+ * FIXME-WT-10017: Change this back to WT_ASSERT_ALWAYS once WT-10017 is resolved. WT-10017 will
+ * resolve a known issue where this assert fires for column store configurations.
*/
WT_ASSERT(session, ts == 1 || ts == WT_TS_NONE);
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 b9b2436cf31..329d8a9eac2 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
@@ -218,6 +218,22 @@ __rollback_abort_insert_list(WT_SESSION_IMPL *session, WT_PAGE *page, WT_INSERT_
session, key, ins->upd, rollback_timestamp, &stable_update_found));
if (stable_update_found && stable_updates_count != NULL)
(*stable_updates_count)++;
+ if (!stable_update_found && page->type == WT_PAGE_ROW_LEAF &&
+ !F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
+ /*
+ * When a new key is added to a page and the page is then checkpointed, updates for
+ * that key can be present in the History Store while the key isn't present in the
+ * disk image. RTS will then only remove these updates when there is a stable update
+ * on-chain. These updates still need removing when no stable updates are on-chain,
+ * so do so here explicitly. Pass in rollback_timestamp + 1 as __rollback_delete_hs
+ * removes updates inclusive of the provided timestamp, but we only want to remove
+ * unstable updates.
+ *
+ * FIXME-WT-10017: WT-9846 is an interim fix only for row-store while we investigate
+ * the impacts of a long term correction in WT-10017. Once completed this change can
+ * be reverted.
+ */
+ WT_ERR(__rollback_delete_hs(session, key, rollback_timestamp + 1));
}
err:
diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py
index 676bf934b6e..38f1661166f 100755
--- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py
+++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py
@@ -129,5 +129,20 @@ class test_rollback_to_stable06(test_rollback_to_stable_base):
else:
self.assertGreaterEqual(upd_aborted + hs_removed + keys_removed, nrows * 4)
+ if not self.in_memory and self.key_format == 'i':
+ # FIXME-WT-10017: WT-9846 is a temporary fix only for row store and a
+ # more complete fix including column store will be made in WT-10017.
+ # Once delivered the key_format == 'i' check is no longer needed.
+ #
+ # Reinsert the same updates with the same timestamps and flush to disk.
+ # If the updates have not been correctly removed by RTS WiredTiger will
+ # see the key already exists in the history store and abort.
+ self.large_updates(uri, value_a, ds, nrows, self.prepare, 20)
+ self.large_updates(uri, value_b, ds, nrows, self.prepare, 30)
+ self.large_updates(uri, value_c, ds, nrows, self.prepare, 40)
+ self.large_updates(uri, value_d, ds, nrows, self.prepare, 50)
+
+ self.session.checkpoint()
+
if __name__ == '__main__':
wttest.run()