Solr
  1. Solr
  2. SOLR-5659

Ignore or throw proper error message for bad delete containing bad composite ID

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 4.7, 6.0
    • Component/s: SolrCloud
    • Labels:
      None
    • Environment:

      5.0-SNAPSHOT 1480985:1559676M - markus - 2014-01-20 13:48:08

      Description

      The following error is thrown when sending deleteById via SolrJ with ID ending with an exclamation mark, it is also the case for deletes by id via the URL. For some curious reason delete by query using the id field does not fail, but i would expect the same behaviour.

      • fails: /solr/update?commit=true&stream.body=<delete><id>a!</id></delete>
      • ok: /solr/update?commit=true&stream.body=<delete><query>id:a!</query></delete>
      2014-01-22 15:32:48,826 ERROR [solr.core.SolrCore] - [http-8080-exec-5] - : java.lang.ArrayIndexOutOfBoundsException: 1
              at org.apache.solr.common.cloud.CompositeIdRouter$KeyParser.getHash(CompositeIdRouter.java:291)
              at org.apache.solr.common.cloud.CompositeIdRouter.sliceHash(CompositeIdRouter.java:58)
              at org.apache.solr.common.cloud.HashBasedRouter.getTargetSlice(HashBasedRouter.java:33)
              at org.apache.solr.update.processor.DistributedUpdateProcessor.setupRequest(DistributedUpdateProcessor.java:218)
              at org.apache.solr.update.processor.DistributedUpdateProcessor.processDelete(DistributedUpdateProcessor.java:961)
              at org.apache.solr.update.processor.UpdateRequestProcessor.processDelete(UpdateRequestProcessor.java:55)
              at org.apache.solr.handler.loader.XMLLoader.processDelete(XMLLoader.java:347)
              at org.apache.solr.handler.loader.XMLLoader.processUpdate(XMLLoader.java:278)
              at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:174)
              at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
              at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
              at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
              at org.apache.solr.core.SolrCore.execute(SolrCore.java:1915)
              at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:785)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:203)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
              at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
              at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:744)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2282)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:724) 
      

      See also: http://lucene.472066.n3.nabble.com/AIOOBException-on-trunk-since-21st-or-22nd-build-td4112753.html

      1. SOLR-5659.patch
        3 kB
        Shalin Shekhar Mangar
      2. SOLR-5659.patch
        2 kB
        Anshum Gupta

        Activity

        Hide
        Yonik Seeley added a comment - - edited

        This sounds like a bug in CompositeIdRouter - there should not be any ID for which it throws an exception (it was made the default because it is completely transparent, other than the hash codes it produces).

        Show
        Yonik Seeley added a comment - - edited This sounds like a bug in CompositeIdRouter - there should not be any ID for which it throws an exception (it was made the default because it is completely transparent, other than the hash codes it produces).
        Hide
        Shalin Shekhar Mangar added a comment - - edited

        Yes, I think this was introduced with SOLR-5320

        Show
        Shalin Shekhar Mangar added a comment - - edited Yes, I think this was introduced with SOLR-5320
        Hide
        Anshum Gupta added a comment -

        Fix and a test which fails without the patch.

        Show
        Anshum Gupta added a comment - Fix and a test which fails without the patch.
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Anshum. I added a delete by ID with an id ending with '!' to the test. I'll commit this shortly.

        Show
        Shalin Shekhar Mangar added a comment - Thanks Anshum. I added a delete by ID with an id ending with '!' to the test. I'll commit this shortly.
        Hide
        ASF subversion and git services added a comment -

        Commit 1565572 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1565572 ]

        SOLR-5659: Add test for compositeId ending with a separator char

        Show
        ASF subversion and git services added a comment - Commit 1565572 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1565572 ] SOLR-5659 : Add test for compositeId ending with a separator char
        Hide
        ASF subversion and git services added a comment -

        Commit 1565573 from shalin@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1565573 ]

        SOLR-5659: Add test for compositeId ending with a separator char

        Show
        ASF subversion and git services added a comment - Commit 1565573 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1565573 ] SOLR-5659 : Add test for compositeId ending with a separator char
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Markus and Anshum!

        Show
        Shalin Shekhar Mangar added a comment - Thanks Markus and Anshum!

          People

          • Assignee:
            Anshum Gupta
            Reporter:
            Markus Jelsma
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development