summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replica_set_config_checks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/replica_set_config_checks.cpp')
-rw-r--r--src/mongo/db/repl/replica_set_config_checks.cpp46
1 files changed, 30 insertions, 16 deletions
diff --git a/src/mongo/db/repl/replica_set_config_checks.cpp b/src/mongo/db/repl/replica_set_config_checks.cpp
index 6539bd08e3f..a45985d3cb4 100644
--- a/src/mongo/db/repl/replica_set_config_checks.cpp
+++ b/src/mongo/db/repl/replica_set_config_checks.cpp
@@ -60,8 +60,10 @@ StatusWith<int> findSelfInConfig(ReplicationCoordinatorExternalState* externalSt
if (meConfigs.empty()) {
return StatusWith<int>(ErrorCodes::NodeNotFound,
str::stream() << "No host described in new configuration "
- << newConfig.getConfigVersion() << " for replica set "
- << newConfig.getReplSetName() << " maps to this node");
+ << newConfig.getConfigVersion()
+ << " for replica set "
+ << newConfig.getReplSetName()
+ << " maps to this node");
}
if (meConfigs.size() > 1) {
str::stream message;
@@ -90,9 +92,11 @@ Status checkElectable(const ReplicaSetConfig& newConfig, int configIndex) {
if (!myConfig.isElectable()) {
return Status(ErrorCodes::NodeNotElectable,
str::stream() << "This node, " << myConfig.getHostAndPort().toString()
- << ", with _id " << myConfig.getId()
+ << ", with _id "
+ << myConfig.getId()
<< " is not electable under the new configuration version "
- << newConfig.getConfigVersion() << " for replica set "
+ << newConfig.getConfigVersion()
+ << " for replica set "
<< newConfig.getReplSetName());
}
return Status::OK();
@@ -138,22 +142,28 @@ Status validateOldAndNewConfigsCompatible(const ReplicaSetConfig& oldConfig,
return Status(ErrorCodes::NewReplicaSetConfigurationIncompatible,
str::stream()
<< "New replica set configuration version must be greater than old, but "
- << newConfig.getConfigVersion() << " is not greater than "
- << oldConfig.getConfigVersion() << " for replica set "
+ << newConfig.getConfigVersion()
+ << " is not greater than "
+ << oldConfig.getConfigVersion()
+ << " for replica set "
<< newConfig.getReplSetName());
}
if (oldConfig.getReplSetName() != newConfig.getReplSetName()) {
return Status(ErrorCodes::NewReplicaSetConfigurationIncompatible,
str::stream() << "New and old configurations differ in replica set name; "
- "old was " << oldConfig.getReplSetName() << ", and new is "
+ "old was "
+ << oldConfig.getReplSetName()
+ << ", and new is "
<< newConfig.getReplSetName());
}
if (oldConfig.getReplicaSetId() != newConfig.getReplicaSetId()) {
return Status(ErrorCodes::NewReplicaSetConfigurationIncompatible,
str::stream() << "New and old configurations differ in replica set ID; "
- "old was " << oldConfig.getReplicaSetId() << ", and new is "
+ "old was "
+ << oldConfig.getReplicaSetId()
+ << ", and new is "
<< newConfig.getReplicaSetId());
}
@@ -185,14 +195,18 @@ Status validateOldAndNewConfigsCompatible(const ReplicaSetConfig& oldConfig,
}
if (hostsEqual && !idsEqual) {
return Status(ErrorCodes::NewReplicaSetConfigurationIncompatible,
- str::stream()
- << "New and old configurations both have members with "
- << MemberConfig::kHostFieldName << " of "
- << mOld->getHostAndPort().toString()
- << " but in the new configuration the "
- << MemberConfig::kIdFieldName << " field is " << mNew->getId()
- << " and in the old configuration it is " << mOld->getId()
- << " for replica set " << newConfig.getReplSetName());
+ str::stream() << "New and old configurations both have members with "
+ << MemberConfig::kHostFieldName
+ << " of "
+ << mOld->getHostAndPort().toString()
+ << " but in the new configuration the "
+ << MemberConfig::kIdFieldName
+ << " field is "
+ << mNew->getId()
+ << " and in the old configuration it is "
+ << mOld->getId()
+ << " for replica set "
+ << newConfig.getReplSetName());
}
// At this point, the _id and host fields are equal, so we're looking at the old and
// new configurations for the same member node.