def update_master_state(node, snapshots)
      state = @node_strategy.determine_state(node, snapshots)
      case state
      when :unavailable
        handle_unavailable(node, snapshots)
      when :available
        if node.syncing_with_master?
          handle_syncing(node, snapshots)
        else
          handle_available(node, snapshots)
        end
      else
        raise InvalidNodeStateError.new(node, state)
      end
    rescue *ZK_ERRORS
      # fail hard if this is a ZK connection-related error
      raise
    rescue => ex
      logger.error("Error handling state report for #{[node, state].inspect}: #{ex.inspect}")
    end
def update_master_state(node, snapshots)
      state = @node_strategy.determine_state(node, snapshots)
      case state
      when :unavailable
        handle_unavailable(node, snapshots)
      when :available
        if node.syncing_with_master?
          handle_syncing(node, snapshots)
        else
          handle_available(node, snapshots)
        end
      else
        raise InvalidNodeStateError.new(node, state)
      end
    rescue *ZK_ERRORS
      # fail hard if this is a ZK connection-related error
      raise
    rescue => ex
      logger.error("Error handling state report for #{[node, state].inspect}: #{ex.inspect}")
    end
Used to update the master node manager state. These states are only handled if
 this node manager instance is serving as the master manager.

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