ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-338

zk hosts should be resolved periodically for loadbalancing amongst zk servers.

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0, 3.0.1, 3.1.0
    • Fix Version/s: None
    • Component/s: c client, java client
    • Labels:
      None

      Description

      The list of host names passed to ZK init method is resolved only once. Had a corresponding DNS entry been changed, it
      would not be refreshed by the ZK library,effectively preventing from proper load balancing.

        Issue Links

          Activity

          Hide
          Patrick Hunt added a comment -

          Updated as c client component - is this an issue for either the java server/client?

          Show
          Patrick Hunt added a comment - Updated as c client component - is this an issue for either the java server/client?
          Hide
          Benjamin Reed added a comment -

          it is an issue for both the c and java clients.

          Show
          Benjamin Reed added a comment - it is an issue for both the c and java clients.
          Hide
          Raul Gutierrez Segales added a comment -

          I think this isn't true after ZOOKEEPER-107, in a bad way. I've just noticed that we call getaddrinfo from zookeeper_interest... on every call. So from zookeeper_interest we always call update_addrs:

          https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L2082

          which in turns unconditionally calls resolve_hosts:

          https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L787

          which does the unconditional calls to getaddrinfo:

          https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L648

          We should fix this since it'll make 3.5.0 dramatically slower.

          Show
          Raul Gutierrez Segales added a comment - I think this isn't true after ZOOKEEPER-107 , in a bad way. I've just noticed that we call getaddrinfo from zookeeper_interest... on every call. So from zookeeper_interest we always call update_addrs: https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L2082 which in turns unconditionally calls resolve_hosts: https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L787 which does the unconditional calls to getaddrinfo: https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L648 We should fix this since it'll make 3.5.0 dramatically slower.
          Hide
          Raul Gutierrez Segales added a comment -

          Forgot to mention something that is obvious for long-timers but might be new to newer folks: zookeeper_interest is called periodically to send pings, check for events, etc.

          Show
          Raul Gutierrez Segales added a comment - Forgot to mention something that is obvious for long-timers but might be new to newer folks: zookeeper_interest is called periodically to send pings, check for events, etc.

            People

            • Assignee:
              Unassigned
              Reporter:
              Mahadev konar
            • Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Development