diff options
author | Spencer T Brody <spencer@mongodb.com> | 2018-03-09 19:25:12 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2018-03-15 19:31:57 -0400 |
commit | 0abcf8f3cf547327c4dab4aea1ff22e1d75a8db8 (patch) | |
tree | 1974c43d6ee2abf8f62ac782ba3054db362b2051 /jstests/noPassthrough/readConcern_atClusterTime.js | |
parent | 352cf826069d74ceb6c8a4b4ae2198098c05ba2a (diff) | |
download | mongo-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.js | 9 |
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, |