-
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 broken backward compatibility from 2.7 for IndexSorted field indices #10045
Conversation
Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: gashutos <gashutos@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
@Bukhtawar all cleared out from your side? thanks! |
server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java
Show resolved
Hide resolved
server/src/test/java/org/opensearch/index/fielddata/AbstractFieldDataImplTestCase.java
Show resolved
Hide resolved
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.
Do we need to have a BWC IT test for this?
I have added this to mixed-cluster, where Index sorted indices will be having replicas on multiple versions, that should suffice this scenario. |
Signed-off-by: gashutos <gashutos@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Thanks for reviews @reta @backslasht @Bukhtawar @reta help me merging this once @backslasht approves. |
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.
Looks good to me! Thanks @gashutos for quickly fixing it.
qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java
Outdated
Show resolved
Hide resolved
qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: gashutos <gashutos@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
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.10 2.10
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.10
# Create a new branch
git switch --create backport/backport-10045-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d34b35272fa19bc53cb0f6843a92d2d1ee4e3b47
# Push it to GitHub
git push --set-upstream origin backport/backport-10045-to-2.10
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.10 Then, create a pull request where the |
…ces (#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> (cherry picked from commit d34b352) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ces (opensearch-project#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com>
…orted field indi… (#10076) * Fix broken backward compatibility from 2.7 for IndexSorted field indices (#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> * Modifying release notes Signed-off-by: gashutos <gashutos@amazon.com> * Finxing broken UT Signed-off-by: Gohel <gashutos@88665a2fc937.ant.amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Signed-off-by: Gohel <gashutos@88665a2fc937.ant.amazon.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Gohel <gashutos@88665a2fc937.ant.amazon.com>
…rted field indices (#10075) * Fix broken backward compatibility from 2.7 for IndexSorted field indices (#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> (cherry picked from commit d34b352) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Finxing broken UT (#10087) Signed-off-by: Gohel <gashutos@88665a2fc937.ant.amazon.com> Co-authored-by: Gohel <gashutos@88665a2fc937.ant.amazon.com> (cherry picked from commit d7aa6dd) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Gohel <gashutos@88665a2fc937.ant.amazon.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Gohel <gashutos@88665a2fc937.ant.amazon.com>
…ces (opensearch-project#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com>
…ces (opensearch-project#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
…ces (opensearch-project#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com>
…ces (opensearch-project#10045) * Fix broken backward comparibility from 2.7 for IndexSorted field indices Signed-off-by: gashutos <gashutos@amazon.com> * Adding CHANGELOG Signed-off-by: gashutos <gashutos@amazon.com> * Update server/src/main/java/org/opensearch/index/IndexSettings.java Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted logs Signed-off-by: gashutos <gashutos@amazon.com> * Adding index sort as part of mixed cluster to test this scenario Signed-off-by: gashutos <gashutos@amazon.com> * Removing optimization disable logic Signed-off-by: gashutos <gashutos@amazon.com> * Correcting some comments & version check to before( V_2_7_0) instead onOrBefire(V_2_6_1) since Signed-off-by: gashutos <gashutos@amazon.com> * Resolving spotless check error Signed-off-by: gashutos <gashutos@amazon.com> * Fixing broken UT - last minute checkin without copile Signed-off-by: gashutos <gashutos@amazon.com> * Improving code coverage to make codcov happy Signed-off-by: gashutos <gashutos@amazon.com> * Correcting typos and adding more tests Signed-off-by: gashutos <gashutos@amazon.com> * Removing unwanted imports Signed-off-by: gashutos <gashutos@amazon.com> --------- Signed-off-by: gashutos <gashutos@amazon.com> Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Upgrade to OpenSearch 2.7 is breaking with change #6424 . Not for all scenarios but when any index contains IndexSorted field of either BYTE, BOOLEAN, SHORT, INTEGER, where the IndexSortField we created in prior version was upcasted to LONG for all above types, which was removed in #6424 to achieve better performance for sort queries.
The SortField for IndexSort is stored in SegmentInfo and that gets retained when index is migrating from old cluster to new 2.7 cluster, and hence in IndexWriter creation, Lucene throws Exception because on 2.7, IndexWriteConfiguration has IndexSort with non-upcasted type while in SegmentInfo Lucene finds the same sort field with up-casted.
i.e, check below scenario, where Index sort is on Integer field, and the index is migrating from older version to 2.7 version, and on newer version, the IndexWriterCreation fails with IndexSort mismatch between IndexWriteIndexSort & Lucene segmentinfo contained indexsort.
I have added check to treat old migrating indices to treat as Sort field type upcatsed when they are moving to OpenSearch 2.7.
Related Issues
Resolves #10044
Testing done
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.