Hive
  1. Hive
  2. HIVE-5524

Unwanted delay in getting Hive metastore connection with METASTORE_CLIENT_CONNECT_RETRY_DELAY/

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None

      Description

      Reference: http://svn.apache.org/repos/asf/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java

      >>>>
      for (URI store : metastoreUris) {
      ....
      ...
      if (isConnected)

      { break; }

      }

      // Wait before launching the next round of connection retries.
      if (retryDelaySeconds > 0) {
      try

      { LOG.info("Waiting " + retryDelaySeconds + " seconds before next connection attempt."); Thread.sleep(retryDelaySeconds * 1000); }

      catch (InterruptedException ignore) {}
      }
      >>>>

      By default "hive.metastore.client.connect.retry.delay" is set to 1 second. If it is set to 10 seconds, this code will wait for 10 seconds even if a successful connection is made in first attempt itself.

      This can be avoided by changing to

      >>>>
      if (!isConnected && retryDelaySeconds > 0) {
      ....
      >>>>

      1. HIVE-5524.patch
        0.7 kB
        Rajesh Balamohan

        Activity

        Hide
        Rajesh Balamohan added a comment -

        Attaching the patch

        Show
        Rajesh Balamohan added a comment - Attaching the patch
        Hide
        Harsh J added a comment -

        Marking as Patch Available for review.

        Show
        Harsh J added a comment - Marking as Patch Available for review.
        Hide
        Brock Noland added a comment -

        +1 if tests pass

        Show
        Brock Noland added a comment - +1 if tests pass
        Hide
        Hive QA added a comment -

        Overall: +1 all checks pass

        Here are the results of testing the latest attachment:
        https://issues.apache.org/jira/secure/attachment/12608131/HIVE-5524.patch

        SUCCESS: +1 4761 tests passed

        Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/594/testReport
        Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/594/console

        Messages:

        Executing org.apache.hive.ptest.execution.PrepPhase
        Executing org.apache.hive.ptest.execution.ExecutionPhase
        Executing org.apache.hive.ptest.execution.ReportingPhase
        

        This message is automatically generated.

        ATTACHMENT ID: 12608131

        Show
        Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12608131/HIVE-5524.patch SUCCESS: +1 4761 tests passed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/594/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/594/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated. ATTACHMENT ID: 12608131
        Hide
        Brock Noland added a comment -

        I have committed this to trunk but I am unable to assign to Rajesh since he is not a contributor in JIRA. I have requested Rajesh be added as a contributor and will give proper credit when that is done.

        Thank you for the contribution Rajesh!

        Show
        Brock Noland added a comment - I have committed this to trunk but I am unable to assign to Rajesh since he is not a contributor in JIRA. I have requested Rajesh be added as a contributor and will give proper credit when that is done. Thank you for the contribution Rajesh!

          People

          • Assignee:
            Rajesh Balamohan
            Reporter:
            Rajesh Balamohan
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development