summaryrefslogtreecommitdiff
path: root/jstests/replsets/read_concern_uninitated_set.js
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-12-10 16:23:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-04 19:53:30 +0000
commita8e91314ab13d431e7e0f2ce10c5e5aa63c0c58d (patch)
tree7811f7e195292b97b8e7814b0d3808d678a696ac /jstests/replsets/read_concern_uninitated_set.js
parent6b780f53b473a8f23042095642b1888bf3a2b237 (diff)
downloadmongo-a8e91314ab13d431e7e0f2ce10c5e5aa63c0c58d.tar.gz
SERVER-47568 Disable clusterTime gossiping for nodes in unreadable states
Diffstat (limited to 'jstests/replsets/read_concern_uninitated_set.js')
-rw-r--r--jstests/replsets/read_concern_uninitated_set.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/jstests/replsets/read_concern_uninitated_set.js b/jstests/replsets/read_concern_uninitated_set.js
index b86d729e087..ef45be4d2ab 100644
--- a/jstests/replsets/read_concern_uninitated_set.js
+++ b/jstests/replsets/read_concern_uninitated_set.js
@@ -29,19 +29,16 @@ assert.commandFailedWithCode(
{find: "test", filter: {}, maxTimeMS: 60000, readConcern: {level: "majority"}}),
ErrorCodes.NotYetInitialized);
-// TODO SERVER-47568: Only expect NotPrimaryOrSecondary.
-const expectedCodes = jsTest.options().useRandomBinVersionsWithinReplicaSet
- ? [ErrorCodes.NotYetInitialized, ErrorCodes.NotPrimaryOrSecondary]
- : [ErrorCodes.NotYetInitialized];
-
-jsTestLog("afterClusterTime readConcern should fail with NotYetInitialized.");
+// Nodes don't process $clusterTime metadata when in an unreadable state, so this read will fail
+// because the logical clock's latest value is less than the given afterClusterTime timestamp.
+jsTestLog("afterClusterTime readConcern should fail with NotPrimaryOrSecondary.");
assert.commandFailedWithCode(localDB.runCommand({
find: "test",
filter: {},
maxTimeMS: 60000,
readConcern: {afterClusterTime: Timestamp(1, 1)}
}),
- expectedCodes);
+ ErrorCodes.NotPrimaryOrSecondary);
jsTestLog("oplog query should fail with NotYetInitialized.");
assert.commandFailedWithCode(localDB.runCommand({
@@ -54,6 +51,6 @@ assert.commandFailedWithCode(localDB.runCommand({
term: 1,
readConcern: {afterClusterTime: Timestamp(1, 1)}
}),
- expectedCodes);
+ ErrorCodes.NotPrimaryOrSecondary);
rst.stopSet();
}());