Skip to content
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 the put mapping issue for already created index with flat mapper #2542

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

navneet1v
Copy link
Collaborator

@navneet1v navneet1v commented Feb 19, 2025

Description

Fix the put mapping issue for already created index with flat mapper

Root Cause:

When put mappings is called for an already created index, the mappings are merged from the old index. During that merge the buildContext https://github.com/opensearch-project/k-NN/blob/main/src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java#L243 doesn't have the index version.

The failure happens only when index.knn is false because checking of the index version is in && hence when index.knn is true buildContext is not getting hit.

Related Issues

Resolves #2540

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Signed-off-by: Navneet Verma <navneev@amazon.com>
@navneet1v navneet1v added Bug Fixes Changes to a system or product designed to handle a programming bug/glitch backport 2.x labels Feb 19, 2025
@navneet1v
Copy link
Collaborator Author

waiting for CIs to complete before merging the PR.

@navneet1v navneet1v merged commit 6203ba1 into opensearch-project:main Feb 19, 2025
44 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 19, 2025
…2542)

Signed-off-by: Navneet Verma <navneev@amazon.com>
(cherry picked from commit 6203ba1)
navneet1v added a commit that referenced this pull request Feb 19, 2025
…2542) (#2544)

Signed-off-by: Navneet Verma <navneev@amazon.com>
(cherry picked from commit 6203ba1)

Co-authored-by: Navneet Verma <navneev@amazon.com>
jed326 pushed a commit to jed326/k-NN that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Bug Fixes Changes to a system or product designed to handle a programming bug/glitch
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] Put mapping fails on a already created index with index.knn set to false.
3 participants