Skip to content

Conversation

@reta
Copy link
Contributor

@reta reta commented Jul 28, 2023

Description

CompletionSuggestSearchIT.testSkipDuplicates is Flaky, caused by #8668

Related Issues

Resolves #8932

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

@nknize nknize left a comment

Choose a reason for hiding this comment

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

Thx @reta! I just saw this failure on #8826 and noticed the suggestion scores were wonky in the repro (not a flaky test!).

@nknize nknize added bug Something isn't working v2.10.0 labels Jul 28, 2023
@reta reta removed the v2.10.0 label Jul 28, 2023
@reta
Copy link
Contributor Author

reta commented Jul 28, 2023

Thx @reta! I just saw this failure on #8826 and noticed the suggestion scores were wonky in the repro (not a flaky test!).

Thanks @nknize, this is related to Apache Lucene 9.8.0-snapshot which is for main only (not backported to any of 2.x)

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta reta merged commit 106e83a into opensearch-project:main Jul 28, 2023
Copy link
Contributor

@nknize nknize left a comment

Choose a reason for hiding this comment

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

d0h.. something was bothering me a bit about this and I forgot about a Lucene deprecation made in 9.7. I updated my review. The fix is a smaller one liner but we'll want to update the rest of the codebase w/ that deprecation change as well.

for (LeafReaderContext context : searcher.getIndexReader().leaves()) {
BulkScorer scorer = weight.bulkScorer(context);
if (scorer != null) {
LeafCollector leafCollector = null;
Copy link
Contributor

@nknize nknize Jul 28, 2023

Choose a reason for hiding this comment

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

I just realized this fix is simpler.

Per this Query#rewrite deprecation just change line 106 to the following

                    query = (CompletionQuery) query.rewrite(searcher);

You're basically reimplementing here the finish hook that was added in Lucene PR#12380.

That logic path wasn't being executed though because we're using the old collector API through the creation of a new searcher wrapping the reader.

I forgot about this deprecation in the 9.7 upgrade and it wasn't exposed because #12380 wasn't merged until after 9.7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about it, merged just before, there is another issue I run into, again with Suggester but slightly different cause:

java.lang.IllegalArgumentException: onlrtdbizi is not a SuggestField
	at org.apache.lucene.search.suggest.document.CompletionWeight.bulkScorer(CompletionWeight.java:80)
	at org.opensearch.search.suggest.completion.CompletionSuggester.suggest(CompletionSuggester.java:110)
	at org.opensearch.search.suggest.completion.CompletionSuggester.innerExecute(CompletionSuggester.java:78)
	at org.opensearch.search.suggest.completion.CompletionSuggester.innerExecute(CompletionSuggester.java:1)

I could incorporate your suggestion into the upcoming fix (still trying to figure out what is happening)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm finishing a PR that cuts over all rewrites to the non-deprecated one. It includes this change in the CompletionSuggester and other places.

Copy link
Contributor

Choose a reason for hiding this comment

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

I opened the PR but I left your patch in. I was wrong, there's still an issue and cutting over to invoke the hook doesn't solve the occasional failure. Let me know if that's what you're investigating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened the PR but I left your patch in. I was wrong, there's still an issue and cutting over to invoke the hook doesn't solve the occasional failure.

Do you have a sample stack trace or logs by any chance?

Let me know if that's what you're investigating.

The one that caused another batch of flakyness: #8968

@nknize
Copy link
Contributor

nknize commented Jul 28, 2023

d0h.. 2 minutes too late :)

I'll open a follow up PR to refactor all of the calls to the deprecated method.

baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 28, 2023
baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 29, 2023
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
@andrross
Copy link
Member

@reta We're seeing test failures on the 2.x branch (#8932 has been reopened), and I believe this change was never backported. Do we need to backport this?

@reta
Copy link
Contributor Author

reta commented Nov 14, 2023

@andrross totally, I missed that once we moved 2.x to Apache Lucene 9.8.0

@reta reta added the backport 2.x Backport to 2.x branch label Nov 14, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 14, 2023
Signed-off-by: Andriy Redko <[email protected]>
(cherry picked from commit 106e83a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Nov 15, 2023
…11200)

(cherry picked from commit 106e83a)

Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x Backport to 2.x branch bug Something isn't working skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] CompletionSuggestSearchIT.testSkipDuplicates is Flaky

3 participants