Solr
  1. Solr
  2. SOLR-6295

AssertionError in ToChildBlockJoinScorer.advance

    Details

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

      Description

      This happened in Solr land in the SolrExampleStreamingTest.testChildDoctransformer

      https://builds.apache.org/job/Lucene-Solr-Maven-4.x/665/

      327371 T810 oejs.ServletHandler.doHandle WARN Error for /solr/collection1/select java.lang.AssertionError
      	at org.apache.lucene.search.join.ToChildBlockJoinQuery$ToChildBlockJoinScorer.advance(ToChildBlockJoinQuery.java:286)
      	at org.apache.lucene.search.FilteredQuery$LeapFrogScorer.advanceToNextCommonDoc(FilteredQuery.java:274)
      	at org.apache.lucene.search.FilteredQuery$LeapFrogScorer.nextDoc(FilteredQuery.java:286)
      	at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:192)
      	at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:163)
      	at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:35)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:621)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:297)
      	at org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:209)
      	at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1619)
      	at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1433)
      	at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:514)
      	at org.apache.solr.search.SolrIndexSearcher.getDocList(SolrIndexSearcher.java:1268)
      	at org.apache.solr.response.transform.ChildDocTransformer.transform(ChildDocTransformerFactory.java:144)
      	at org.apache.solr.response.TextResponseWriter.writeDocuments(TextResponseWriter.java:252)
      	at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:170)
      	at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:112)
      	at org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:40)
      	at org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:765)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:426)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
      
      1. block-join.log
        896 kB
        Shalin Shekhar Mangar
      2. SOLR-6295.patch
        1 kB
        Varun Thacker

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        Full log attached lest jenkins deletes it.

        Show
        Shalin Shekhar Mangar added a comment - Full log attached lest jenkins deletes it.
        Hide
        Mark Miller added a comment -

        I just saw this on a nightly run as well.

        Show
        Mark Miller added a comment - I just saw this on a nightly run as well.
        Hide
        Varun Thacker added a comment -

        We should never create a childFilterQuery which matches parent documents as it violates the BJQ assert.

        From the test seed this was the query being formed which was causing the AssertionError -

        q=name:python&fq=level_i:1&fl=id,[child parentFilter="level_i:1" childFilter="level_i:[1 TO 1]" limit="7"]
        

        Patch fixes kidLevelMin to be 1 more than parentLevel always. We do the same in L1315 currently.

        Show
        Varun Thacker added a comment - We should never create a childFilterQuery which matches parent documents as it violates the BJQ assert. From the test seed this was the query being formed which was causing the AssertionError - q=name:python&fq=level_i:1&fl=id,[child parentFilter="level_i:1" childFilter="level_i:[1 TO 1]" limit="7"] Patch fixes kidLevelMin to be 1 more than parentLevel always. We do the same in L1315 currently.
        Hide
        Varun Thacker added a comment -

        We do the same in L1315 currently.

        I meant Line 1315 in SolrExampleTests. Sorry for being vague.

        Show
        Varun Thacker added a comment - We do the same in L1315 currently. I meant Line 1315 in SolrExampleTests. Sorry for being vague.
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Varun. In this case, why is such a query even accepted by Solr? Most people don't have assertions enabled and they'd never get this error.

        Show
        Shalin Shekhar Mangar added a comment - Thanks Varun. In this case, why is such a query even accepted by Solr? Most people don't have assertions enabled and they'd never get this error.
        Hide
        Mikhail Khludnev added a comment -

        damn! I've thought all of these was covered during LUCENE-5375

        Show
        Mikhail Khludnev added a comment - damn! I've thought all of these was covered during LUCENE-5375
        Hide
        Varun Thacker added a comment -

        Mikhail Khludnev - Thanks for pointing out LUCENE-5375 . So LUCENE-5375 fixes the cases where the subQuery is wrong. In this case since ChildDocTransformerFactory is adding 'childFilterQuery' as a filter it's not getting caught correctly?
        Would you want to tackle that as a separate Jira?

        I guess the test fix should be committed anyways.

        Show
        Varun Thacker added a comment - Mikhail Khludnev - Thanks for pointing out LUCENE-5375 . So LUCENE-5375 fixes the cases where the subQuery is wrong. In this case since ChildDocTransformerFactory is adding 'childFilterQuery' as a filter it's not getting caught correctly? Would you want to tackle that as a separate Jira? I guess the test fix should be committed anyways.
        Hide
        Mikhail Khludnev added a comment -

        Varun Thacker agree with fixing test, and with the separate ticket for assert also.

        Show
        Mikhail Khludnev added a comment - Varun Thacker agree with fixing test, and with the separate ticket for assert also.
        Hide
        Varun Thacker added a comment -

        Varun Thacker agree with fixing test, and with the separate ticket for assert also.

        Created LUCENE-5873

        Show
        Varun Thacker added a comment - Varun Thacker agree with fixing test, and with the separate ticket for assert also. Created LUCENE-5873
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6295: Fix child filter query creation to never match parent docs in SolrExampleTests

        Show
        ASF subversion and git services added a comment - Commit 1633679 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1633679 ] SOLR-6295 : Fix child filter query creation to never match parent docs in SolrExampleTests
        Hide
        ASF subversion and git services added a comment -

        Commit 1633680 from shalin@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1633680 ]

        SOLR-6295: Fix child filter query creation to never match parent docs in SolrExampleTests

        Show
        ASF subversion and git services added a comment - Commit 1633680 from shalin@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1633680 ] SOLR-6295 : Fix child filter query creation to never match parent docs in SolrExampleTests
        Hide
        Shalin Shekhar Mangar added a comment -

        I have committed the test fix. Thanks Varun and Mikhail!

        It'd be great if one of you can help with LUCENE-5873. I am not familiar with that area of lucene/solr.

        Show
        Shalin Shekhar Mangar added a comment - I have committed the test fix. Thanks Varun and Mikhail! It'd be great if one of you can help with LUCENE-5873 . I am not familiar with that area of lucene/solr.
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Shalin Shekhar Mangar
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development