summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replica_set_config.cpp
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2015-06-22 21:30:49 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2015-06-24 18:35:34 -0400
commit2b6c9610491dfd5c6d136dc4c487bcc44a12cd26 (patch)
tree82fa41626a24f575418079cb9bb0608b8d4a9946 /src/mongo/db/repl/replica_set_config.cpp
parent0e9371dbed499f6f2ab5066fffdc746747351c6d (diff)
downloadmongo-2b6c9610491dfd5c6d136dc4c487bcc44a12cd26.tar.gz
SERVER-19059 Mismatch in protocolVersion field
Diffstat (limited to 'src/mongo/db/repl/replica_set_config.cpp')
-rw-r--r--src/mongo/db/repl/replica_set_config.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/repl/replica_set_config.cpp b/src/mongo/db/repl/replica_set_config.cpp
index eef500a2328..70bc1156470 100644
--- a/src/mongo/db/repl/replica_set_config.cpp
+++ b/src/mongo/db/repl/replica_set_config.cpp
@@ -132,15 +132,6 @@ Status ReplicaSetConfig::initialize(const BSONObj& cfg) {
if (!status.isOK())
return status;
- //
- // Parse protocol version
- //
- BSONElement protocolVersionElement;
- status = bsonExtractIntegerField(cfg, kProtocolVersionFieldName, &_protocolVersion);
- if (!status.isOK() && status != ErrorCodes::NoSuchKey) {
- return status;
- }
-
_calculateMajorities();
_addInternalWriteConcernModes();
_isInitialized = true;
@@ -246,6 +237,15 @@ Status ReplicaSetConfig::_parseSettingsSubdocument(const BSONObj& settings) {
}
_customWriteConcernModes[modeElement.fieldNameStringData()] = pattern;
}
+
+ //
+ // Parse protocol version
+ //
+ status = bsonExtractIntegerField(settings, kProtocolVersionFieldName, &_protocolVersion);
+ if (!status.isOK() && status != ErrorCodes::NoSuchKey) {
+ return status;
+ }
+
return Status::OK();
}