You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/04/05 20:43:00 UTC

[jira] [Commented] (LUCENE-10500) StringValueFacetCounts relies on sequential collection

    [ https://issues.apache.org/jira/browse/LUCENE-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17517693#comment-17517693 ] 

ASF subversion and git services commented on LUCENE-10500:
----------------------------------------------------------

Commit 796a19b457691249b0f3c2fc837f82a378d1d2c6 in lucene's branch refs/heads/main from Luca Cavanna
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=796a19b4576 ]

LUCENE-10500: StringValueFacetCounts to not rely on sequential collection (#788)

StringValueFacetCounts should use the segment ordinal instead of the current index when looping through the matching hits, as when search is multi-threaded the order of the matching hits (one per segment) is not deterministic.

> StringValueFacetCounts relies on sequential collection
> ------------------------------------------------------
>
>                 Key: LUCENE-10500
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10500
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Luca Cavanna
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> We recently moved some of the facets tests to use IndexSearcher#search(Query, CollectorManager) providing a FacetsCollectorManager instead of a FacetsCollector. Whenever newIndexSearcher(IndexReader) is used in tests, concurrent search may now be exercised while it was not before.
> This caused some build failures on TestStringValueFacetCounts:
> {code:java}
> java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
> 	at __randomizedtesting.SeedInfo.seed([ED8BF8281FCE5C02:9FC7DD27AEAEEA71]:0)
> 	at org.apache.lucene.core@10.0.0-SNAPSHOT/org.apache.lucene.util.packed.Packed64.get(Packed64.java:81)
> 	at org.apache.lucene.core@10.0.0-SNAPSHOT/org.apache.lucene.index.OrdinalMap$2.get(OrdinalMap.java:346)
> 	at org.apache.lucene.facet.StringValueFacetCounts.countOneSegment(StringValueFacetCounts.java:440)
> 	at org.apache.lucene.facet.StringValueFacetCounts.count(StringValueFacetCounts.java:295)
> 	at org.apache.lucene.facet.StringValueFacetCounts.<init>(StringValueFacetCounts.java:123)
> 	at org.apache.lucene.facet.TestStringValueFacetCounts.checkFacetResult(TestStringValueFacetCounts.java:349)
> 	at org.apache.lucene.facet.TestStringValueFacetCounts.testRandom(TestStringValueFacetCounts.java:325)
> {code}
> This looks like a real bug, as StringValueFacetCounts#countOneSegment is called once providing the index of the current loop instead of the ordinal taken from the matching hits that we are analyzing. That works fine with single threaded collection as we will go sequentially and the two indices will always be the same. With multi-threaded search, the order of the returned matching hits (one per segment) is not deterministic.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org