diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-10-11 14:17:36 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-11 03:42:56 +0000 |
commit | d5af757bb78163dfc03440892652a3e75bc15b88 (patch) | |
tree | d04f2f4b8363259a000398a5a11b6f5ab5cae441 | |
parent | c83d89bef13f8ddfeda2a5336fec287c590b5c37 (diff) | |
download | mongo-d5af757bb78163dfc03440892652a3e75bc15b88.tar.gz |
Import wiredtiger: 55805bc66bc3ffc53bd5d391b89ad0b2a950e8a5 from branch mongodb-master
ref: b63d81a2da..55805bc66b
for: 5.1.0-rc1
WT-7250 Fix the test to perform explicit eviction instead of relying on low cache size
4 files changed, 63 insertions, 20 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 1161019c623..76600fd4758 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": "b63d81a2dab9034c1ed3870c316baf06ab465a40" + "commit": "55805bc66bc3ffc53bd5d391b89ad0b2a950e8a5" } diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py index e85de366970..5d1fe8029cd 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py @@ -154,6 +154,18 @@ class test_rollback_to_stable_base(wttest.WiredTigerTestCase): self.assertEqual(count, nrows) cursor.close() + def evict_cursor(self, uri, nrows, check_value): + # Configure debug behavior on a cursor to evict the page positioned on when the reset API is used. + evict_cursor = self.session.open_cursor(uri, None, "debug=(release_evict)") + self.session.begin_transaction("ignore_prepare=true") + for i in range (1, nrows + 1): + evict_cursor.set_key(i) + self.assertEqual(evict_cursor[i], check_value) + if i % 10 == 0: + evict_cursor.reset() + evict_cursor.close() + self.session.rollback_transaction() + # Test that rollback to stable clears the remove operation. class test_rollback_to_stable01(test_rollback_to_stable_base): session_config = 'isolation=snapshot' diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py index 63989155146..cf4e43282da 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py @@ -26,13 +26,13 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -import fnmatch, os, shutil, threading, time +import threading, time from helper import copy_wiredtiger_home, simulate_crash_restart from test_rollback_to_stable01 import test_rollback_to_stable_base from wiredtiger import stat from wtdataset import SimpleDataSet from wtscenario import make_scenarios -from wtthread import checkpoint_thread, op_thread +from wtthread import checkpoint_thread # test_rollback_to_stable10.py # Test the rollback to stable operation performs sweeping history store. @@ -52,7 +52,7 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): scenarios = make_scenarios(key_format_values, prepare_values) def conn_config(self): - config = 'cache_size=6MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' + config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' return config def test_rollback_to_stable(self): @@ -117,6 +117,8 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): try: self.pr("start checkpoint") ckpt.start() + # Sleep for sometime so that checkpoint starts. + time.sleep(2) # Perform several updates in parallel with checkpoint. # Rollbacks may occur when checkpoint is running, so retry as needed. @@ -125,10 +127,14 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): lambda: self.large_updates(uri_1, value_e, ds_1, nrows, self.prepare, 70)) self.retry_rollback('update ds2, e', None, lambda: self.large_updates(uri_2, value_e, ds_2, nrows, self.prepare, 70)) + self.evict_cursor(uri_1, nrows, value_e) + self.evict_cursor(uri_2, nrows, value_e) self.retry_rollback('update ds1, f', None, lambda: self.large_updates(uri_1, value_f, ds_1, nrows, self.prepare, 80)) self.retry_rollback('update ds2, f', None, lambda: self.large_updates(uri_2, value_f, ds_2, nrows, self.prepare, 80)) + self.evict_cursor(uri_1, nrows, value_f) + self.evict_cursor(uri_2, nrows, value_f) finally: done.set() ckpt.join() @@ -173,10 +179,6 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): def test_rollback_to_stable_prepare(self): nrows = 1000 - # FIXME-WT-7250 This test fails because of cache stuck on Windows. - if os.name == "nt": - self.skipTest('rollback_to_stable10 prepare test skipped on Windows') - # Create a table without logging. self.pr("create/populate tables") uri_1 = "table:rollback_to_stable10_1" @@ -199,7 +201,6 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): value_c = "ccccc" * 100 value_d = "ddddd" * 100 value_e = "eeeee" * 100 - value_f = "fffff" * 100 # Perform several updates. self.pr("large updates") @@ -216,13 +217,11 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): # Verify data is visible and correct. self.check(value_d, uri_1, nrows, 20) self.check(value_c, uri_1, nrows, 30) - self.session.breakpoint() self.check(value_b, uri_1, nrows, 40) self.check(value_a, uri_1, nrows, 50) self.check(value_d, uri_2, nrows, 20) self.check(value_c, uri_2, nrows, 30) - self.session.breakpoint() self.check(value_b, uri_2, nrows, 40) self.check(value_a, uri_2, nrows, 50) @@ -250,6 +249,8 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): try: self.pr("start checkpoint") ckpt.start() + # Sleep for sometime so that checkpoint starts. + time.sleep(2) # Perform several updates in parallel with checkpoint. session_p1 = self.conn.open_session() @@ -259,6 +260,7 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): lambda: prepare_range_updates( session_p1, cursor_p1, ds_1, value_e, nrows, 'prepare_timestamp=' + self.timestamp_str(69))) + self.evict_cursor(uri_1, nrows, value_a) # Perform several updates in parallel with checkpoint. session_p2 = self.conn.open_session() @@ -268,6 +270,7 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): lambda: prepare_range_updates( session_p2, cursor_p2, ds_2, value_e, nrows, 'prepare_timestamp=' + self.timestamp_str(69))) + self.evict_cursor(uri_2, nrows, value_a) finally: done.set() ckpt.join() diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py index 25b625e1cfa..601302b0762 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py @@ -26,13 +26,13 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -import fnmatch, os, shutil, threading, time +import threading, time from helper import simulate_crash_restart from test_rollback_to_stable01 import test_rollback_to_stable_base from wiredtiger import stat from wtdataset import SimpleDataSet from wtscenario import make_scenarios -from wtthread import checkpoint_thread, op_thread +from wtthread import checkpoint_thread def mod_val(value, char, location, nbytes=1): return value[0:location] + char + value[location+nbytes:] @@ -58,11 +58,11 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): scenarios = make_scenarios(key_format_values, prepare_values) def conn_config(self): - config = 'cache_size=8MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' + config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' return config def test_rollback_to_stable(self): - nrows = 1500 + nrows = 100 # Create a table without logging. self.pr("create/populate table") @@ -81,6 +81,10 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): value_modR = mod_val(value_modQ, 'R', 1) value_modS = mod_val(value_modR, 'S', 2) value_modT = mod_val(value_modS, 'T', 3) + value_modW = mod_val(value_modT, 'W', 4) + value_modX = mod_val(value_modW, 'X', 5) + value_modY = mod_val(value_modX, 'Y', 6) + value_modZ = mod_val(value_modY, 'Z', 7) # Perform a combination of modifies and updates. self.pr("large updates and modifies") @@ -109,18 +113,24 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): try: self.pr("start checkpoint") ckpt.start() + # Sleep for sometime so that checkpoint starts. + time.sleep(2) # Perform several modifies in parallel with checkpoint. # Rollbacks may occur when checkpoint is running, so retry as needed. self.pr("modifies") self.retry_rollback('modify ds1, W', None, lambda: self.large_modifies(uri, 'W', ds, 4, 1, nrows, self.prepare, 70)) + self.evict_cursor(uri, nrows, value_modW) self.retry_rollback('modify ds1, X', None, lambda: self.large_modifies(uri, 'X', ds, 5, 1, nrows, self.prepare, 80)) + self.evict_cursor(uri, nrows, value_modX) self.retry_rollback('modify ds1, Y', None, lambda: self.large_modifies(uri, 'Y', ds, 6, 1, nrows, self.prepare, 90)) + self.evict_cursor(uri, nrows, value_modY) self.retry_rollback('modify ds1, Z', None, lambda: self.large_modifies(uri, 'Z', ds, 7, 1, nrows, self.prepare, 100)) + self.evict_cursor(uri, nrows, value_modZ) finally: done.set() ckpt.join() @@ -163,7 +173,7 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): self.ignoreStdoutPatternIfExists("oldest pinned transaction ID rolled back for eviction") def test_rollback_to_stable_same_ts(self): - nrows = 1500 + nrows = 100 # Create a table without logging. self.pr("create/populate table") @@ -182,6 +192,10 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): value_modR = mod_val(value_modQ, 'R', 1) value_modS = mod_val(value_modR, 'S', 2) value_modT = mod_val(value_modS, 'T', 3) + value_modW = mod_val(value_modT, 'W', 4) + value_modX = mod_val(value_modW, 'X', 5) + value_modY = mod_val(value_modX, 'Y', 6) + value_modZ = mod_val(value_modY, 'Z', 7) # Perform a combination of modifies and updates. self.pr("large updates and modifies") @@ -210,18 +224,24 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): try: self.pr("start checkpoint") ckpt.start() + # Sleep for sometime so that checkpoint starts. + time.sleep(2) # Perform several modifies in parallel with checkpoint. # Rollbacks may occur when checkpoint is running, so retry as needed. self.pr("modifies") self.retry_rollback('modify ds1, W', None, lambda: self.large_modifies(uri, 'W', ds, 4, 1, nrows, self.prepare, 70)) + self.evict_cursor(uri, nrows, value_modW) self.retry_rollback('modify ds1, X', None, lambda: self.large_modifies(uri, 'X', ds, 5, 1, nrows, self.prepare, 80)) + self.evict_cursor(uri, nrows, value_modX) self.retry_rollback('modify ds1, Y', None, lambda: self.large_modifies(uri, 'Y', ds, 6, 1, nrows, self.prepare, 90)) + self.evict_cursor(uri, nrows, value_modY) self.retry_rollback('modify ds1, Z', None, lambda: self.large_modifies(uri, 'Z', ds, 7, 1, nrows, self.prepare, 100)) + self.evict_cursor(uri, nrows, value_modZ) finally: done.set() ckpt.join() @@ -262,7 +282,7 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): self.ignoreStdoutPatternIfExists("oldest pinned transaction ID rolled back for eviction") def test_rollback_to_stable_same_ts_append(self): - nrows = 1500 + nrows = 100 # Create a table without logging. self.pr("create/populate table") @@ -281,6 +301,10 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): value_modR = append_val(value_modQ, 'R') value_modS = append_val(value_modR, 'S') value_modT = append_val(value_modS, 'T') + value_modW = append_val(value_modT, 'W') + value_modX = append_val(value_modW, 'X') + value_modY = append_val(value_modX, 'Y') + value_modZ = append_val(value_modY, 'Z') # Perform a combination of modifies and updates. self.pr("large updates and modifies") @@ -309,6 +333,8 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): try: self.pr("start checkpoint") ckpt.start() + # Sleep for sometime so that checkpoint starts. + time.sleep(2) # Perform several modifies in parallel with checkpoint. # Rollbacks may occur when checkpoint is running, so retry as needed. @@ -316,11 +342,13 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): self.retry_rollback('modify ds1, W', None, lambda: self.large_modifies(uri, 'W', ds, len(value_modT), 1, nrows, self.prepare, 70)) self.retry_rollback('modify ds1, X', None, - lambda: self.large_modifies(uri, 'X', ds, len(value_modT) + 1, 1, nrows, self.prepare, 80)) + lambda: self.large_modifies(uri, 'X', ds, len(value_modW), 1, nrows, self.prepare, 80)) + self.evict_cursor(uri, nrows, value_modX) self.retry_rollback('modify ds1, Y', None, - lambda: self.large_modifies(uri, 'Y', ds, len(value_modT) + 2, 1, nrows, self.prepare, 90)) + lambda: self.large_modifies(uri, 'Y', ds, len(value_modX), 1, nrows, self.prepare, 90)) self.retry_rollback('modify ds1, Z', None, - lambda: self.large_modifies(uri, 'Z', ds, len(value_modT) + 3, 1, nrows, self.prepare, 100)) + lambda: self.large_modifies(uri, 'Z', ds, len(value_modY), 1, nrows, self.prepare, 100)) + self.evict_cursor(uri, nrows, value_modZ) finally: done.set() ckpt.join() |