Solr
  1. Solr
  2. SOLR-5502

A "/" in the ID itself throws an ArrayIndexOutOfBoundsException when using the composite id router

    Details

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

      Description

      While using the composite-id router, if the routing-id contains a "/" in the id part, the code throws an ArrayIndexOutOfBoundsException.

      1. SOLR-5502.patch
        5 kB
        Anshum Gupta
      2. SOLR-5502.patch
        5 kB
        Anshum Gupta
      3. SOLR-5502.patch
        1.0 kB
        Anshum Gupta

        Issue Links

          Activity

          Hide
          Mark Miller added a comment -

          Thanks! Got a test as well?

          Show
          Mark Miller added a comment - Thanks! Got a test as well?
          Hide
          Anshum Gupta added a comment -

          I have one, but I've been without a proper internet connection right now.
          Will upload one tomorrow.

          Show
          Anshum Gupta added a comment - I have one, but I've been without a proper internet connection right now. Will upload one tomorrow.
          Hide
          Anshum Gupta added a comment -

          Patch with a one liner test.
          The test tries to add a doc with a "/" in the id and fails without the patch.

          Show
          Anshum Gupta added a comment - Patch with a one liner test. The test tries to add a doc with a "/" in the id and fails without the patch.
          Hide
          Mark Miller added a comment -

          Hey Anshum, I'm seeing the following fail after applying the patch:

             [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=ShardRoutingTest -Dtests.method=testDistribSearch -Dtests.seed=3B53611D9EEA5A03 -Dtests.slow=true -Dtests.locale=sq -Dtests.timezone=AET -Dtests.file.encoding=UTF-8
             [junit4] ERROR   37.2s J1 | ShardRoutingTest.testDistribSearch <<<
             [junit4]    > Throwable #1: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: 2
             [junit4]    > 	at __randomizedtesting.SeedInfo.seed([3B53611D9EEA5A03:BAB5EF05E9B53A3F]:0)
             [junit4]    > 	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:491)
             [junit4]    > 	at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:197)
             [junit4]    > 	at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
             [junit4]    > 	at org.apache.solr.cloud.AbstractFullDistribZkTestBase.indexDoc(AbstractFullDistribZkTestBase.java:620)
             [junit4]    > 	at org.apache.solr.BaseDistributedSearchTestCase.index(BaseDistributedSearchTestCase.java:425)
             [junit4]    > 	at org.apache.solr.cloud.ShardRoutingTest.doAddDoc(ShardRoutingTest.java:308)
             [junit4]    > 	at org.apache.solr.cloud.ShardRoutingTest.doHashingTest(ShardRoutingTest.java:152)
             [junit4]    > 	at org.apache.solr.cloud.ShardRoutingTest.doTest(ShardRoutingTest.java:123)
             [junit4]    > 	at org.apache.solr.BaseDistributedSearchTestCase.testDistribSearch(BaseDistributedSearchTestCase.java:843)
             [junit4]    > 	at java.lang.Thread.run(Thread.java:724)
          
          Show
          Mark Miller added a comment - Hey Anshum, I'm seeing the following fail after applying the patch: [junit4] 2> NOTE: reproduce with: ant test -Dtestcase=ShardRoutingTest -Dtests.method=testDistribSearch -Dtests.seed=3B53611D9EEA5A03 -Dtests.slow=true -Dtests.locale=sq -Dtests.timezone=AET -Dtests.file.encoding=UTF-8 [junit4] ERROR 37.2s J1 | ShardRoutingTest.testDistribSearch <<< [junit4] > Throwable #1: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: 2 [junit4] > at __randomizedtesting.SeedInfo.seed([3B53611D9EEA5A03:BAB5EF05E9B53A3F]:0) [junit4] > at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:491) [junit4] > at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:197) [junit4] > at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117) [junit4] > at org.apache.solr.cloud.AbstractFullDistribZkTestBase.indexDoc(AbstractFullDistribZkTestBase.java:620) [junit4] > at org.apache.solr.BaseDistributedSearchTestCase.index(BaseDistributedSearchTestCase.java:425) [junit4] > at org.apache.solr.cloud.ShardRoutingTest.doAddDoc(ShardRoutingTest.java:308) [junit4] > at org.apache.solr.cloud.ShardRoutingTest.doHashingTest(ShardRoutingTest.java:152) [junit4] > at org.apache.solr.cloud.ShardRoutingTest.doTest(ShardRoutingTest.java:123) [junit4] > at org.apache.solr.BaseDistributedSearchTestCase.testDistribSearch(BaseDistributedSearchTestCase.java:843) [junit4] > at java.lang.Thread.run(Thread.java:724)
          Hide
          Anshum Gupta added a comment -

          Missed the fix while creating the patch.
          This one passes just fine on my machine.

          Show
          Anshum Gupta added a comment - Missed the fix while creating the patch. This one passes just fine on my machine.
          Hide
          ASF subversion and git services added a comment -

          Commit 1547452 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1547452 ]

          SOLR-5502: A "/" in a document id will cause an exception to be thrown when using the composite id router.

          Show
          ASF subversion and git services added a comment - Commit 1547452 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1547452 ] SOLR-5502 : A "/" in a document id will cause an exception to be thrown when using the composite id router.
          Hide
          ASF subversion and git services added a comment -

          Commit 1547461 from Mark Miller in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1547461 ]

          SOLR-5502: A "/" in a document id will cause an exception to be thrown when using the composite id router.

          Show
          ASF subversion and git services added a comment - Commit 1547461 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1547461 ] SOLR-5502 : A "/" in a document id will cause an exception to be thrown when using the composite id router.
          Hide
          ASF subversion and git services added a comment -

          Commit 1547522 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1547522 ]

          SOLR-5502: Fix inadvertently removed changes entry

          Show
          ASF subversion and git services added a comment - Commit 1547522 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1547522 ] SOLR-5502 : Fix inadvertently removed changes entry
          Hide
          ASF subversion and git services added a comment -

          Commit 1547525 from Mark Miller in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1547525 ]

          SOLR-5502: Fix inadvertently removed changes entry

          Show
          ASF subversion and git services added a comment - Commit 1547525 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1547525 ] SOLR-5502 : Fix inadvertently removed changes entry
          Hide
          Mark Miller added a comment -

          Thanks Anshum!

          Show
          Mark Miller added a comment - Thanks Anshum!
          Hide
          Yonik Seeley added a comment -

          This is marked as a bug in 4.6, but I can't seem to replicate it. Are you sure this bug wasn't just introduced by changes to the composite router after 4.6 was released?

          Show
          Yonik Seeley added a comment - This is marked as a bug in 4.6, but I can't seem to replicate it. Are you sure this bug wasn't just introduced by changes to the composite router after 4.6 was released?
          Hide
          Anshum Gupta added a comment -

          Thanks for pointing that out Yonik. I just realized that this was introduced post 4.6 (with the multi-level changes).

          Show
          Anshum Gupta added a comment - Thanks for pointing that out Yonik. I just realized that this was introduced post 4.6 (with the multi-level changes).
          Hide
          Shalin Shekhar Mangar added a comment -

          I'll fix the change log.

          Show
          Shalin Shekhar Mangar added a comment - I'll fix the change log.
          Hide
          Mark Miller added a comment -

          Let's move the CHANGES entry to other and change it to adding a test for this.

          Show
          Mark Miller added a comment - Let's move the CHANGES entry to other and change it to adding a test for this.
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5502: Moving change log entry to the other section because this bug hasn't been released yet

          Show
          ASF subversion and git services added a comment - Commit 1547835 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1547835 ] SOLR-5502 : Moving change log entry to the other section because this bug hasn't been released yet
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5502: Moving change log entry to the other section because this bug hasn't been released yet

          Show
          ASF subversion and git services added a comment - Commit 1547836 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1547836 ] SOLR-5502 : Moving change log entry to the other section because this bug hasn't been released yet
          Hide
          Shalin Shekhar Mangar added a comment -

          Let's move the CHANGES entry to other and change it to adding a test for this.

          Done. Thanks!

          Show
          Shalin Shekhar Mangar added a comment - Let's move the CHANGES entry to other and change it to adding a test for this. Done. Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development