diff options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/test/suite/test_hs18.py | 112 |
2 files changed, 44 insertions, 70 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 5aa0037328d..6a48130188b 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": "26d235f373b7a5fafdd46aa187fc223f463a1e12" + "commit": "d6bd5d1ffd1f9fa4cb3be94f0d29d18544a07827" } diff --git a/src/third_party/wiredtiger/test/suite/test_hs18.py b/src/third_party/wiredtiger/test/suite/test_hs18.py index 5ed21e3c90a..00fa6a96f5a 100644 --- a/src/third_party/wiredtiger/test/suite/test_hs18.py +++ b/src/third_party/wiredtiger/test/suite/test_hs18.py @@ -56,6 +56,14 @@ class test_hs18(wttest.WiredTigerTestCase): sessions[i].begin_transaction() self.check_value(cursors[i], values[i]) + def evict_key(self, uri): + # Evict the update using a debug cursor + evict_cursor = self.session.open_cursor(uri, None, "debug=(release_evict)") + evict_cursor.set_key(self.create_key(1)) + self.assertEqual(evict_cursor.search(), 0) + evict_cursor.reset() + evict_cursor.close() + def test_base_scenario(self): uri = 'table:test_base_scenario' self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format)) @@ -89,11 +97,9 @@ class test_hs18(wttest.WiredTigerTestCase): cursor[self.create_key(1)] = value2 self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(10)) - # Insert a bunch of contents to fill the cache - for i in range(2000, 10000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Commit an update without a timestamp on our original key self.session.begin_transaction() @@ -108,11 +114,9 @@ class test_hs18(wttest.WiredTigerTestCase): # Check our value is still correct. self.check_value(cursor2, value0) - # Insert a bunch of other contents to trigger eviction - for i in range(10001, 11000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Check our value is still correct. self.check_value(cursor2, value0) @@ -153,11 +157,9 @@ class test_hs18(wttest.WiredTigerTestCase): # Check our value is still correct. self.check_value(cursor3, value1) - # Insert a bunch of contents to fill the cache - for i in range(1000, 10000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Commit an update without a timestamp on our original key self.session.begin_transaction() @@ -173,11 +175,9 @@ class test_hs18(wttest.WiredTigerTestCase): self.check_value(cursor2, value1) self.check_value(cursor3, value1) - # Insert a bunch of other contents to trigger eviction - for i in range(10001, 20000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Check our value is still correct. self.check_value(cursor2, value1) @@ -218,11 +218,9 @@ class test_hs18(wttest.WiredTigerTestCase): cursor[self.create_key(1)] = value2 self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(10)) - # Insert a bunch of other contents to trigger eviction - for i in range(2, 10000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Check our value is still correct. self.check_value(cursor2, value0) @@ -232,11 +230,9 @@ class test_hs18(wttest.WiredTigerTestCase): cursor[self.create_key(1)] = value4 self.session.commit_transaction() - # Insert a bunch of other contents to trigger eviction - for i in range(10000, 11000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value3 - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Check our value is still correct. self.check_value(cursor2, value0) @@ -256,8 +252,6 @@ class test_hs18(wttest.WiredTigerTestCase): cursors.append(sessions[i].open_cursor(uri)) values.append(str(i) * 10) - value_junk = 'aaaaa' * 100 - # Insert an update at timestamp 3 self.session.begin_transaction() cursor[self.create_key(1)] = values[0] @@ -282,11 +276,9 @@ class test_hs18(wttest.WiredTigerTestCase): # Start a transaction that will see update 2. self.start_txn(sessions, cursors, values, 2) - # Insert a bunch of other contents to trigger eviction - for i in range(1000, 10000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value_junk - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Commit an update without a timestamp on our original key self.session.begin_transaction() @@ -301,11 +293,9 @@ class test_hs18(wttest.WiredTigerTestCase): cursor[self.create_key(1)] = values[4] self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(15)) - # Insert a bunch of other contents to trigger eviction - for i in range(10001, 20000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value_junk - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Validate all values are visible and correct. for i in range(0, 3): @@ -328,8 +318,6 @@ class test_hs18(wttest.WiredTigerTestCase): cursors.append(sessions[i].open_cursor(uri)) values.append(str(i) * 10) - value_junk = 'aaaaa' * 100 - # Insert an update at timestamp 3 self.session.begin_transaction() cursor[self.create_key(1)] = values[0] @@ -354,11 +342,9 @@ class test_hs18(wttest.WiredTigerTestCase): # Start a transaction that will see update 2. self.start_txn(sessions, cursors, values, 2) - # Insert a bunch of other contents to trigger eviction - for i in range(1000, 10000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value_junk - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Commit an update without a timestamp on our original key self.session.begin_transaction() @@ -392,11 +378,9 @@ class test_hs18(wttest.WiredTigerTestCase): # Start a transaction that will see update 6. self.start_txn(sessions, cursors, values, 6) - # Insert a bunch of other contents to trigger eviction - for i in range(10001, 20000): - self.session.begin_transaction() - cursor[self.create_key(i)] = value_junk - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Validate all values are visible and correct. for i in range(0, 6): @@ -418,11 +402,9 @@ class test_hs18(wttest.WiredTigerTestCase): cursor[self.create_key(1)] = values[8] self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(5)) - # Insert a bunch of other contents to trigger eviction - for i in range(10001, 20000): - self.session.begin_transaction() - cursor[self.create_key(i)] = values[3] - self.session.commit_transaction() + # Evict the update using a debug cursor + cursor.reset() + self.evict_key(uri) # Validate all values are visible and correct. for i in range(0, 7): @@ -483,11 +465,7 @@ class test_hs18(wttest.WiredTigerTestCase): # Evict the update using a debug cursor cursor.reset() - evict_cursor = self.session.open_cursor(uri, None, "debug=(release_evict)") - evict_cursor.set_key(self.create_key(1)) - self.assertEqual(evict_cursor.search(), 0) - evict_cursor.reset() - evict_cursor.close() + self.evict_key(uri) # Commit a modify without a timestamp on our original key self.session.begin_transaction() @@ -511,11 +489,7 @@ class test_hs18(wttest.WiredTigerTestCase): # Evict the update using a debug cursor cursor.reset() - evict_cursor = self.session.open_cursor(uri, None, "debug=(release_evict)") - evict_cursor.set_key(self.create_key(1)) - self.assertEqual(evict_cursor.search(), 0) - evict_cursor.reset() - evict_cursor.close() + self.evict_key(uri) # Check our values are still correct. for i in range(0, 5): |