Solr
  1. Solr
  2. SOLR-4175

SearchComponent chain can't contain two components of the same class and use debugQuery

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      steps to reproduce the issue:

      1) Add two components of the same type to the components chain of the request handler
      2) start solr with assertions enabled
      3) run a query to the request handler configured in 1 with debugQuery=true

      The query will throw a java.lang.AssertionError. I'll attach a test case to reproduce the issue.

      1. failure.patch
        6 kB
        Tomás Fernández Löbbe
      2. SOLR-4175.patch
        11 kB
        Tomás Fernández Löbbe
      3. SOLR-4175.patch
        21 kB
        Tomás Fernández Löbbe
      4. SOLR-4175.patch
        9 kB
        Tomás Fernández Löbbe

        Activity

        Hide
        Tomás Fernández Löbbe added a comment -

        Test case that reproduces the issue. The stacktrace of the exception from the testcase is:

        java.lang.AssertionError
        	at __randomizedtesting.SeedInfo.seed([6728CDE529822998:8CC5D3EF92899577]:0)
        	at org.apache.solr.util.RTimer.stop(RTimer.java:63)
        	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:195)
        	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:146)
        	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1818)
        	at org.apache.solr.util.TestHarness.query(TestHarness.java:365)
        	at org.apache.solr.util.TestHarness.query(TestHarness.java:347)
        	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:489)
        	at org.apache.solr.search.TestComponentsName.testComponentsName(TestComponentsName.java:32)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1559)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner.access$600(RandomizedRunner.java:79)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:737)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:773)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:787)
        	at com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53)
        	at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:50)
        	at org.apache.lucene.util.TestRuleFieldCacheSanity$1.evaluate(TestRuleFieldCacheSanity.java:51)
        	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46)
        	at com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55)
        	at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:49)
        	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70)
        	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
        	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:358)
        	at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:782)
        	at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:442)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:746)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:648)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:682)
        	at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:693)
        	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        	at com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53)
        	at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46)
        	at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:42)
        	at com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55)
        	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
        	at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39)
        	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        	at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:43)
        	at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
        	at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70)
        	at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
        	at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        	at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:358)
        	at java.lang.Thread.run(Thread.java:680)
        
        
        
        Show
        Tomás Fernández Löbbe added a comment - Test case that reproduces the issue. The stacktrace of the exception from the testcase is: java.lang.AssertionError at __randomizedtesting.SeedInfo.seed([6728CDE529822998:8CC5D3EF92899577]:0) at org.apache.solr.util.RTimer.stop(RTimer.java:63) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:195) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:146) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1818) at org.apache.solr.util.TestHarness.query(TestHarness.java:365) at org.apache.solr.util.TestHarness.query(TestHarness.java:347) at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:489) at org.apache.solr.search.TestComponentsName.testComponentsName(TestComponentsName.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1559) at com.carrotsearch.randomizedtesting.RandomizedRunner.access$600(RandomizedRunner.java:79) at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:737) at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:773) at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:787) at com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53) at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:50) at org.apache.lucene.util.TestRuleFieldCacheSanity$1.evaluate(TestRuleFieldCacheSanity.java:51) at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46) at com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55) at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:49) at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70) at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48) at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36) at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:358) at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:782) at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:442) at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:746) at com.carrotsearch.randomizedtesting.RandomizedRunner$3.evaluate(RandomizedRunner.java:648) at com.carrotsearch.randomizedtesting.RandomizedRunner$4.evaluate(RandomizedRunner.java:682) at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:693) at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36) at com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:53) at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46) at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:42) at com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:55) at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39) at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:39) at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36) at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:43) at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48) at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70) at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55) at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36) at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:358) at java.lang.Thread.run(Thread.java:680)
        Hide
        Tomás Fernández Löbbe added a comment -

        I'm attaching a possible fix. The SearchComponent class now uses the name defined in the solrconfig.xml (or the default component name for the default ones).
        This will change the debugQuery output, the "timing section" will use those names instead of the class names, like:

         <lst name="timing">
            <double name="time">2.0</double>
            <lst name="prepare">
              <double name="time">0.0</double>
              <lst name="query">
                <double name="time">0.0</double>
              </lst>
              <lst name="facet">
                <double name="time">0.0</double>
              </lst>
              <lst name="mlt">
                <double name="time">0.0</double>
              </lst>
              <lst name="highlight">
                <double name="time">0.0</double>
              </lst>
              <lst name="stats">
                <double name="time">0.0</double>
              </lst>
              <lst name="debug">
                <double name="time">0.0</double>
              </lst>
        ...
        

        It will also change the MBean names.

        thoughts?

        Show
        Tomás Fernández Löbbe added a comment - I'm attaching a possible fix. The SearchComponent class now uses the name defined in the solrconfig.xml (or the default component name for the default ones). This will change the debugQuery output, the "timing section" will use those names instead of the class names, like: <lst name= "timing" > <double name= "time" > 2.0 </double> <lst name= "prepare" > <double name= "time" > 0.0 </double> <lst name= "query" > <double name= "time" > 0.0 </double> </lst> <lst name= "facet" > <double name= "time" > 0.0 </double> </lst> <lst name= "mlt" > <double name= "time" > 0.0 </double> </lst> <lst name= "highlight" > <double name= "time" > 0.0 </double> </lst> <lst name= "stats" > <double name= "time" > 0.0 </double> </lst> <lst name= "debug" > <double name= "time" > 0.0 </double> </lst> ... It will also change the MBean names. thoughts?
        Hide
        Tomás Fernández Löbbe added a comment -

        Any comments on this issue?

        Show
        Tomás Fernández Löbbe added a comment - Any comments on this issue?
        Hide
        Erik Hatcher added a comment -

        Tomas - looks like a good solution to me. It's one-to-one for a component instance and its name, so this works out nicely.

        One bit of test improvement could be to have MockSearchComponent write something to the response that the test picks up, something that is pulled from the config init, so that both the init params and separate instance cases are accounted for in the tests explicitly.

        Show
        Erik Hatcher added a comment - Tomas - looks like a good solution to me. It's one-to-one for a component instance and its name, so this works out nicely. One bit of test improvement could be to have MockSearchComponent write something to the response that the test picks up, something that is pulled from the config init, so that both the init params and separate instance cases are accounted for in the tests explicitly.
        Hide
        Tomás Fernández Löbbe added a comment -

        I followed Erik's suggestion. I also added more xpath comparisons to show how the debugQuery will be displayed now.

        Show
        Tomás Fernández Löbbe added a comment - I followed Erik's suggestion. I also added more xpath comparisons to show how the debugQuery will be displayed now.
        Hide
        Tomás Fernández Löbbe added a comment -

        Sorry, the last patch is incorrect, use this one.

        Show
        Tomás Fernández Löbbe added a comment - Sorry, the last patch is incorrect, use this one.
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Erik Hatcher
        http://svn.apache.org/viewvc?view=revision&revision=1426569

        SOLR-4175: SearchComponent chain can't contain two components of the same class and use debugQuery

        Show
        Commit Tag Bot added a comment - [trunk commit] Erik Hatcher http://svn.apache.org/viewvc?view=revision&revision=1426569 SOLR-4175 : SearchComponent chain can't contain two components of the same class and use debugQuery
        Hide
        Erik Hatcher added a comment -

        Thanks Tomas! I've applied this both to trunk and 4.x.

        Show
        Erik Hatcher added a comment - Thanks Tomas! I've applied this both to trunk and 4.x.
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Erik Hatcher
        http://svn.apache.org/viewvc?view=revision&revision=1426580

        SOLR-4175: SearchComponent chain can't contain two components of the same class and use debugQuery

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Erik Hatcher http://svn.apache.org/viewvc?view=revision&revision=1426580 SOLR-4175 : SearchComponent chain can't contain two components of the same class and use debugQuery
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1426614

        SOLR-4175: add license headers and eol-style

        Show
        Commit Tag Bot added a comment - [trunk commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1426614 SOLR-4175 : add license headers and eol-style
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1426615

        SOLR-4175: add license headers and eol-style

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1426615 SOLR-4175 : add license headers and eol-style

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Tomás Fernández Löbbe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development