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

LUCENE-9536: Correct the OrdinalMap optimization. #2070

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

jtibshirani
Copy link
Member

Previously we only checked that the first segment's ordinal deltas were all
zero. This didn't account for some rare cases where some of the segment's
ordinals are filtered out, so the ordinals aren't contiguous. In these cases we
fill in dummy values for the missing ordinal deltas. So a segment's ordinals
can appear to match the global ordinals perfectly, but not actually contain all
the terms.

Such a case can arise when using a FilteredTermsEnum, for example when merging
a segment with deletions.

Previously we only checked that the first segment's ordinal deltas were all
zero. This didn't account for some rare cases where the segment's ordinals
matched the global ones, but it did not contain all terms. This can happen when
using a FilteredTermsEnum, for example when merging a segment with deletions.
@jtibshirani
Copy link
Member Author

This should fix the failures we're seeing like TestLucene70DocValuesFormat#testSparseSortedVariableLengthVsStoredFields and TestSimpleTextDocValuesFormat#testSparseSortedFixedLengthVsStoredFields. Note to self: run the whole test suite a bunch of times when changing subtle logic!!

@jpountz jpountz merged commit 849a28e into apache:master Nov 10, 2020
jpountz pushed a commit that referenced this pull request Nov 10, 2020
Previously we only checked that the first segment's ordinal deltas were all
zero. This didn't account for some rare cases where the segment's ordinals
matched the global ones, but it did not contain all terms. This can happen when
using a FilteredTermsEnum, for example when merging a segment with deletions.
@jtibshirani jtibshirani deleted the ordinal-map branch November 10, 2020 16:02
msfroh pushed a commit to msfroh/lucene-solr that referenced this pull request Nov 18, 2020
Previously we only checked that the first segment's ordinal deltas were all
zero. This didn't account for some rare cases where the segment's ordinals
matched the global ones, but it did not contain all terms. This can happen when
using a FilteredTermsEnum, for example when merging a segment with deletions.
epugh pushed a commit to epugh/lucene-solr-1 that referenced this pull request Jan 15, 2021
Previously we only checked that the first segment's ordinal deltas were all
zero. This didn't account for some rare cases where the segment's ordinals
matched the global ones, but it did not contain all terms. This can happen when
using a FilteredTermsEnum, for example when merging a segment with deletions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants