summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2020-03-06 15:53:21 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-09 17:07:50 +0000
commit604c0afc97799516ba37880932948dbb008aa862 (patch)
tree236af9f58170fe4f5c8972d1ee65e60289179977 /src
parent0bcd8d56c22cb339faf3bf8a1bf7abd838da05ad (diff)
downloadmongo-604c0afc97799516ba37880932948dbb008aa862.tar.gz
SERVER-45143 use default value for 'protocolVersion' field during reconfigs
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/repl_set_config.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/repl/repl_set_config.cpp b/src/mongo/db/repl/repl_set_config.cpp
index 4874344260d..686a727931e 100644
--- a/src/mongo/db/repl/repl_set_config.cpp
+++ b/src/mongo/db/repl/repl_set_config.cpp
@@ -190,8 +190,8 @@ Status ReplSetConfig::_initialize(const BSONObj& cfg,
// Parse protocol version
//
status = bsonExtractIntegerField(cfg, kProtocolVersionFieldName, &_protocolVersion);
- // If 'protocolVersion' field is missing for initiate, then _protocolVersion defaults to 1.
- if (!(status.isOK() || (status == ErrorCodes::NoSuchKey && forInitiate))) {
+ // If 'protocolVersion' field is missing, then _protocolVersion defaults to 1.
+ if (!status.isOK() && status != ErrorCodes::NoSuchKey) {
return status;
}