-
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
Added new Setting property UnmodifiableOnRestore
to prevent updating settings on restore snapshot
#16957
Conversation
…napshot Signed-off-by: AnnTian Shao <[email protected]>
…napshot Signed-off-by: AnnTian Shao <[email protected]>
Signed-off-by: Tommy Shao <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16957 +/- ##
============================================
- Coverage 72.32% 72.23% -0.10%
+ Complexity 65477 65393 -84
============================================
Files 5309 5309
Lines 304306 304319 +13
Branches 44124 44128 +4
============================================
- Hits 220098 219813 -285
- Misses 66159 66502 +343
+ Partials 18049 18004 -45 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Tommy Shao <[email protected]>
❌ Gradle check result for f33c9bc: 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 f487f95: 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 c1c3593: 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? |
…ady registered, will raise separate PR for settings not yet registered. Add validation check in Setting.java. Add UnmodifiableOnRestore settings cannot be removed on restore Signed-off-by: AnnTian Shao <[email protected]>
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.
Had a few comments but none are blocking, LGTM. @dblock would you like to take another look too?
server/src/main/java/org/opensearch/common/settings/Setting.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RestoreShallowSnapshotV2IT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/Setting.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/Setting.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java
Outdated
Show resolved
Hide resolved
server/src/internalClusterTest/java/org/opensearch/remotestore/RestoreShallowSnapshotV2IT.java
Outdated
Show resolved
Hide resolved
❌ Gradle check result for 3227d08: 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: AnnTian Shao <[email protected]>
❌ Gradle check result for b55cbed: 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: AnnTian Shao <[email protected]>
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.
Thanks for the changes, LGTM
Signed-off-by: Tommy Shao <[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-16957-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 822f80cf2cdc8398d6861827bca2d53f91329f8d
# Push it to GitHub
git push --set-upstream origin backport/backport-16957-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 |
…g settings on restore snapshot (#16957) (#17116) * Add index.knn setting to list of unmodifiable settings when restore snapshot Signed-off-by: AnnTian Shao <[email protected]> * Add index.knn setting to list of unmodifiable settings when restore snapshot Signed-off-by: AnnTian Shao <[email protected]> * Add new Setting property UnmodifiableOnRestore to mark setting as immutable on restore snapshot Signed-off-by: AnnTian Shao <[email protected]> * Add tests for new Setting property UnmodifiableOnRestore Signed-off-by: AnnTian Shao <[email protected]> * fixes and added more tests for new setting property UnmodifiableOnRestore Signed-off-by: AnnTian Shao <[email protected]> * fix test failures Signed-off-by: AnnTian Shao <[email protected]> * Revert "fix test failures" This reverts commit 252100c. Signed-off-by: AnnTian Shao <[email protected]> * fixes by adding back USER_UNMODIFIABLE_SETTINGS for settings without Setting implementation Signed-off-by: AnnTian Shao <[email protected]> * testing CI config for registering plugin settings Signed-off-by: AnnTian Shao <[email protected]> * Revert "testing CI config for registering plugin settings" This reverts commit 9ebab5a. Signed-off-by: AnnTian Shao <[email protected]> * Add UnmodifiableOnRestore only to unmodifiable settings that are already registered, will raise separate PR for settings not yet registered. Add validation check in Setting.java. Add UnmodifiableOnRestore settings cannot be removed on restore Signed-off-by: AnnTian Shao <[email protected]> * fixes and move tests to RestoreSnapshotIT Signed-off-by: AnnTian Shao <[email protected]> * Add back testInvalidRestoreRequestScenarios test method Signed-off-by: AnnTian Shao <[email protected]> --------- Signed-off-by: AnnTian Shao <[email protected]> Signed-off-by: Tommy Shao <[email protected]> Co-authored-by: AnnTian Shao <[email protected]> (cherry picked from commit 822f80c) Signed-off-by: Tommy Shao <[email protected]>
Description
This PR adds a new Setting property
UnmodifiableOnRestore
to prevent customers from updating certain settings on restore snapshot. The motivation behind this change is to prevent customers from updatingindex.knn
setting when restoring a snapshot. The PR is related to another PR (opensearch-project/k-NN#2348) which fixes a bug by makingindex.knn
setting immutable after index creation. However, that PR doesn't cover the case for snapshots, so this PR adds Setting propertyUnmodifiableOnRestore
so thatindex.knn
will be immutable when restoring an index from a snapshot.Related Issues
Resolves Issue 2334 in KNN repository: opensearch-project/k-NN#2334
#17019
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.