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

single node RTG: NPE if score is requested

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, master (7.0)
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Found in SOLR-9180 testing.

      In single node solr setups, if an RTG request is made that includes "score" in the fl, then there is an NPE from ResultContext.wantsScores.

      This does not happen if the same request happens in a SolrCloud setup - in that case the request for "score" is silently ignored – this seems to me like the optimal behavior (similarly: using the [explain] transformer in the fl for an RTG is currently silently ignored for both single node and solr cloud envs)

      1. SOLR-9287.patch
        7 kB
        Hoss Man
      2. SOLR-9287.patch
        0.7 kB
        Ishan Chattopadhyaya

        Issue Links

          Activity

          Hide
          hossman Hoss Man added a comment -

          Assertion...

              // if we use RTG (committed or otherwise) score should be ignored
              for (String fl : SCORE_AND_REAL_FIELDS) {
                for (String id : Arrays.asList("42","99")) {
                  assertQ("id="+id+", fl="+fl+" ... score real fields",
                          req("qt","/get","id",id, "wt","xml","fl",fl)
                          ,"count(//doc)=1"
                          ,"//doc/str[@name='id']"
                          ,"//doc/int[@name='val_i']"
                          ,"//doc/str[@name='ssto']"
                          ,"//doc/str[@name='subject']"
                          ,"//doc[count(*)=4]"
                          );
                }
              }
          
          

          Failure...

             [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestPseudoReturnFields -Dtests.method=testScoreAndAllRealFieldsRTG -Dtests.seed=D743B648AB880B72 -Dtests.slow=true -Dtests.locale=no -Dtests.timezone=Pacific/Galapagos -Dtests.asserts=true -Dtests.file.encoding=US-ASCII
             [junit4] ERROR   0.03s J1 | TestPseudoReturnFields.testScoreAndAllRealFieldsRTG <<<
             [junit4]    > Throwable #1: java.lang.RuntimeException: Exception during query
             [junit4]    > 	at __randomizedtesting.SeedInfo.seed([D743B648AB880B72:9B05ED6C0CADD185]:0)
             [junit4]    > 	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:780)
             [junit4]    > 	at org.apache.solr.search.TestPseudoReturnFields.testScoreAndAllRealFieldsRTG(TestPseudoReturnFields.java:172)
             [junit4]    > 	at java.lang.Thread.run(Thread.java:745)
             [junit4]    > Caused by: java.lang.NullPointerException
             [junit4]    > 	at org.apache.solr.response.ResultContext.wantsScores(ResultContext.java:51)
             [junit4]    > 	at org.apache.solr.response.transform.ScoreAugmenter.transform(ScoreAugmenter.java:43)
             [junit4]    > 	at org.apache.solr.handler.component.RealTimeGetComponent.process(RealTimeGetComponent.java:263)
             [junit4]    > 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:292)
             [junit4]    > 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:154)
             [junit4]    > 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2035)
             [junit4]    > 	at org.apache.solr.util.TestHarness.query(TestHarness.java:310)
             [junit4]    > 	at org.apache.solr.util.TestHarness.query(TestHarness.java:292)
             [junit4]    > 	at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:754)
          

          (NOTE: it doesn't matter if the doc is committed or uncommited, the NPE is consistent)

          Show
          hossman Hoss Man added a comment - Assertion... // if we use RTG (committed or otherwise) score should be ignored for ( String fl : SCORE_AND_REAL_FIELDS) { for ( String id : Arrays.asList( "42" , "99" )) { assertQ( "id=" +id+ ", fl=" +fl+ " ... score real fields" , req( "qt" , "/get" , "id" ,id, "wt" , "xml" , "fl" ,fl) , "count( //doc)=1" , " //doc/str[@name='id']" , " //doc/ int [@name='val_i']" , " //doc/str[@name='ssto']" , " //doc/str[@name='subject']" , " //doc[count(*)=4]" ); } } Failure... [junit4] 2> NOTE: reproduce with: ant test -Dtestcase=TestPseudoReturnFields -Dtests.method=testScoreAndAllRealFieldsRTG -Dtests.seed=D743B648AB880B72 -Dtests.slow=true -Dtests.locale=no -Dtests.timezone=Pacific/Galapagos -Dtests.asserts=true -Dtests.file.encoding=US-ASCII [junit4] ERROR 0.03s J1 | TestPseudoReturnFields.testScoreAndAllRealFieldsRTG <<< [junit4] > Throwable #1: java.lang.RuntimeException: Exception during query [junit4] > at __randomizedtesting.SeedInfo.seed([D743B648AB880B72:9B05ED6C0CADD185]:0) [junit4] > at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:780) [junit4] > at org.apache.solr.search.TestPseudoReturnFields.testScoreAndAllRealFieldsRTG(TestPseudoReturnFields.java:172) [junit4] > at java.lang.Thread.run(Thread.java:745) [junit4] > Caused by: java.lang.NullPointerException [junit4] > at org.apache.solr.response.ResultContext.wantsScores(ResultContext.java:51) [junit4] > at org.apache.solr.response.transform.ScoreAugmenter.transform(ScoreAugmenter.java:43) [junit4] > at org.apache.solr.handler.component.RealTimeGetComponent.process(RealTimeGetComponent.java:263) [junit4] > at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:292) [junit4] > at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:154) [junit4] > at org.apache.solr.core.SolrCore.execute(SolrCore.java:2035) [junit4] > at org.apache.solr.util.TestHarness.query(TestHarness.java:310) [junit4] > at org.apache.solr.util.TestHarness.query(TestHarness.java:292) [junit4] > at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:754) (NOTE: it doesn't matter if the doc is committed or uncommited, the NPE is consistent)
          Hide
          hossman Hoss Man added a comment -

          See also...

          • TestPseudoReturnFields.testScoreAndExplicitRealFieldsRTG
          • TestPseudoReturnFields.testScoreAndAllRealFieldsRTG
          • TestPseudoReturnFields.testGlobsAndScoreRTG
          • TestPseudoReturnFields.testAugmentersAndScoreRTG
          • TestPseudoReturnFields.testAugmentersGlobsExplicitAndScoreOhMyRTG
          Show
          hossman Hoss Man added a comment - See also... TestPseudoReturnFields.testScoreAndExplicitRealFieldsRTG TestPseudoReturnFields.testScoreAndAllRealFieldsRTG TestPseudoReturnFields.testGlobsAndScoreRTG TestPseudoReturnFields.testAugmentersAndScoreRTG TestPseudoReturnFields.testAugmentersGlobsExplicitAndScoreOhMyRTG
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit fee9526208375fec6a7651249b182fbca1a29703 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=fee9526 ]

          SOLR-9180: More comprehensive tests of psuedo-fields for RTG and SolrCloud requests

          This commit also includes new @AwaitsFix'ed tests for the following known issues...

          • SOLR-9285 ArrayIndexOutOfBoundsException when ValueSourceAugmenter used with RTG on uncommitted doc
          • SOLR-9286 SolrCloud RTG: psuedo-fields (like ValueSourceAugmenter, [shard], etc...) silently fails (even for committed doc)
          • SOLR-9287 single node RTG: NPE if score is requested
          • SOLR-9288 RTG: fl=[docid] silently missing for uncommitted docs
          • SOLR-9289 SolrCloud RTG: fl=[docid] silently ignored for all docs

          (cherry picked from commit ae316f1e39e58d89758f997913a38059d74ccb47)

          Show
          jira-bot ASF subversion and git services added a comment - Commit fee9526208375fec6a7651249b182fbca1a29703 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=fee9526 ] SOLR-9180 : More comprehensive tests of psuedo-fields for RTG and SolrCloud requests This commit also includes new @AwaitsFix'ed tests for the following known issues... SOLR-9285 ArrayIndexOutOfBoundsException when ValueSourceAugmenter used with RTG on uncommitted doc SOLR-9286 SolrCloud RTG: psuedo-fields (like ValueSourceAugmenter, [shard] , etc...) silently fails (even for committed doc) SOLR-9287 single node RTG: NPE if score is requested SOLR-9288 RTG: fl= [docid] silently missing for uncommitted docs SOLR-9289 SolrCloud RTG: fl= [docid] silently ignored for all docs (cherry picked from commit ae316f1e39e58d89758f997913a38059d74ccb47)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ae316f1e39e58d89758f997913a38059d74ccb47 in lucene-solr's branch refs/heads/master from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae316f1 ]

          SOLR-9180: More comprehensive tests of psuedo-fields for RTG and SolrCloud requests

          This commit also includes new @AwaitsFix'ed tests for the following known issues...

          • SOLR-9285 ArrayIndexOutOfBoundsException when ValueSourceAugmenter used with RTG on uncommitted doc
          • SOLR-9286 SolrCloud RTG: psuedo-fields (like ValueSourceAugmenter, [shard], etc...) silently fails (even for committed doc)
          • SOLR-9287 single node RTG: NPE if score is requested
          • SOLR-9288 RTG: fl=[docid] silently missing for uncommitted docs
          • SOLR-9289 SolrCloud RTG: fl=[docid] silently ignored for all docs
          Show
          jira-bot ASF subversion and git services added a comment - Commit ae316f1e39e58d89758f997913a38059d74ccb47 in lucene-solr's branch refs/heads/master from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae316f1 ] SOLR-9180 : More comprehensive tests of psuedo-fields for RTG and SolrCloud requests This commit also includes new @AwaitsFix'ed tests for the following known issues... SOLR-9285 ArrayIndexOutOfBoundsException when ValueSourceAugmenter used with RTG on uncommitted doc SOLR-9286 SolrCloud RTG: psuedo-fields (like ValueSourceAugmenter, [shard] , etc...) silently fails (even for committed doc) SOLR-9287 single node RTG: NPE if score is requested SOLR-9288 RTG: fl= [docid] silently missing for uncommitted docs SOLR-9289 SolrCloud RTG: fl= [docid] silently ignored for all docs
          Hide
          ichattopadhyaya Ishan Chattopadhyaya added a comment -

          Trivial fix for the NPE.

          Show
          ichattopadhyaya Ishan Chattopadhyaya added a comment - Trivial fix for the NPE.
          Hide
          hossman Hoss Man added a comment -

          updated patch modifying all 3 tests that were marked @AwaitFix(SOLR-9287) ... 2 are now enabled, the other has been updated to be @AwaitsFix(SOLR-9285) since that issue still prevents the test from passing.

          Show
          hossman Hoss Man added a comment - updated patch modifying all 3 tests that were marked @AwaitFix( SOLR-9287 ) ... 2 are now enabled, the other has been updated to be @AwaitsFix( SOLR-9285 ) since that issue still prevents the test from passing.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b3cc4b3111120c43747a60177389ff9ad7a5a840 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b3cc4b3 ]

          SOLR-9287: Including 'score' in the 'fl' param when doing an RTG no longer causes an NPE

          (cherry picked from commit 462dc04cb6aaf3a876b56f27c6b511b00e25e85a)

          Show
          jira-bot ASF subversion and git services added a comment - Commit b3cc4b3111120c43747a60177389ff9ad7a5a840 in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b3cc4b3 ] SOLR-9287 : Including 'score' in the 'fl' param when doing an RTG no longer causes an NPE (cherry picked from commit 462dc04cb6aaf3a876b56f27c6b511b00e25e85a)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 462dc04cb6aaf3a876b56f27c6b511b00e25e85a in lucene-solr's branch refs/heads/master from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=462dc04 ]

          SOLR-9287: Including 'score' in the 'fl' param when doing an RTG no longer causes an NPE

          Show
          jira-bot ASF subversion and git services added a comment - Commit 462dc04cb6aaf3a876b56f27c6b511b00e25e85a in lucene-solr's branch refs/heads/master from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=462dc04 ] SOLR-9287 : Including 'score' in the 'fl' param when doing an RTG no longer causes an NPE
          Hide
          hossman Hoss Man added a comment -

          thanks for the help Ishan

          Show
          hossman Hoss Man added a comment - thanks for the help Ishan
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

            People

            • Assignee:
              hossman Hoss Man
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development