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

[Backport 2.x] Fixed a bug to prevent updating index.knn setting after index creation #2380

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

anntians
Copy link
Contributor

Description

This change prevents customers to update index.knn setting after creating an index. Previously, there was a loophole to migrate a live k-nn index from hot to UW by closing the index, setting index.knn to false, opening the index, and migrating to UW. However, migrating k-nn indices to UW nodes is not supported. Thus, this PR updates index.knn to be FINAL and immutable after index creation.

Related Issues

Resolves #2334

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.

@kotwanikunal
Copy link
Member

@anntians Can you please fix spotless?

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
Execution failed for task ':qa:restart-upgrade:spotlessJavaCheck'.
> The following files had format violations:
      src\test\java\org\opensearch\knn\bwc\IndexingIT.java
          @@ -6,7 +6,6 @@
           package�org.opensearch.knn.bwc;
           
           import�org.junit.Assert;
          -import�org.opensearch.client.Response;
           import�org.opensearch.client.ResponseException;
           import�org.opensearch.common.settings.Settings;
           import�org.opensearch.common.xcontent.XContentFactory;

opensearch-project#2348)

* Change index.knn setting to FINAL, immutable after index creation

Signed-off-by: AnnTian Shao <anntians@amazon.com>

* Add to ChangeLog the description of bug fix

Signed-off-by: AnnTian Shao <anntians@amazon.com>

* Add restart upgrade test for checking immutability of knn.index setting after version upgrade

Signed-off-by: Tommy Shao <anntians@amazon.com>

---------

Signed-off-by: AnnTian Shao <anntians@amazon.com>
Signed-off-by: Tommy Shao <69884021+anntians@users.noreply.github.com>
Signed-off-by: Tommy Shao <anntians@amazon.com>
Co-authored-by: AnnTian Shao <anntians@amazon.com>
(cherry picked from commit a875eb8)
Signed-off-by: AnnTian Shao <anntians@amazon.com>
@anntians anntians force-pushed the backport/backport-2348-to-2.x branch from a003c56 to b454b35 Compare January 10, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants