summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/readConcern_atClusterTime.js
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2018-03-09 19:25:12 -0500
committerSpencer T Brody <spencer@mongodb.com>2018-03-15 19:31:57 -0400
commit0abcf8f3cf547327c4dab4aea1ff22e1d75a8db8 (patch)
tree1974c43d6ee2abf8f62ac782ba3054db362b2051 /jstests/noPassthrough/readConcern_atClusterTime.js
parent352cf826069d74ceb6c8a4b4ae2198098c05ba2a (diff)
downloadmongo-0abcf8f3cf547327c4dab4aea1ff22e1d75a8db8.tar.gz
SERVER-33798 Fail atClusterTime reads at times newer than the current cluster time
Diffstat (limited to 'jstests/noPassthrough/readConcern_atClusterTime.js')
-rw-r--r--jstests/noPassthrough/readConcern_atClusterTime.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/noPassthrough/readConcern_atClusterTime.js b/jstests/noPassthrough/readConcern_atClusterTime.js
index f94111b8842..f60a60e349c 100644
--- a/jstests/noPassthrough/readConcern_atClusterTime.js
+++ b/jstests/noPassthrough/readConcern_atClusterTime.js
@@ -43,6 +43,15 @@
txnNumber: NumberLong(txnNumber++)
}));
+ // 'atClusterTime' cannot be greater than the current cluster time.
+ const futureClusterTime = new Timestamp(clusterTime.getTime() + 1000, 1);
+ assert.commandFailedWithCode(sessionDb.runCommand({
+ find: collName,
+ readConcern: {level: "snapshot", atClusterTime: futureClusterTime},
+ txnNumber: NumberLong(txnNumber++)
+ }),
+ ErrorCodes.InvalidOptions);
+
// 'atClusterTime' must have type Timestamp.
assert.commandFailedWithCode(sessionDb.runCommand({
find: collName,