summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r--src/mongo/db/catalog/commit_quorum_options.cpp4
-rw-r--r--src/mongo/db/catalog/commit_quorum_options_test.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/catalog/commit_quorum_options.cpp b/src/mongo/db/catalog/commit_quorum_options.cpp
index a20218fa6e6..0a85a812b56 100644
--- a/src/mongo/db/catalog/commit_quorum_options.cpp
+++ b/src/mongo/db/catalog/commit_quorum_options.cpp
@@ -68,12 +68,12 @@ Status CommitQuorumOptions::parse(const BSONElement& commitQuorumElement) {
if (commitQuorumElement.isNumber()) {
auto cNumNodes = commitQuorumElement.safeNumberLong();
if (cNumNodes < 0 ||
- cNumNodes > static_cast<decltype(cNumNodes)>(repl::ReplSetConfig::kMaxMembers)) {
+ cNumNodes > static_cast<decltype(cNumNodes)>(repl::ReplSetConfig::kMaxVotingMembers)) {
return Status(
ErrorCodes::FailedToParse,
str::stream()
<< "commitQuorum has to be a non-negative number and not greater than "
- << repl::ReplSetConfig::kMaxMembers);
+ << repl::ReplSetConfig::kMaxVotingMembers);
}
numNodes = static_cast<decltype(numNodes)>(cNumNodes);
} else if (commitQuorumElement.type() == String) {
diff --git a/src/mongo/db/catalog/commit_quorum_options_test.cpp b/src/mongo/db/catalog/commit_quorum_options_test.cpp
index e0c6e4d6e4e..ad5c3a787bf 100644
--- a/src/mongo/db/catalog/commit_quorum_options_test.cpp
+++ b/src/mongo/db/catalog/commit_quorum_options_test.cpp
@@ -54,7 +54,7 @@ TEST(CommitQuorumOptionsTest, ParseReturnsFailedToParseIfCommitQuorumIsANegative
BSONObj obj = BSON("commitQuorum" << -1);
auto status = CommitQuorumOptions().parse(obj.getField("commitQuorum"));
ASSERT_EQUALS(ErrorCodes::FailedToParse, status);
- ASSERT_EQUALS("commitQuorum has to be a non-negative number and not greater than 50",
+ ASSERT_EQUALS("commitQuorum has to be a non-negative number and not greater than 7",
status.reason());
}
@@ -63,7 +63,7 @@ TEST(CommitQuorumOptionsTest,
BSONObj obj = BSON("commitQuorum" << 70);
auto status = CommitQuorumOptions().parse(obj.getField("commitQuorum"));
ASSERT_EQUALS(ErrorCodes::FailedToParse, status);
- ASSERT_EQUALS("commitQuorum has to be a non-negative number and not greater than 50",
+ ASSERT_EQUALS("commitQuorum has to be a non-negative number and not greater than 7",
status.reason());
}