summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-08-10 15:16:08 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-10 05:40:43 +0000
commit13397fb0bf9aa9aca4e8fe6b736cc458bba1d494 (patch)
treebd6cfb32acfd590821f7c7d38739ca454f0e6687 /src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
parent2cc4cf27e7fa3fb7a158f05f8ae1b9beab742515 (diff)
downloadmongo-13397fb0bf9aa9aca4e8fe6b736cc458bba1d494.tar.gz
Import wiredtiger: ffebd365d6c3c18422437bcae51d8a26a17772a0 from branch mongodb-5.0
ref: 8b35a8d923..ffebd365d6 for: 5.0.3 WT-6755 Documentation: populate developer glossary WT-6905 Write row-store and column-store subpage for Architecture Guide WT-6910 Write "history store" subpage for Architecture Guide WT-7007 Backup architecture guide page WT-7198 Fix test_backup15 failure with backup mismatch WT-7352 Fix test_hs01 conflict between concurrent operations in cursor modify WT-7521 Remove excess ckplist invalidations WT-7592 Remove log_flush("sync=background") support WT-7599 Update the CONFIG file based on the release that is about to run for compatibility tests WT-7673 Investigate and fix manydbs test failure on Windows WT-7830 Migrate the python setup scripts to use cmake WT-7838 Ability for ordered timestamp assertion to do more than a log message WT-7842 Remove explicit ulimit -n call in many-collection-test WT-7860 Improve code coverage reporting WT-7876 Update rollback to stable test to use correct boolean values and update statistic checking logic WT-7893 Remove ignored message from wiredtiger_open in test_encrypt08 WT-7895 Fix arch-data-file.dox documentation build failure WT-7897 Enable verbose logging for test_backup15 to aid debugging WT-7898 Upload many-coll-test artifacts WT-7900 Fix insertion of new records in test format for column-store WT-7901 test suite cleanup WT-7908 Make variable-length column store work again with the static tests WT-7935 Add arm64 implementation of rdtsc equivalent instruction WT-7937 Fix s_docs to use sh, not bash syntax WT-7938 Fix rollback-to-stable memory leak on error
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py57
1 files changed, 32 insertions, 25 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
index dd98263ae41..3f10b186b47 100644
--- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
+++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
@@ -33,9 +33,6 @@ from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
-def timestamp_str(t):
- return '%x' % t
-
# test_rollback_to_stable19.py
# Test that rollback to stable aborts both insert and remove updates from a single prepared transaction
class test_rollback_to_stable19(test_rollback_to_stable_base):
@@ -52,8 +49,8 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
]
restart_options = [
- ('shutdown', dict(crash='false')),
- ('crash', dict(crash='true')),
+ ('shutdown', dict(crash=False)),
+ ('crash', dict(crash=True)),
]
scenarios = make_scenarios(in_memory_values, key_format_values, restart_options)
@@ -69,10 +66,6 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
def test_rollback_to_stable_no_history(self):
nrows = 1000
- # Prepare transactions for column store table is not yet supported.
- if self.key_format == 'r':
- self.skipTest('Prepare transactions for column store table is not yet supported')
-
# Create a table without logging.
uri = "table:rollback_to_stable19"
ds = SimpleDataSet(
@@ -80,8 +73,8 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
ds.populate()
# Pin oldest and stable timestamps to 10.
- self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(10) +
- ',stable_timestamp=' + timestamp_str(10))
+ self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10) +
+ ',stable_timestamp=' + self.timestamp_str(10))
valuea = "aaaaa" * 100
@@ -94,7 +87,7 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
cursor.set_key(i)
cursor.remove()
cursor.close()
- s.prepare_transaction('prepare_timestamp=' + timestamp_str(20))
+ s.prepare_transaction('prepare_timestamp=' + self.timestamp_str(20))
# 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)")
@@ -116,7 +109,7 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
cursor2.close()
# Pin stable timestamp to 20.
- self.conn.set_timestamp('stable_timestamp=' + timestamp_str(20))
+ self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(20))
if not self.in_memory:
self.session.checkpoint()
@@ -137,17 +130,22 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
stat_cursor = self.session.open_cursor('statistics:', None, None)
upd_aborted = stat_cursor[stat.conn.txn_rts_upd_aborted][2]
keys_removed = stat_cursor[stat.conn.txn_rts_keys_removed][2]
- self.assertGreater(upd_aborted, 0)
- self.assertGreater(keys_removed, 0)
+
+ # After restart (not crash) the stats for the aborted updates will be 0, as the updates
+ # will be aborted during shutdown, and on startup there will be no updates to be aborted.
+ # This is similar case with keys removed.
+ if not self.in_memory and not self.crash:
+ self.assertEqual(upd_aborted, 0)
+ self.assertEqual(keys_removed, 0)
+ else:
+ self.assertGreater(upd_aborted, 0)
+ self.assertGreater(keys_removed, 0)
+
stat_cursor.close()
def test_rollback_to_stable_with_history(self):
nrows = 1000
- # Prepare transactions for column store table is not yet supported.
- if self.key_format == 'r':
- self.skipTest('Prepare transactions for column store table is not yet supported')
-
# Create a table without logging.
uri = "table:rollback_to_stable19"
ds = SimpleDataSet(
@@ -155,8 +153,8 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
ds.populate()
# Pin oldest and stable timestamps to 10.
- self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(10) +
- ',stable_timestamp=' + timestamp_str(10))
+ self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10) +
+ ',stable_timestamp=' + self.timestamp_str(10))
valuea = "aaaaa" * 100
valueb = "bbbbb" * 100
@@ -176,7 +174,7 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
cursor.set_key(i)
cursor.remove()
cursor.close()
- s.prepare_transaction('prepare_timestamp=' + timestamp_str(40))
+ s.prepare_transaction('prepare_timestamp=' + self.timestamp_str(40))
# 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)")
@@ -198,7 +196,7 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
cursor2.close()
# Pin stable timestamp to 40.
- self.conn.set_timestamp('stable_timestamp=' + timestamp_str(40))
+ self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(40))
if not self.in_memory:
self.session.checkpoint()
@@ -220,6 +218,15 @@ class test_rollback_to_stable19(test_rollback_to_stable_base):
stat_cursor = self.session.open_cursor('statistics:', None, None)
upd_aborted = stat_cursor[stat.conn.txn_rts_upd_aborted][2]
hs_removed = stat_cursor[stat.conn.txn_rts_hs_removed][2]
- self.assertGreater(upd_aborted, 0)
+
+ # After restart (not crash) the stats for the aborted updates and history store removed will be 0,
+ # as the updates aborted and history store removed will occur during shutdown, and on startup there
+ # will be no updates to be removed.
if not self.in_memory:
- self.assertGreater(hs_removed, 0)
+ if self.crash:
+ self.assertGreater(hs_removed, 0)
+ else:
+ self.assertEqual(hs_removed, 0)
+ self.assertEqual(upd_aborted, 0)
+ else:
+ self.assertGreater(upd_aborted, 0)