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

Solr 6.x DataImportHandler fails with postgreSQL dataSource with multiple joined entities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.0, 6.0.1
    • 6.0.2, 6.1, 6.1.1, 6.2, 7.0
    • update
    • None
    • Solr 6.0, 6.0.1 Single Instance or SolrCloud with postgreSQL 9.4 Server on Java Version 1.8.0_91 runtime

    Description

      solr-data-config.xml

      <dataConfig>
        <dataSource name="jdbc" driver="org.postgresql.Driver" url="jdbc:postgresql://host:5432/database" user="username" password="password" readOnly="true" autoCommit="false" />
        <document>
          <entity name="outer" dataSource="jdbc" pk="id" query="SELECT id, a FROM table_a ORDER BY id ASC">
      		<field column="id" name="id" />
      		<field column="a" name="a" />
      	
      		<entity name="inner_one" query="SELECT a_id, b FROM table_b"
      				cacheKey="a_id" cacheLookup="outer.id" cacheImpl="SortedMapBackedCache">
      			<field column="b" name="b" />
      		</entity>
      		
      		<entity name="inner_two" query="SELECT a_id, c FROM table_c ORDER BY a_id ASC"
      				cacheKey="a_id" cacheLookup="outer.id" join="zipper">
      			<field column="c" name="c" />
      		</entity>
      
      	</entity>
        </document>
      </dataConfig>
      

      This works up to SOLR 5.5.2 (latest 5.x) but fails in SOLR 6.x.

      Exception:

      org.apache.solr.handler.dataimport.DataImportHandlerException: org.postgresql.util.PSQLException: Dieses ResultSet ist geschlossen.
      at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:61)
      at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.hasnext(JdbcDataSource.java:434)
      at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator$1.hasNext(JdbcDataSource.java:350)
      at com.google.common.collect.Iterators$PeekingImpl.hasNext(Iterators.java:1216)
      at org.apache.solr.handler.dataimport.Zipper.supplyNextChild(Zipper.java:65)
      at org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:127)
      at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:75)
      at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:244)
      at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:475)
      at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:514)
      at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:414)
      at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:329)
      at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:232)
      at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:416)
      at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:480)
      at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:200)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:2053)
      at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:652)
      at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:460)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:229)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:184)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      at org.eclipse.jetty.server.Server.handle(Server.java:518)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
      at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
      at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        1. SOLR-9256.patch
          3 kB
          Kristine Jetzke

        Issue Links

          Activity

            People

              Unassigned Unassigned
              benjamin.richter Benjamin Richter
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: