summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/readConcern_snapshot_mongos.js
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2018-04-12 13:40:14 -0400
committerJack Mulrow <jack.mulrow@mongodb.com>2018-04-13 13:06:42 -0400
commitefb0b0f6572d2e175f3611246f8cd13fe4128d15 (patch)
tree82bc3033e00372c192848c9c65eac427ca14da7c /jstests/noPassthrough/readConcern_snapshot_mongos.js
parentfde45e48ef4a86fb19604843fdee272a22fcd475 (diff)
downloadmongo-efb0b0f6572d2e175f3611246f8cd13fe4128d15.tar.gz
SERVER-33989 Add support for afterClusterTime for snapshot reads through mongos
Diffstat (limited to 'jstests/noPassthrough/readConcern_snapshot_mongos.js')
-rw-r--r--jstests/noPassthrough/readConcern_snapshot_mongos.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/jstests/noPassthrough/readConcern_snapshot_mongos.js b/jstests/noPassthrough/readConcern_snapshot_mongos.js
index cbc5d3137fc..6d5d4b7d342 100644
--- a/jstests/noPassthrough/readConcern_snapshot_mongos.js
+++ b/jstests/noPassthrough/readConcern_snapshot_mongos.js
@@ -106,20 +106,26 @@
assert.commandWorked(sessionDb.runCommand(
{find: collName, readConcern: {level: "snapshot"}, txnNumber: NumberLong(txnNumber++)}));
+ // readConcern 'snapshot' is allowed with 'afterClusterTime'.
+ assert.commandWorked(sessionDb.runCommand({
+ find: collName,
+ readConcern: {level: "snapshot", afterClusterTime: clusterTime},
+ txnNumber: NumberLong(txnNumber++)
+ }));
+ assert.commandWorked(sessionDb.runCommand({
+ aggregate: collName,
+ pipeline: [],
+ cursor: {},
+ readConcern: {level: "snapshot", afterClusterTime: clusterTime},
+ txnNumber: NumberLong(txnNumber++)
+ }));
+
assert.commandWorked(sessionDb.coll.insert({}, {w: 2}));
assert.commandWorked(coll.createIndex({geo: "2d"}));
assert.commandWorked(coll.createIndex({haystack: "geoHaystack", a: 1}, {bucketSize: 1}));
// Passthrough tests that are not implemented yet.
- //
- // readConcern 'snapshot' is allowed with 'afterClusterTime'.
- // TODO SERVER-33989: Add support for afterClusterTime for snapshot reads through mongos.
- assert.commandFailedWithCode(sessionDb.runCommand({
- find: collName,
- readConcern: {level: "snapshot", afterClusterTime: clusterTime},
- txnNumber: NumberLong(txnNumber++)
- }),
- ErrorCodes.InvalidOptions);
+
// TODO SERVER-33709: Add snapshot support for cluster count on mongos.
assert.commandFailedWithCode(sessionDb.runCommand({
count: collName,