From f07189a2eb3691dfadfa51e91d4b41f8e4cb718d Mon Sep 17 00:00:00 2001 From: Xuerui Fa Date: Thu, 20 Feb 2020 18:18:22 -0500 Subject: SERVER-46274: Add votingMembersCount and writableVotingMembersCount fields to replSetGetStatus --- src/mongo/db/repl/repl_set_config.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/repl/repl_set_config.cpp') diff --git a/src/mongo/db/repl/repl_set_config.cpp b/src/mongo/db/repl/repl_set_config.cpp index 416970f4905..a19bb6d2b5a 100644 --- a/src/mongo/db/repl/repl_set_config.cpp +++ b/src/mongo/db/repl/repl_set_config.cpp @@ -810,7 +810,8 @@ void ReplSetConfig::_calculateMajorities() { std::count_if(begin(_members), end(_members), [](const auto& x) { return x.isArbiter(); }); _totalVotingMembers = voters; _majorityVoteCount = voters / 2 + 1; - _writeMajority = std::min(_majorityVoteCount, voters - arbiters); + _writableVotingMembersCount = voters - arbiters; + _writeMajority = std::min(_majorityVoteCount, _writableVotingMembersCount); } void ReplSetConfig::_addInternalWriteConcernModes() { -- cgit v1.2.1