summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_timestamp07.py
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-10-10 16:29:49 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-10-10 16:37:55 +1100
commit39998ac6928c4e7f3acd2f7ee2fc5fb4df056c18 (patch)
treec075233cd32c6ec0205af77db475836c0fba60e9 /src/third_party/wiredtiger/test/suite/test_timestamp07.py
parentdd094ce1bc1fb424ccc6dd71939e5c7a30159e2e (diff)
downloadmongo-39998ac6928c4e7f3acd2f7ee2fc5fb4df056c18.tar.gz
Import wiredtiger: 0cd3d5bbd8a5c8779f1129c6754b4463403e788f from branch mongodb-3.6
ref: 6f561957cb..0cd3d5bbd8 for: 3.5.14 WT-3200 LSM bug: Failed lookup in bloom filter. WT-3435 Lookaside eviction should be able to save unstable updates WT-3453 Enhance lookaside table test coverage in Python suite WT-3559 Detect when a checkpoint races with metadata changes WT-3579 Enhance support for running wtperf workloads with workgen WT-3582 Cache stuck full of internal pages WT-3593 Add an API to enforce consistent use of timestamps (#3667) WT-3599 reconciliation calculates block matching checksums too frequently. WT-3600 timestamp API lets you set timestamps with invalid characters WT-3612 Improve documentation of durability with backup cursors WT-3613 test/format cache full with LSM WT-3618 WT remove solaris from evergreen builds WT-3620 POSIX thread attribute structures must be destroyed WT-3621 Add test for full backups with concurrent table creation WT-3622 Allow upper case hexadecimal timestamps WT-3627 test_txn14.test_txn14.test_log_flush timeout WT-3631 Convert timestamps to integers in Python tests before comparing WT-3636 Account for page image sizes in cache consistently WT-3638 format failure, update list without complete visible record WT-3639 Test/format tried to drop named checkpoints during a hot backup WT-3641 Track maximum timestamp used in each btree WT-3642 Avoid lookaside reads for dead trees
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_timestamp07.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_timestamp07.py41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp07.py b/src/third_party/wiredtiger/test/suite/test_timestamp07.py
index 12b36bdc2f8..09547dba3a7 100644
--- a/src/third_party/wiredtiger/test/suite/test_timestamp07.py
+++ b/src/third_party/wiredtiger/test/suite/test_timestamp07.py
@@ -56,8 +56,8 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess):
nkeys = [
('100keys', dict(nkeys=100)),
-# ('500keys', dict(nkeys=500)),
-# ('1000keys', dict(nkeys=1000)),
+ ('500keys', dict(nkeys=500)),
+ ('1000keys', dict(nkeys=1000)),
]
scenarios = make_scenarios(types, conncfg, nkeys)
@@ -68,19 +68,20 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess):
value3 = u'\u0001\u0002cdef\u0007\u0004'
# Check that a cursor (optionally started in a new transaction), sees the
- # expected values.
- def check(self, session, txn_config, expected):
+ # expected value for a key
+ def check(self, session, txn_config, k, expected):
if txn_config:
session.begin_transaction(txn_config)
c = session.open_cursor(self.uri + self.tablename, None)
- actual = dict((k, v) for k, v in c if v != 0)
- self.assertTrue(actual == expected)
- # Search for the expected items as well as iterating
- for k, v in expected.iteritems():
- self.assertEqual(c[k], v, "for key " + str(k))
+ if not expected:
+ c.set_key(k)
+ self.assertEqual(c.search(), wiredtiger.WT_NOTFOUND)
+ else:
+ self.assertEqual(c[k], expected)
c.close()
if txn_config:
session.commit_transaction()
+
#
# Take a backup of the database and verify that the value we want to
# check exists in the tables the expected number of times.
@@ -168,12 +169,14 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess):
# Now check that we see the expected state when reading at each
# timestamp.
- for i, t in enumerate(orig_keys):
- self.check(self.session, 'read_timestamp=' + timestamp_str(t),
- dict((k, self.value) for k in orig_keys[:i+1]))
+ for k in orig_keys:
+ self.check(self.session, 'read_timestamp=' + timestamp_str(k),
+ k, self.value)
+ self.check(self.session, 'read_timestamp=' + timestamp_str(k),
+ k + 1, None)
# Bump the oldest timestamp, we're not going back...
- self.assertEqual(self.conn.query_timestamp(), timestamp_str(self.nkeys))
+ self.assertTimestampsEqual(self.conn.query_timestamp(), timestamp_str(self.nkeys))
self.oldts = timestamp_str(self.nkeys)
self.conn.set_timestamp('oldest_timestamp=' + self.oldts)
self.conn.set_timestamp('stable_timestamp=' + self.oldts)
@@ -201,12 +204,8 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess):
# Take a checkpoint using the given configuration. Then verify
# whether value2 appears in a copy of that data or not.
- valcnt2 = valcnt3 = self.nkeys
- valcnt = 0
- # If logging is disabled then value2 should not appear in logged table.
- if self.using_log == False:
- valcnt3 = 0
- self.ckpt_backup(self.value2, valcnt, valcnt2, valcnt3)
+ self.ckpt_backup(self.value2, 0, self.nkeys, self.nkeys if self.using_log else 0)
+
# Update the stable timestamp to the latest, but not the oldest
# timestamp and make sure we can see the data. Once the stable
# timestamp is moved we should see all keys with value2.
@@ -245,9 +244,7 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess):
# of that data or not. Both tables that are logged should see
# all the data regardless of timestamps. The table that is not
# logged should not see any of it.
- valcnt = 0
- valcnt2 = valcnt3 = self.nkeys
- self.backup_check(self.value3, valcnt, valcnt2, valcnt3)
+ self.backup_check(self.value3, 0, self.nkeys, self.nkeys)
if __name__ == '__main__':
wttest.run()