summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2021-04-29 10:17:18 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-29 16:24:59 +0000
commitbbf49c8019ec253013ad2df96951ab3201872d6a (patch)
tree5890fcb44d4af0fdf8f3ea028b96b05f01363f41
parent71b7bfbd35c779d59d5d24db860513aaf3c9e365 (diff)
downloadmongo-bbf49c8019ec253013ad2df96951ab3201872d6a.tar.gz
SERVER-56321 aggregation without atClusterTime can read at a newer committed snapshot in shell_cursor_read_timestamp.js
-rw-r--r--jstests/noPassthrough/shell_cursor_read_timestamp.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/noPassthrough/shell_cursor_read_timestamp.js b/jstests/noPassthrough/shell_cursor_read_timestamp.js
index f613ebba739..64c5b535489 100644
--- a/jstests/noPassthrough/shell_cursor_read_timestamp.js
+++ b/jstests/noPassthrough/shell_cursor_read_timestamp.js
@@ -54,9 +54,11 @@ cursor = collection.aggregate([{$sort: {_id: 1}}],
{readConcern: {level: "snapshot", atClusterTime: insertTimestamp}});
assert.eq(cursor.getClusterTime(), insertTimestamp);
-// Test aggregate with snapshot readConcern.
+// Test aggregate with snapshot readConcern. Similarly to the find with snapshot readConcern and no
+// 'atClusterTime', it's possible that this aggregate can read at a newer snapshot than
+// 'insertTimestamp'.
cursor = collection.aggregate([{$sort: {_id: 1}}], {readConcern: {level: "snapshot"}});
-assert.eq(cursor.getClusterTime(), insertTimestamp);
+assert.gte(cursor.getClusterTime(), insertTimestamp);
// Test aggregate with non-snapshot readConcern.
cursor = collection.aggregate([{$sort: {_id: 1}}]);