-
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
Enabling sort optimization back for half_float with custom comparators #11024
Conversation
Signed-off-by: Chaitanya Gohel <gashutos@amazon.com>
@reta @backslasht I have added back half_float optimization with custom comparators introductions. Added much more tests for half_float now. |
Gradle Check (Jenkins) Run Completed with:
|
Compatibility status:Checks if related components are compatible with change b198f6b Incompatible componentsIncompatible components: [https://github.com/opensearch-project/performance-analyzer.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
❌ Gradle check result for b198f6b: 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 b198f6b: null 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 b198f6b: null 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 b198f6b: 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. |
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-11024-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5143198f43f05e5d1692624adc3733ac19b90004
# Push it to GitHub
git push --set-upstream origin backport/backport-11024-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 |
opensearch-project#11024) * Enabling sort optimizatin back for half_float with custom comparators Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Fixing tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding test for Indecx sort half_float Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Making indexFieldData provate in FloatValuesComparatorSource Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding missing value instead null Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding more tests for desc order sort Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding tests in case missing values are competitive Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * chanheing newly added test supported version 3.0.0 Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Assing missing float tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Remove missing value change to be part of another PR Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> --------- Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
#11024) (#11197) * Enabling sort optimizatin back for half_float with custom comparators * Fixing tests * Adding test for Indecx sort half_float * Making indexFieldData provate in FloatValuesComparatorSource * Update server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java * Adding missing value instead null * Adding more tests for desc order sort * Update rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml * Adding tests in case missing values are competitive * chanheing newly added test supported version 3.0.0 * Assing missing float tests * Remove missing value change to be part of another PR --------- Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
This tests seem broken when run from opensearch-py, https://github.com/opensearch-project/opensearch-py/actions/runs/6868286935/job/18678495702, opensearch-project/opensearch-py#582. |
Thanks a lot @dblock , @gashutos mind please taking a look? thank you! |
I'm also a bit worried seeing that the error message has a serialized
|
@dblock @reta just saw this, it looks like this was invoked in 2.11.0 version where half_float were already broken. The fix is in 2.11.1. The half_float sort test should not have run for 2.11.0. I will check why it did run the test for 2.11.0 for py client. For OpenSearch, this test run only for 2.11.1. |
The REST spec should skip this test for 2.11.0. That version has been released. Will you please make that change @gashutos? |
@gashutos Is this a new bug? |
No no, its not a bug. In search query, it outputs like that only in response. |
opensearch-project#11024) * Enabling sort optimizatin back for half_float with custom comparators Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Fixing tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding test for Indecx sort half_float Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Making indexFieldData provate in FloatValuesComparatorSource Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding missing value instead null Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding more tests for desc order sort Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding tests in case missing values are competitive Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * chanheing newly added test supported version 3.0.0 Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Assing missing float tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Remove missing value change to be part of another PR Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> --------- Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
opensearch-project#11024) * Enabling sort optimizatin back for half_float with custom comparators Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Fixing tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding test for Indecx sort half_float Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Making indexFieldData provate in FloatValuesComparatorSource Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding missing value instead null Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding more tests for desc order sort Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding tests in case missing values are competitive Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * chanheing newly added test supported version 3.0.0 Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Assing missing float tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Remove missing value change to be part of another PR Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> --------- Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com>
opensearch-project#11024) * Enabling sort optimizatin back for half_float with custom comparators Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Fixing tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding test for Indecx sort half_float Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Making indexFieldData provate in FloatValuesComparatorSource Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding missing value instead null Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Adding more tests for desc order sort Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Update rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Adding tests in case missing values are competitive Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * chanheing newly added test supported version 3.0.0 Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Assing missing float tests Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> * Remove missing value change to be part of another PR Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> --------- Signed-off-by: Chaitanya Gohel <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Prabhakar Sithanandam <prabhakar.s87@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Enabling back sort optimization for
half_float
which was disabled here #10999.As mentioned in below issue, for this sort optimization to get enabled, the BKD indexed point size and point size passed in comparator should be exactly same. With custom comparator
HalfFloatComparator
we achieved that.Also I have added missing unit tests & integ tests for
half_float
field type to avoid any such issues.[I am planning to add this in opensearch-3.0]
Tests
half_float
field type sort unit tests.half_float
field type sort integ tests.half_float
field typesearch_after
tests.half_float
field type mixed type sort result tests.half_float
field type missign value sort tests.half_float
field type as index sort.Related Issues
Resolves #[Issue number to be closed when this PR is merged]
#10998
Perf impact with this change (this is already there but we had to disable)
Before this change
After this change
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.