summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_nsnap04.py
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2017-01-06 14:34:59 +1100
committerDavid Hows <howsdav@gmail.com>2017-01-06 14:34:59 +1100
commit52b68fa86ea43e909ad42c901d0579bced6b205f (patch)
treeb96bf369af650de45c59abdef9ebce73a1e5953c /src/third_party/wiredtiger/test/suite/test_nsnap04.py
parent39a42af703ed789b1effa80d5a1ed263e85c4008 (diff)
downloadmongo-52b68fa86ea43e909ad42c901d0579bced6b205f.tar.gz
Import wiredtiger: d48181f6f4db08761ed7b80b0332908b272ad0d0 from branch mongodb-3.2
ref: 040e3d6f76..d48181f6f4 for: 3.2.12 SERVER-26545 Remove fixed-size limitation on WiredTiger hazard pointers WT-2336 Add a test validating schema operations via file system call monitoring WT-2402 Misaligned structure accesses lead to undefined behavior WT-2670 Inefficient I/O when read full DB (poor readahead) WT-283 Add a way to change persistent object settings WT-2960 Inserting multi-megabyte values can cause pathological lookaside usage WT-2969 Possible snapshot corruption during compaction WT-3014 Add GCC/clang support for ELF symbol visibility. WT-3021 Fixes needed for Java log cursor example, Java raw mode cursors, log cursors in raw mode WT-3025 fix error path in log_force_sync WT-3028 Workloads with all dirty pages could trigger diagnostic stuck check WT-3030 Test failure indicating invalid key order during traversal WT-3034 Add support for single-writer named snapshots. WT-3037 Fix some outdated comments in logging WT-3048 WiredTiger maximum size warning uses the wrong format. WT-3051 Remove external __wt_hex symbol. WT-3052 Improve search if an index hint is wrong WT-3053 Review Python and Java calls to internal WiredTiger functions WT-3054 Java PackTest, PackTest03 do not compile WT-3055 Java AsyncTest faults WT-3056 For cursors with projections, keys should be allowed WT-3057 WiredTiger hazard pointers should use the WT_REF, not the WT_PAGE. WT-3061 syscall test runs with checkpoint_sync=false and doesn't acknowledge pwrite64 WT-3064 minor tree cleanups: .gitignore, NEWS misspelling WT-3066 lint WT-3068 Copy wtperf artifacts when running Jenkins tests WT-3069 Fix build failures in LevelDB APIs WT-3070 Fix search_near() for index cursor WT-3071 Java: fix build with -Werror=sign-conversion WT-3075 Document and enforce that WiredTiger now depends on Python 2.7 WT-3078 Fix a hang in the reconfiguration test. WT-3084 Fix Coverity resource leak complaint.
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_nsnap04.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_nsnap04.py37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_nsnap04.py b/src/third_party/wiredtiger/test/suite/test_nsnap04.py
index 60901dd2ee3..8d491540d74 100644
--- a/src/third_party/wiredtiger/test/suite/test_nsnap04.py
+++ b/src/third_party/wiredtiger/test/suite/test_nsnap04.py
@@ -38,14 +38,18 @@ class test_nsnap04(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:' + tablename
nrows_per_itr = 10
- def check_named_snapshot(self, snapshot, expected):
+ def check_named_snapshot(self, snapshot, expected, skip_snapshot=False):
new_session = self.conn.open_session()
c = new_session.open_cursor(self.uri)
- new_session.begin_transaction("snapshot=" + str(snapshot))
+ if skip_snapshot:
+ new_session.begin_transaction()
+ else:
+ new_session.begin_transaction("snapshot=" + str(snapshot))
count = 0
for row in c:
count += 1
new_session.commit_transaction()
+ new_session.close()
# print "Checking snapshot %d, expect %d, found %d" % (snapshot, expected, count)
self.assertEqual(count, expected)
@@ -80,5 +84,34 @@ class test_nsnap04(wttest.WiredTigerTestCase, suite_subprocess):
self.session.snapshot("name=0")
self.check_named_snapshot(0, 2 * self.nrows_per_itr)
+ def test_include_updates(self):
+ # Populate a table
+ end = start = 0
+ SimpleDataSet(self, self.uri, 0, key_format='i').populate()
+
+ snapshots = []
+ c = self.session.open_cursor(self.uri)
+ for i in xrange(self.nrows_per_itr):
+ c[i] = "some value"
+
+ self.session.begin_transaction("isolation=snapshot")
+ count = 0
+ for row in c:
+ count += 1
+ self.session.snapshot("name=0,include_updates=true")
+
+ self.check_named_snapshot(0, self.nrows_per_itr)
+
+ # Insert some more content using the active session.
+ for i in xrange(self.nrows_per_itr):
+ c[self.nrows_per_itr + i] = "some value"
+
+ self.check_named_snapshot(0, 2 * self.nrows_per_itr)
+ # Ensure transactions not tracking the snapshot don't see the updates
+ self.check_named_snapshot(0, self.nrows_per_itr, skip_snapshot=True)
+ self.session.commit_transaction()
+ # Ensure content is visible to non-snapshot transactions after commit
+ self.check_named_snapshot(0, 2 * self.nrows_per_itr, skip_snapshot=True)
+
if __name__ == '__main__':
wttest.run()