Skip to content

SOLR-16931: ReRankScaler explain breaks with debug=true and in distributed mode#1936

Merged
joel-bernstein merged 10 commits into
apache:mainfrom
joel-bernstein:SOLR-16931-clean
Sep 19, 2023
Merged

SOLR-16931: ReRankScaler explain breaks with debug=true and in distributed mode#1936
joel-bernstein merged 10 commits into
apache:mainfrom
joel-bernstein:SOLR-16931-clean

Conversation

@joel-bernstein
Copy link
Copy Markdown
Contributor

@joel-bernstein joel-bernstein commented Sep 19, 2023

https://issues.apache.org/jira/browse/SOLR-16931

Description

The ReRankScaler collects specific information for the explain when debugQuery is set to true. But the parameter debug=true doesn't trigger the collection of this data which causes an NPE in the explain.

The work around is to always use debugQuery=true until this ticket is resolved and released.

It turned out that this ticket had two problems. The first one is described above. The second issue is that distributed explain is broken with the ReRankScaler.

The reason for this is that in order to do proper explain for minMaxScaling you need to know the min and max score in the result set. This piece of state is maintained in the ReRankScaler itself which is inside of the ReRankQuery. But for this information to be populated the query must first be run. In distributed mode, explain is called in the second pass when the ids query is run so the state needed for the explain is not populated. The PR attached to this addresses this problem by doing a single pass distributed query if debugQuery is turned on and if reRank score scaling is applied. I'll add a distributed test for this as well.

This change is very limited in scope because the single pass distributed is only switched on in the very specific case when debugQuery=true and reRankScaling is on.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@joel-bernstein joel-bernstein changed the title ReRankScaler explain breaks with debug=true and in distributed mode SOLR-16931: ReRankScaler explain breaks with debug=true and in distributed mode Sep 19, 2023
@joel-bernstein joel-bernstein merged commit 1c2ebe2 into apache:main Sep 19, 2023
joel-bernstein added a commit to joel-bernstein/solr that referenced this pull request Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant