Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23581

On service discovery mode, the initial port of hiveserver2 to which zookeeper is applied is not changed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • All Versions
    • None
    • JDBC
    • None

    Description

      When accessing hiveserver2 with `hive.server2.support.dynamic.service.discovery` and ` hive.server2.limit.connections.per.user` applied through the hive jdbc driver, The jdbc driver is a method of randomly obtaining domain information (host, port) information of hivesever2 registered in the zookeeper.

      However, if the hiveserver2 obtained from the zookeeper first fails to connect due to the setting value of `hive.server2.limit.connections.per.user`, the port will not be initialized due to the following code logic.

       

      https://github.com/apache/hive/blob/8443e50fdfa284531300f3ab283a7e4959dba623/jdbc/src/java/org/apache/hive/jdbc/ZooKeeperHiveClientHelper.java#L320

       

      if ((matcher.group(1).equals("hive.server2.thrift.http.port"))
         && !(connParams.getPort() > 0)) {
        connParams.setPort(Integer.parseInt(matcher.group(2)));
      }
      

       

      Therefore, if the port of the next accessible hiveserver2 is not the first port, a problem occurs.

      So I modified the port number to be initialized to "-1" whenever the update function (updateConnParamsFromZooKeeper) is executed.

      Attachments

        1. HIVE-23581.01.patch
          0.7 kB
          shinsunwoo

        Activity

          People

            sunwoo-shin shinsunwoo
            sunwoo-shin shinsunwoo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: