def handle_available(node, snapshots)
      reconcile(node)

      # no-op if we already know about this node
      return if @master == node || (@master && @slaves.include?(node))
      logger.info("Handling available node: #{node}")

      if @master
        # master already exists, make a slave
        node.make_slave!(@master)
        @slaves << node
      else
        # no master exists, make this the new master
        promote_new_master(snapshots, node)
      end

      @unavailable.delete(node)
    end
def handle_available(node, snapshots)
      reconcile(node)

      # no-op if we already know about this node
      return if @master == node || (@master && @slaves.include?(node))
      logger.info("Handling available node: #{node}")

      if @master
        # master already exists, make a slave
        node.make_slave!(@master)
        @slaves << node
      else
        # no master exists, make this the new master
        promote_new_master(snapshots, node)
      end

      @unavailable.delete(node)
    end
Handles an available node.

 @param [Node] node the available node
 @param [Hash<Node, NodeSnapshot>] snapshots the current set of snapshots