[ 
https://issues.apache.org/jira/browse/SOLR-10815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Rowe updated SOLR-10815:
------------------------------
    Attachment: SOLR-10815.patch

The issue appears to be that this line, called from 
{{testDatePointFieldSortAndFunction()}}, loses precision when converting dates 
that differ by single seconds into floats for multiplication; as a result, all 
of the sort values are the same, and the tie breaking sort is by lucene doc 
value, which can vary depending on previous tests' doc additions and resulting 
index merges:

{code:java|title=doTestDatePointFunctionQuery()}
2763: assertQ(req("q", "*:*", "fl", "id, " + field, "sort", "product(-1,ms(" + 
field + ")) asc"),
{code}

[~hossman] pointed me to SOLR-10266, where [~caomanhdat] 
[wrote|https://issues.apache.org/jira/browse/SOLR-10266?focusedCommentId=15923703&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15923703]:

{quote}
Hoss Man I checked the test and you actually right. The test is badly written, 
It should change from

{code:java}assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", 
"product(-1," + dvFieldName + ") asc"),{code}

to

{code:java}assertQ(req("q", "*:*", "fl", "id, " + dvFieldName, "sort", 
"product(-1,ms(" + dvFieldName + ","+baseDate+")) desc")
{code}

But the sorting by function on DatePointField still work. Because 
{{ProductFloatFunction}} is used for {{product()}} so the long value ( of date 
field ) will be converted into float before doing multiplication. It lead into 
losing some last decimals. So they will end up with same value {{7.8973554E11}}
{quote}

The attached patch (for branch_6x) applies the same fix as outlined by Dat 
above; with the patch, the seed in the description no longer reproduces.

Committing shortly.

> TestPointFields.testDatePointFieldSortAndFunction() failure
> -----------------------------------------------------------
>
>                 Key: SOLR-10815
>                 URL: https://issues.apache.org/jira/browse/SOLR-10815
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Steve Rowe
>            Assignee: Steve Rowe
>         Attachments: SOLR-10815.patch
>
>
> My Jenkins found a reproducing branch_6x seed for a 
> {{TestPointFields.testDatePointFieldSortAndFunction()}} failure - note that I 
> had to remove {{-Dtests.method=testDatePointFieldSortAndFunction}} from the 
> repro line to get it to reproduce:
> {noformat}
> Checking out Revision 0f740194e27f4c22d0c79e48115afb2cfd9331dc 
> (refs/remotes/origin/branch_6x)
> [...]
>    [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestPointFields 
> -Dtests.method=testDatePointFieldSortAndFunction 
> -Dtests.seed=A1DB5991BA201A4D -Dtests.multiplier=2 -Dtests.nightly=true 
> -Dtests.slow=true 
> -Dtests.linedocsfile=/home/jenkins/lucene-data/enwiki.random.lines.txt 
> -Dtests.locale=sv -Dtests.timezone=Europe/Copenhagen -Dtests.asserts=true 
> -Dtests.file.encoding=ISO-8859-1
>    [junit4] ERROR   0.43s J6 | 
> TestPointFields.testDatePointFieldSortAndFunction <<<
>    [junit4]    > Throwable #1: java.lang.RuntimeException: Exception during 
> query
>    [junit4]    >      at 
> __randomizedtesting.SeedInfo.seed([A1DB5991BA201A4D:7666668E19C1B553]:0)
>    [junit4]    >      at 
> org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:895)
>    [junit4]    >      at 
> org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:862)
>    [junit4]    >      at 
> org.apache.solr.schema.TestPointFields.doTestDatePointFunctionQuery(TestPointFields.java:2763)
>    [junit4]    >      at 
> org.apache.solr.schema.TestPointFields.testDatePointFieldSortAndFunction(TestPointFields.java:872)
>    [junit4]    >      at java.lang.Thread.run(Thread.java:745)
>    [junit4]    > Caused by: java.lang.RuntimeException: REQUEST FAILED: 
> xpath=//result/doc[10]/date[@name='number_p_dt_dv_ns'][.='1995-01-10T10:59:11Z']
>    [junit4]    >      xml response was: <?xml version="1.0" encoding="UTF-8"?>
>    [junit4]    > <response>
>    [junit4]    > <lst name="responseHeader"><int name="status">0</int><int 
> name="QTime">0</int></lst><result name="response" numFound="10" 
> start="0"><doc><str name="id">9</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:20Z</date></doc><doc><str 
> name="id">8</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:19Z</date></doc><doc><str 
> name="id">7</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:18Z</date></doc><doc><str 
> name="id">0</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:11Z</date></doc><doc><str 
> name="id">3</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:14Z</date></doc><doc><str 
> name="id">2</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:13Z</date></doc><doc><str 
> name="id">1</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:12Z</date></doc><doc><str 
> name="id">6</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:17Z</date></doc><doc><str 
> name="id">5</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:16Z</date></doc><doc><str 
> name="id">4</str><date 
> name="number_p_dt_dv_ns">1995-01-10T10:59:15Z</date></doc></result>
>    [junit4]    > </response>
>    [junit4]    >      request 
> was:q=*:*&fl=id,+number_p_dt_dv_ns&sort=product(-1,ms(number_p_dt_dv_ns))+asc&wt=xml
>    [junit4]    >      at 
> org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:888)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to