def handle_unavailable(node, snapshots)
      # no-op if we already know about this node
      return if @unavailable.include?(node)
      logger.info("Handling unavailable node: #{node}")

      @unavailable << node
      # find a new master if this node was a master
      if node == @master
        logger.info("Demoting currently unavailable master #{node}.")
        promote_new_master(snapshots)
      else
        @slaves.delete(node)
      end
    end
def handle_unavailable(node, snapshots)
      # no-op if we already know about this node
      return if @unavailable.include?(node)
      logger.info("Handling unavailable node: #{node}")

      @unavailable << node
      # find a new master if this node was a master
      if node == @master
        logger.info("Demoting currently unavailable master #{node}.")
        promote_new_master(snapshots)
      else
        @slaves.delete(node)
      end
    end
Handles an unavailable node.

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