Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard FieldExistsQuery against null pointers #11794

Merged
merged 6 commits into from
Sep 20, 2022

Conversation

javanna
Copy link
Contributor

@javanna javanna commented Sep 20, 2022

FieldExistsQuery checks if there are points for a certain field, and then retrieves the corresponding point values. When all documents that had points for a certain field have been deleted from a certain segments, as well as merged away, field info may report that there are points yet the corresponding point values are null. The same can happen when terms are accessed.

With this change we add null checks to FieldExistsQuery. Long term, we will likely want to prevent this situation from happening.

Relates #11393

FieldExistsQuery checks if there are points for a certain field, and then retrieves the
corresponding point values. When all documents that had points for a certain field have
been deleted from a certain segments, as well as merged away, field info may report
that there are points yet the corresponding point values are null.

With this change we add a null check in FieldExistsQuery. Long term, we will likely want
to prevent this situation from happening.

Relates apache#11393
Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment on the test, otherwise it looks good to me.

@jpountz jpountz merged commit 4eaebee into apache:main Sep 20, 2022
jpountz pushed a commit that referenced this pull request Sep 20, 2022
FieldExistsQuery checks if there are points for a certain field, and then retrieves the
corresponding point values. When all documents that had points for a certain field have
been deleted from a certain segments, as well as merged away, field info may report
that there are points yet the corresponding point values are null.

With this change we add a null check in FieldExistsQuery. Long term, we will likely want
to prevent this situation from happening.

Relates #11393
jpountz pushed a commit that referenced this pull request Sep 20, 2022
FieldExistsQuery checks if there are points for a certain field, and then retrieves the
corresponding point values. When all documents that had points for a certain field have
been deleted from a certain segments, as well as merged away, field info may report
that there are points yet the corresponding point values are null.

With this change we add a null check in FieldExistsQuery. Long term, we will likely want
to prevent this situation from happening.

Relates #11393
@jpountz jpountz added this to the 9.4.0 milestone Sep 20, 2022
wjp719 added a commit to wjp719/lucene that referenced this pull request Sep 21, 2022
* main: (324 commits)
  Mute TestKnnVectorQuery#testFilterWithSameScore while we work on a fix
  Guard FieldExistsQuery against null pointers (apache#11794)
  Fix handling of ghost fields in string sorts. (apache#11792)
  LUCENE-10365 Wizard changes contributed from Solr (apache#591)
  GitHub Workflows security hardening (apache#11789)
  Improve tessellator performance by delaying calls to the method #isIntersectingPolygon (apache#11786)
  update DOAP and releaseWizard to reflect migration to github (apache#11747)
  Diversity check bugfix (apache#11781)
  Fix rare bug in TestKnnVectorQuery when we have multiple segments
  GITHUB#11778: Add detailed part-of-speech tag for particle and ending on Nori (apache#11779)
  LUCENE-10674: Move changes entry to 9.4.
  apacheGH-11172: remove WindowsDirectory and native subproject. (apache#11774)
  LUCENE-10674: Ensure BitSetConjDISI returns NO_MORE_DOCS when sub-iterator exhausts. (apache#1068)
  Removed duplicate check in SpanGradientFormatter (apache#11762)
  Fix integer overflow in tests.
  GITHUB#11742: MatchingFacetSetsCounts#getTopChildren now returns top children instead of all children (apache#11764)
  Retry gradle wrapper download on http 500 and 503. (apache#11766)
  Fix a typo affecting Luke (apache#11763)
  Fix IntervalBuilder.NO_INTERVALS docId when unpositioned (apache#11760)
  LUCENE-10592 Better estimate memory for HNSW graph (apache#11743)
  ...
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.

2 participants