lib/mongo/cluster/topology/replica_set.rb in mongo-2.1.0.beta vs lib/mongo/cluster/topology/replica_set.rb in mongo-2.1.0.rc0
- old
+ new
@@ -59,22 +59,23 @@
#
# @return [ ReplicaSet ] The topology.
def elect_primary(description, servers)
if description.replica_set_name == replica_set_name
unless detect_stale_primary!(description)
- log_debug([ "Server #{description.address.to_s} elected as primary in #{replica_set_name}." ])
+ log_debug("Server #{description.address.to_s} elected as primary in #{replica_set_name}.")
servers.each do |server|
if server.primary? && server.address != description.address
server.description.unknown!
end
end
update_max_election_id(description)
end
else
- log_warn([
- "Server #{description.address.to_s} in incorrect replica set: #{description.replica_set_name}."
- ])
+ log_warn(
+ "Server #{description.address.to_s} has incorrect replica set name: " +
+ "'#{description.replica_set_name}'. The current replica set name is '#{replica_set_name}'."
+ )
end
self
end
# Initialize the topology with the options.
@@ -155,11 +156,12 @@
#
# @since 2.0.6
def remove_hosts?(description)
!description.config.empty? &&
(description.primary? ||
- description.hosts.empty? ||
- !member_of_this_set?(description))
+ description.me_mismatch? ||
+ description.hosts.empty? ||
+ !member_of_this_set?(description))
end
# Whether a specific server in the cluster can be removed, given a description.
#
# @example Check if a specific server can be removed from the cluster.