lib/mongo/cluster/sdam_flow.rb
def update_rs_without_primary
      if topology.replica_set_name.nil?
        @topology = Topology::ReplicaSetNoPrimary.new(
          topology.options.merge(replica_set_name: updated_desc.replica_set_name),
          topology.monitoring, self)
      end

      if topology.replica_set_name != updated_desc.replica_set_name
        log_warn(
          "Removing server #{updated_desc.address.to_s} because it has an " +
          "incorrect replica set name (#{updated_desc.replica_set_name}); " +
          "current set name is #{topology.replica_set_name}"
        )
        remove
        return
      end

      publish_description_change_event

      servers = add_servers_from_desc(updated_desc)

      commit_changes

      servers.each do |server|
        server.start_monitoring
      end

      if updated_desc.me_mismatch?
        log_warn(
          "Removing server #{updated_desc.address.to_s} because it " +
          "reported itself as #{updated_desc.me}"
        )
        remove
        return
      end
    end
# Updates a ReplicaSetNoPrimary topology from a non-primary member.
Updates a ReplicaSetNoPrimary topology from a non-primary member.
Updates a ReplicaSetNoPrimary topology from a non - primary member .
def update_rs_without_primary
      if topology.replica_set_name.nil?
        @topology = Topology::ReplicaSetNoPrimary.new(
          topology.options.merge(replica_set_name: updated_desc.replica_set_name),
          topology.monitoring, self)
      end
      if topology.replica_set_name != updated_desc.replica_set_name
        log_warn(
          "Removing server #{updated_desc.address.to_s} because it has an " +
          "incorrect replica set name (#{updated_desc.replica_set_name}); " +
          "current set name is #{topology.replica_set_name}"
        )
        remove
        return
      end
      publish_description_change_event
      servers = add_servers_from_desc(updated_desc)
      commit_changes
      servers.each do |server|
        server.start_monitoring
      end
      if updated_desc.me_mismatch?
        log_warn(
          "Removing server #{updated_desc.address.to_s} because it " +
          "reported itself as #{updated_desc.me}"
        )
        remove
        return
      end
    end
def update_rs_without_primary if topology . replica_set_name . nil? @topology = Topology :: ReplicaSetNoPrimary . new ( topology . options . merge ( replica_set_name : updated_desc . replica_set_name ) , topology . monitoring , self ) end if topology . replica_set_name != updated_desc . replica_set_name log_warn ( "Removing server #{updated_desc.address.to_s} because it has an " + "incorrect replica set name (#{updated_desc.replica_set_name}); " + "current set name is #{topology.replica_set_name}" ) remove return end publish_description_change_event servers = add_servers_from_desc ( updated_desc ) commit_changes servers . each do | server | server . start_monitoring end if updated_desc . me_mismatch? log_warn ( "Removing server #{updated_desc.address.to_s} because it " + "reported itself as #{updated_desc.me}" ) remove return end end
Updates a ReplicaSetNoPrimary topology from a non-primary member.
Updates a ReplicaSetNoPrimary topology from a non - primary member .