Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1460

IPv6 literal address not supported for quorum members

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.3
    • Fix Version/s: 3.5.2, 3.6.0
    • Component/s: quorum
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      IPv6 addresses are now properly parsed in the config

      Description

      Via code inspection, I see that the "server.nnn" configuration key does not support literal IPv6 addresses because the property value is split on ":". In v3.4.3, the problem is in QuorumPeerConfig:

      String parts[] = value.split(":");
      InetSocketAddress addr = new InetSocketAddress(parts[0],
                              Integer.parseInt(parts[1]));
      

      In the current trunk (http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java?view=markup) this code has been refactored into QuorumPeer.QuorumServer, but the bug remains:

      String serverClientParts[] = addressStr.split(";");
      String serverParts[] = serverClientParts[0].split(":");
      addr = new InetSocketAddress(serverParts[0],
                              Integer.parseInt(serverParts[1]));
      

      This bug probably affects very few users because most will naturally use a hostname rather than a literal IP address. But given that IPv6 addresses are supported for clients via ZOOKEEPER-667 it seems that server support should be fixed too.

        Attachments

        1. ZOOKEEPER-1460-branch3.4.patch
          2 kB
          Patrick Hunt
        2. ZOOKEEPER-1460-branch3.4.patch
          2 kB
          Patrick White
        3. ZOOKEEPER-1460-for-3.5.0.patch
          6 kB
          Boying Lu
        4. ZOOKEEPER-1460.003.patch
          6 kB
          Chris Nauroth
        5. ZOOKEEPER-1460-accept-square-bracket-delimited-IPv6-literals.2.diff
          6 kB
          Joseph Walton
        6. ZOOKEEPER-1460-accept-square-bracket-delimited-IPv6-literals.diff
          6 kB
          Joseph Walton

          Issue Links

            Activity

              People

              • Assignee:
                joe@kafsemo.org Joseph Walton
                Reporter:
                cdolan Chris Dolan
              • Votes:
                5 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: