def fetch_nodes
      data = @zk.get(redis_nodes_path, :watch => true).first
      nodes = symbolize_keys(decode(data))
      logger.debug("Fetched nodes: #{nodes.inspect}")

      nodes
    rescue Zookeeper::Exceptions::InheritedConnectionError, ZK::Exceptions::InterruptedSession => ex
      logger.debug { "Caught #{ex.class} '#{ex.message}' - reopening ZK client" }
      @zk.reopen
      retry
    rescue *ZK_ERRORS => ex
      logger.warn { "Caught #{ex.class} '#{ex.message}' - retrying" }
      sleep(RETRY_WAIT_TIME)
      retry
    end
def fetch_nodes
      data = @zk.get(redis_nodes_path, :watch => true).first
      nodes = symbolize_keys(decode(data))
      logger.debug("Fetched nodes: #{nodes.inspect}")

      nodes
    rescue Zookeeper::Exceptions::InheritedConnectionError, ZK::Exceptions::InterruptedSession => ex
      logger.debug { "Caught #{ex.class} '#{ex.message}' - reopening ZK client" }
      @zk.reopen
      retry
    rescue *ZK_ERRORS => ex
      logger.warn { "Caught #{ex.class} '#{ex.message}' - retrying" }
      sleep(RETRY_WAIT_TIME)
      retry
    end
Fetches the known redis nodes from ZooKeeper.

 @return [Hash] the known master/slave redis servers