diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2017-11-08 19:29:28 -0500 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2017-11-08 19:29:28 -0500 |
commit | 6d8e6b9cce052cdd442e207a27df10e698b2bb00 (patch) | |
tree | 5a7bb7b5cf93902bf00a681dccb0f54adb2f1ab0 /jstests/noPassthroughWithMongod | |
parent | f7756c41c5ed54e8e546461395bc8898d885af0c (diff) | |
download | mongo-6d8e6b9cce052cdd442e207a27df10e698b2bb00.tar.gz |
SERVER-31296 Update sessions, causal, and retryable in the mongo shell.
* Removes the initialClusterTime and initialOperationTime session
options.
* Enables causal consistency by default when using an explicit
session.
* Adds a --retryWrites command line option to the mongo shell for
enabling retryable writes in the mongo shell. The retryWrites
options to SessionOptions is left for convenience with testing.
* Renames setClusterTime() to advanceClusterTime(), and adds a
corresponding advanceOperationTime() method to DriverSession.
* Enables assigning transaction numbers for write commands where
ordered=false.
* Prevents the mongo shell from sending afterClusterTime or assigning
transaction numbers when talking to a stand-alone mongod.
* Prevents the mongo shell from assigning transaction numbers when
using an unacknowledged (w=0) writeConcern.
* Changes DBClientRS to re-discover the current primary of the replica
set when it receives an error code representing "not master" in
addition to an error message representing "not master".
* Adds a shellPrint() pretty-printer for SessionOptions and
DriverSession instances so they no longer print out their entire
object definition.
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r-- | jstests/noPassthroughWithMongod/set_cluster_time.js | 29 | ||||
-rw-r--r-- | jstests/noPassthroughWithMongod/shell_advance_cluster_time.js | 29 |
2 files changed, 29 insertions, 29 deletions
diff --git a/jstests/noPassthroughWithMongod/set_cluster_time.js b/jstests/noPassthroughWithMongod/set_cluster_time.js deleted file mode 100644 index 73096779b74..00000000000 --- a/jstests/noPassthroughWithMongod/set_cluster_time.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Santity check getClusterTime and setClusterTime. - */ - -(function() { - assert.throws(function() { - db.getMongo().setClusterTime(); - }); - - assert.throws(function() { - db.getMongo().setClusterTime(123); - }); - - assert.throws(function() { - db.getMongo().setClusterTime('abc'); - }); - - db.getMongo().setClusterTime({'clusterTime': 123}); - - assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime()); - - db.getMongo().setClusterTime({'clusterTime': 100}); - - assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime()); - - db.getMongo().setClusterTime({'clusterTime': 456}); - - assert.eq({'clusterTime': 456}, db.getMongo().getClusterTime()); -})(); diff --git a/jstests/noPassthroughWithMongod/shell_advance_cluster_time.js b/jstests/noPassthroughWithMongod/shell_advance_cluster_time.js new file mode 100644 index 00000000000..db3c4904896 --- /dev/null +++ b/jstests/noPassthroughWithMongod/shell_advance_cluster_time.js @@ -0,0 +1,29 @@ +/** + * Santity check getClusterTime and advanceClusterTime. + */ + +(function() { + assert.throws(function() { + db.getMongo().advanceClusterTime(); + }); + + assert.throws(function() { + db.getMongo().advanceClusterTime(123); + }); + + assert.throws(function() { + db.getMongo().advanceClusterTime('abc'); + }); + + db.getMongo().advanceClusterTime({'clusterTime': 123}); + + assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime()); + + db.getMongo().advanceClusterTime({'clusterTime': 100}); + + assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime()); + + db.getMongo().advanceClusterTime({'clusterTime': 456}); + + assert.eq({'clusterTime': 456}, db.getMongo().getClusterTime()); +})(); |