summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2018-06-11 13:41:46 -0400
committerRandolph Tan <randolph@10gen.com>2018-06-20 16:57:49 -0400
commit862bdee50dc0677f6afea73b72913807f7e67265 (patch)
tree777857af07245025d029471e4da30cc6a10cb584 /jstests
parentc0c902a251a9f79b4190fb6085a58783e2d88aac (diff)
downloadmongo-862bdee50dc0677f6afea73b72913807f7e67265.tar.gz
SERVER-35357 Implement a temporary map of transaction runtime states on MongoS
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/transactions_prohibited_in_sharded_cluster.js57
1 files changed, 0 insertions, 57 deletions
diff --git a/jstests/sharding/transactions_prohibited_in_sharded_cluster.js b/jstests/sharding/transactions_prohibited_in_sharded_cluster.js
deleted file mode 100644
index 6ad97243043..00000000000
--- a/jstests/sharding/transactions_prohibited_in_sharded_cluster.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Verify that multi-statement transactions are disallowed on mongos.
- */
-(function() {
- 'use strict';
-
- const st = new ShardingTest({shards: 1, mongos: 1, config: 1, rsOptions: {nodes: 1}});
- const mongos = st.s0;
- const dbName = "test";
- const collName = "coll";
-
- // Start a session on the mongos.
- const session = mongos.getDB(dbName).getMongo().startSession();
- const sessionDb = session.getDatabase(dbName);
- let txnNumber = 0;
-
- // Unable to start a transaction via mongos with a read.
- assert.commandFailedWithCode(sessionDb.runCommand({
- find: collName,
- readConcern: {level: "snapshot"},
- txnNumber: NumberLong(txnNumber++),
- startTransaction: true,
- autocommit: false
- }),
- 50841);
-
- // Unable to start a transaction via mongos with a write.
- assert.commandFailedWithCode(sessionDb.runCommand({
- insert: collName,
- documents: [{_id: 1}],
- readConcern: {level: "snapshot"},
- txnNumber: NumberLong(txnNumber++),
- startTransaction: true,
- autocommit: false
- }),
- 50841);
-
- // 'startTransaction' and 'autocommit' arguments are always rejected by mongos.
- assert.commandFailedWithCode(sessionDb.runCommand({
- find: collName,
- readConcern: {level: "snapshot"},
- txnNumber: NumberLong(txnNumber++),
- autocommit: false
- }),
- 50841);
-
- assert.commandFailedWithCode(sessionDb.runCommand({
- find: collName,
- readConcern: {level: "snapshot"},
- txnNumber: NumberLong(txnNumber++),
- startTransaction: true
- }),
- 50841);
-
- st.stop();
-
-})();