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.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replica_set_config_checks.cpp b/src/mongo/db/repl/replica_set_config_checks.cpp
index a382353fc27..6539bd08e3f 100644
--- a/src/mongo/db/repl/replica_set_config_checks.cpp
+++ b/src/mongo/db/repl/replica_set_config_checks.cpp
@@ -150,6 +150,13 @@ Status validateOldAndNewConfigsCompatible(const ReplicaSetConfig& oldConfig,
<< 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 "
+ << newConfig.getReplicaSetId());
+ }
+
if (oldConfig.isConfigServer() && !newConfig.isConfigServer()) {
return Status(ErrorCodes::NewReplicaSetConfigurationIncompatible,
str::stream() << "Cannot remove \""
@@ -157,7 +164,6 @@ Status validateOldAndNewConfigsCompatible(const ReplicaSetConfig& oldConfig,
<< "\" from replica set configuration on reconfig");
}
-
//
// For every member config mNew in newConfig, if there exists member config mOld
// in oldConfig such that mNew.getHostAndPort() == mOld.getHostAndPort(), it is required