Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5954

Slower dataimport process caused by not reusing jdbc connections

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.7.1
    • Fix Version/s: 4.8, 6.0
    • Labels:
      None

      Description

      Hi,
      SOLR-5734 introduced a regression that causes that the connections used in the dataimport process were closed and reopen in every sql.

      The change to nanoTime in the method getConnection of JdbcDataSource.java forgot to convert the timeout used to reuse the connection.

      The constant CONN_TIME_OUT must be changed to nanos to be compared. (*1000*1000)

      private Connection getConnection() throws Exception {
      long currTime = System.nanoTime();
      if (currTime - connLastUsed > CONN_TIME_OUT) {<<<<<<<<<<<<<<<
      synchronized (this)

      { Connection tmpConn = factory.call(); closeConnection(); connLastUsed = System.nanoTime(); return conn = tmpConn; }

      } else

      { connLastUsed = currTime; return conn; }

      }

      private static final long CONN_TIME_OUT = 10 * 1000; // 10 seconds

      Regards

      1. SOLR-5954.patch
        0.6 kB
        Mark Miller

        Issue Links

          Activity

          Hide
          nagkumar Raja Nagendra Kumar added a comment -

          concise and readable change for this bug would be

          private static final long CONN_TIME_OUT = TimeUnit.SECONDS.toNanos(10); // 10 seconds

          Show
          nagkumar Raja Nagendra Kumar added a comment - concise and readable change for this bug would be private static final long CONN_TIME_OUT = TimeUnit.SECONDS.toNanos(10); // 10 seconds
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1587706 from markrmiller@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1587706 ]

          SOLR-5954: Slower DataImportHandler process caused by not reusing jdbc connections.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1587706 from markrmiller@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1587706 ] SOLR-5954 : Slower DataImportHandler process caused by not reusing jdbc connections.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1587707 from markrmiller@apache.org in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1587707 ]

          SOLR-5954: Slower DataImportHandler process caused by not reusing jdbc connections.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1587707 from markrmiller@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1587707 ] SOLR-5954 : Slower DataImportHandler process caused by not reusing jdbc connections.
          Hide
          thetaphi Uwe Schindler added a comment -

          Move issue to Solr 4.9.

          Show
          thetaphi Uwe Schindler added a comment - Move issue to Solr 4.9.
          Hide
          markrmiller@gmail.com Mark Miller added a comment -

          We should put this regression into 4.8.

          Show
          markrmiller@gmail.com Mark Miller added a comment - We should put this regression into 4.8.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1587924 from markrmiller@apache.org in branch 'dev/branches/lucene_solr_4_8'
          [ https://svn.apache.org/r1587924 ]

          SOLR-5954: Slower DataImportHandler process caused by not reusing jdbc connections.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1587924 from markrmiller@apache.org in branch 'dev/branches/lucene_solr_4_8' [ https://svn.apache.org/r1587924 ] SOLR-5954 : Slower DataImportHandler process caused by not reusing jdbc connections.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1587925 from markrmiller@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1587925 ]

          SOLR-5954: Move CHANGES entry to 4.8.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1587925 from markrmiller@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1587925 ] SOLR-5954 : Move CHANGES entry to 4.8.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1587926 from markrmiller@apache.org in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1587926 ]

          SOLR-5954: Move CHANGES entry to 4.8.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1587926 from markrmiller@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1587926 ] SOLR-5954 : Move CHANGES entry to 4.8.
          Hide
          thetaphi Uwe Schindler added a comment -

          Close issue after release of 4.8.0

          Show
          thetaphi Uwe Schindler added a comment - Close issue after release of 4.8.0

            People

            • Assignee:
              markrmiller@gmail.com Mark Miller
              Reporter:
              pacoge36 Paco Garcia
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development