lib/mongo/cluster/sdam_flow.rb
def remove_servers_not_in_desc(updated_desc)
      updated_desc_address_strs = %w(hosts passives arbiters).map do |m|
        updated_desc.send(m)
      end.flatten
      servers_list.each do |server|
        unless updated_desc_address_strs.include?(address_str = server.address.to_s)
          updated_host = updated_desc.address.to_s
          if updated_desc.me && updated_desc.me != updated_host
            updated_host += " (self-identified as #{updated_desc.me})"
          end
          log_warn(
            "Removing server #{address_str} because it is not in hosts reported by primary " +
            "#{updated_host}. Reported hosts are: " +
            updated_desc.hosts.join(', ')
          )
          do_remove(address_str)
        end
      end
    end
# Removes servers from the topology which are not present in the
# given server description (which is supposed to have come from a
# good primary).
Removes servers from the topology which are not present in the
given server description (which is supposed to have come from a
good primary).
Removes servers from the topology which are not present in the given server description ( which is supposed to have come from a good primary ) .
def remove_servers_not_in_desc(updated_desc)
      updated_desc_address_strs = %w(hosts passives arbiters).map do |m|
        updated_desc.send(m)
      end.flatten
      servers_list.each do |server|
        unless updated_desc_address_strs.include?(address_str = server.address.to_s)
          updated_host = updated_desc.address.to_s
          if updated_desc.me && updated_desc.me != updated_host
            updated_host += " (self-identified as #{updated_desc.me})"
          end
          log_warn(
            "Removing server #{address_str} because it is not in hosts reported by primary " +
            "#{updated_host}. Reported hosts are: " +
            updated_desc.hosts.join(', ')
          )
          do_remove(address_str)
        end
      end
    end
def remove_servers_not_in_desc ( updated_desc ) updated_desc_address_strs = %w( hosts passives arbiters ) . map do | m | updated_desc . send ( m ) end . flatten servers_list . each do | server | unless updated_desc_address_strs . include? ( address_str = server . address . to_s ) updated_host = updated_desc . address . to_s if updated_desc . me && updated_desc . me != updated_host updated_host += " (self-identified as #{updated_desc.me})" end log_warn ( "Removing server #{address_str} because it is not in hosts reported by primary " + "#{updated_host}. Reported hosts are: " + updated_desc . hosts . join ( ', ' ) ) do_remove ( address_str ) end end end
Removes servers from the topology which are not present in the
given server description (which is supposed to have come from a
good primary).
Removes servers from the topology which are not present in the given server description ( which is supposed to have come from a good primary ) .
updated_desc