diff options
author | Judah Schvimer <judah@mongodb.com> | 2018-09-21 15:42:10 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2018-09-21 15:42:41 -0400 |
commit | 340e33483d69983c976dff0ed5ab2ff0b036237c (patch) | |
tree | 02fa87780c879d854568c42efb2aa4edd417e5c6 /jstests | |
parent | 680158aaa823b4d980adb4ad4209258408c32253 (diff) | |
download | mongo-340e33483d69983c976dff0ed5ab2ff0b036237c.tar.gz |
SERVER-35865 SERVER-35816 SERVER-35730 Write commit oplog entry on commit of prepared transaction
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/txn_basic_two_phase_commit.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/sharding/txn_basic_two_phase_commit.js b/jstests/sharding/txn_basic_two_phase_commit.js index f37bf39a78a..cfaa452d6f6 100644 --- a/jstests/sharding/txn_basic_two_phase_commit.js +++ b/jstests/sharding/txn_basic_two_phase_commit.js @@ -9,7 +9,7 @@ const collName = "foo"; const ns = dbName + "." + collName; - let st = new ShardingTest({shards: 3}); + let st = new ShardingTest({shards: 3, causallyConsistent: true}); let coordinator = st.shard0; let participant1 = st.shard1; @@ -149,6 +149,11 @@ })) .prepareTimestamp; + // Run a command that touches all three shards to gossip the cluster time since the three + // shells do not gossip amongst themselves. + assert.commandWorked(st.s.getDB(dbName).runCommand( + {insert: collName, documents: [{_id: -4}, {_id: 6}, {_id: 17}]})); + // Simulate that all participants vote to commit (remove this under SERVER-36304). assert.commandWorked(coordinator.adminCommand({ voteCommitTransaction: 1, @@ -179,7 +184,7 @@ })); // Verify that the transaction was committed on all shards. - assert.eq(3, st.s.getDB(dbName).getCollection(collName).find().itcount()); + assert.eq(6, st.s.getDB(dbName).getCollection(collName).find().itcount()); st.stop(); |