-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix SimpleNestedIT.testExplain flaky test #11681
Conversation
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
065c22d
to
69378f1
Compare
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
69378f1
to
9045235
Compare
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
❌ Gradle check result for 9045235: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
9045235
to
7c3df12
Compare
❌ Gradle check result for 7c3df12: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Outdated
Show resolved
Hide resolved
7c3df12
to
7fb9849
Compare
❌ Gradle check result for 7fb9849: Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java
Show resolved
Hide resolved
Thanks @neetikasinghal , LGTM from my side (but @sohami has a good point) |
7fb9849
to
4172f1f
Compare
❌ Gradle check result for 4172f1f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Neetika Singhal <[email protected]>
4172f1f
to
5cb6b98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Neetika Singhal <[email protected]> (cherry picked from commit bbe790b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit bbe790b) Signed-off-by: Neetika Singhal <[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>
Signed-off-by: Neetika Singhal <[email protected]>
Signed-off-by: Neetika Singhal <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
The explain itself is coming from Lucene: https://github.com/apache/lucene/blob/a6f70ad2bb0b682eb65feb522358ee6d16cad766/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java#L432-L440
Here's some info on the docIds in lucene:
A DocId in lucene is not actually unique to the Index but is unique to a Segment. Lucene does this mainly to optimize writing and compression. Since it is only unique to a Segment, how can a Doc be uniquely identified at the Index level? The solution is simple. The segments are ordered. To take a simple example, an Index has two segments and each segment has 100 docs respectively. The DocId's in the Segment are 0-100 but when they are converted to the Index level, the range of the DocId's in the second Segment is converted to 100-200.
DocId's are unique within a Segment, numbered progressively from zero. But this does not mean that the DocId's are continuous. When a Doc is deleted, there is a gap.
The DocId corresponding to a document can change, usually when Segments are merged.
The test fails on the validation of range of the docIds in the assertion, the range changes as with indexRandomForConcurrentSearch function there are several bogus documents ingested and deleted which could trigger background merges and cause the range of the docIds matched with the search query to change.
One of the solutions is to call refresh after indexing the actual document which would create a new segment for the actual document and prevent it to be merged with the bogus documents, this is done as part of this PR.
Related Issues
Resolves #11413
Check List
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.