-
Notifications
You must be signed in to change notification settings - Fork 2k
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 Bug - Handle unsigned long in sorting order assertion of LongHashSet #17207
Fix Bug - Handle unsigned long in sorting order assertion of LongHashSet #17207
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17207 +/- ##
============================================
+ Coverage 72.42% 72.45% +0.02%
- Complexity 65611 65657 +46
============================================
Files 5304 5307 +3
Lines 304743 304648 -95
Branches 44189 44178 -11
============================================
+ Hits 220701 220718 +17
+ Misses 65888 65838 -50
+ Partials 18154 18092 -62 ☔ View full report in Codecov by Sentry. |
5844005
to
c967d83
Compare
f5a6b7f
to
147ae64
Compare
❌ Gradle check result for 147ae64: 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? |
❌ Gradle check result for 33c3a97: 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: Shailesh Singh <[email protected]> Signed-off-by: Shailesh Singh <[email protected]>
33c3a97
to
71b251b
Compare
❌ Gradle check result for 71b251b: 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: Shailesh Singh <[email protected]>
❌ Gradle check result for 0da60b1: 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? |
…gHashSetTests.java Signed-off-by: Shailesh Singh <[email protected]>
7eff33b
to
f3883d0
Compare
❌ Gradle check result for f3883d0: 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: Shailesh Singh <[email protected]>
❌ Gradle check result for 2cc8480: 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? |
❌ Gradle check result for 2cc8480: 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? |
@Shailesh-Kumar-Singh could you rebase please? Thank you |
❕ Gradle check result for 956b615: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
server/src/main/java/org/opensearch/lucene/util/UnsignedLongHashSet.java
Outdated
Show resolved
Hide resolved
…shSet.java Co-authored-by: Andriy Redko <[email protected]> Signed-off-by: Shailesh Singh <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-17207-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 82bbdfb71f127367ba1c6f36d7a1e68f4fa182cd
# Push it to GitHub
git push --set-upstream origin backport/backport-17207-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
…Set (opensearch-project#17207) * Fix Bug - handle unsigned long in assertion of LongHashSet Signed-off-by: Shailesh Singh <[email protected]> * renamed TestDocValuesUnsignedLongHashSet.java to DocValuesUnsignedLongHashSetTests.java Signed-off-by: Shailesh Singh <[email protected]> * Update server/src/main/java/org/opensearch/lucene/util/UnsignedLongHashSet.java Co-authored-by: Andriy Redko <[email protected]> Signed-off-by: Shailesh Singh <[email protected]> --------- Signed-off-by: Shailesh Singh <[email protected]> Signed-off-by: Shailesh Singh <[email protected]> Co-authored-by: Shailesh Singh <[email protected]> Co-authored-by: Andriy Redko <[email protected]>
@Shailesh-Kumar-Singh could you please backport to |
Description
The assertion logic in LongHashSet.java assumes signed long values, which leads to incorrect validation when dealing with unsigned long values. The sorted order check fails because value >= previousValue does not correctly handle unsigned comparisons.
I have described the Bug in detail in the issue - #17206
FIX
UnsignedLongHashSet.java
which doesLong.compareUnsigned(value, previousValue) >= 0
for unsigned long values.DocValuesUnsignedLongHashSetTests.java
SortedUnsignedLongDocValuesSetQuery.java
- We usenew UnsignedLongHashSet
instead ofnew LongHashSet
Related Issues
Resolves #17206
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.