[ https://issues.apache.org/jira/browse/SOLR-6257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066753#comment-14066753 ]
Steve Rowe edited comment on SOLR-6257 at 7/18/14 7:20 PM: ----------------------------------------------------------- Patch with two tests and a fix. The first test routes ID strings known not to conform to the composite ID format, and the second routes ID strings containing a random sequence of "!"-s, "/"-s, random numbers, and random Unicode strings. Both fail without the fix. The included fix changes {{CompositeIdRouter.KeyParser}} to treat the first two "\!"-s in an ID as separators, but then treat any further "\!"-s as regular text. With the fix, the random test passed when I set it to test 5,000,000 IDs, but it's dialed down to 10,000 in the patch. Running all Solr tests now. [~anshumg], I'd appreciate a review if you have time. was (Author: steve_rowe): Patch with two tests and a fix. The first test routes ID strings known not to conform to the composite ID format, and the second routes ID strings containing a random sequence of "!"-s, "/"-s, random numbers, and random Unicode strings. Both fail without the fix. The included fix changes {{CompositeIdRouter.KeyParser}} to treat the first two "\!"-s in an ID as separators, but then treat any further "\!"-s as regular text. With the fix, the random test passed when I set it to test 5,000,000 IDs, but it's dialed down to 1,000 in the patch. Running all Solr tests now. [~anshumg], I'd appreciate a review if you have time. > More than two "!"-s in a doc ID throws an ArrayIndexOutOfBoundsException when > using the composite id router > ----------------------------------------------------------------------------------------------------------- > > Key: SOLR-6257 > URL: https://issues.apache.org/jira/browse/SOLR-6257 > Project: Solr > Issue Type: Bug > Reporter: Steve Rowe > Assignee: Steve Rowe > Attachments: SOLR-6257.patch > > > Since {{CompositeIdRouter}} is the default router, it has to be able to deal > with *any* ID string without throwing an exception. > The following test (added to {{TestHashPartitioner}}) currently fails: > {code:java} > public void testNonConformingCompositeId() throws Exception { > DocRouter router = DocRouter.getDocRouter(CompositeIdRouter.NAME); > DocCollection coll = createCollection(4, router); > Slice targetSlice = coll.getRouter().getTargetSlice("A!B!C!D", null, > null, coll); > assertNotNull(targetSlice); > } > {code} > with the following output: > {noformat} > [junit4] Suite: org.apache.solr.cloud.TestHashPartitioner > [junit4] 2> log4j:WARN No such property [conversionPattern] in > org.apache.solr.util.SolrLogLayout. > [junit4] 2> Creating dataDir: > /Users/sarowe/svn/lucene/dev/trunk/solr/build/solr-core/test/J0/./temp/solr.cloud.TestHashPartitioner-19514036FB5C5E56-001/init-core-data-001 > [junit4] 2> 1233 T11 oas.SolrTestCaseJ4.buildSSLConfig Randomized ssl > (false) and clientAuth (false) > [junit4] 2> 1296 T11 oas.SolrTestCaseJ4.setUp ###Starting > testNonConformingCompositeId > [junit4] > Throwable #1: java.lang.ArrayIndexOutOfBoundsException: 2 > [junit4] > at > __randomizedtesting.SeedInfo.seed([19514036FB5C5E56:3A131EC016F531A4]:0) > [junit4] > at > org.apache.solr.common.cloud.CompositeIdRouter$KeyParser.getHash(CompositeIdRouter.java:296) > [junit4] > at > org.apache.solr.common.cloud.CompositeIdRouter.sliceHash(CompositeIdRouter.java:58) > [junit4] > at > org.apache.solr.common.cloud.HashBasedRouter.getTargetSlice(HashBasedRouter.java:33) > [junit4] > at > org.apache.solr.cloud.TestHashPartitioner.testNonConformingCompositeId(TestHashPartitioner.java:205) > [junit4] > at java.lang.Thread.run(Thread.java:745) > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org