-
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
Add update settings allowlist for searchable snapshot #5907
Add update settings allowlist for searchable snapshot #5907
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #5907 +/- ##
============================================
- Coverage 70.85% 70.80% -0.05%
- Complexity 58711 58754 +43
============================================
Files 4770 4770
Lines 280744 280765 +21
Branches 40539 40550 +11
============================================
- Hits 198911 198798 -113
- Misses 65455 65611 +156
+ Partials 16378 16356 -22
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
...ain/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java
Outdated
Show resolved
Hide resolved
Allow search related settings to be updated for searchable snapshots. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
private final static String[] ALLOWLIST_REMOTE_SNAPSHOT_SETTINGS = { | ||
"index.max_result_window", | ||
"index.max_inner_result_window", | ||
"index.max_rescore_window", | ||
"index.max_docvalue_fields_search", | ||
"index.max_script_fields", | ||
"index.max_terms_count", | ||
"index.max_regex_length", | ||
"index.highlight.max_analyzed_offset" }; | ||
|
||
private final static String[] ALLOWLIST_REMOTE_SNAPSHOT_SETTINGS_PREFIXES = { "index.search.slowlog" }; |
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.
Nitpick, but for both of these I'd use Set.of(...)
to create immutable sets. It'll save you the step of doing Arrays.asList
below.
@@ -332,6 +335,13 @@ private void assertIndexSettingChangeBlocked(String index) { | |||
} | |||
} | |||
|
|||
private void assertUpdateIndexSettingsAllowList(String index) { |
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.
Can we add a case for a request that contains both an allowed setting and a disallowed setting?
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
CHANGELOG.md
Outdated
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
- Allow mmap to use new JDK-19 preview APIs in Apache Lucene 9.4+ ([#5151](https://github.com/opensearch-project/OpenSearch/pull/5151)) | |||
- Add support for ppc64le architecture ([#5459](https://github.com/opensearch-project/OpenSearch/pull/5459)) | |||
- Add support to disallow search request with preference parameter with strict weighted shard routing([#5874](https://github.com/opensearch-project/OpenSearch/pull/5874)) | |||
- Add update settings allowlist for searchable snapshot ([#5907](https://github.com/opensearch-project/OpenSearch/pull/5907)) |
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.
This needs to go in the [Unreleased 2.x]
section since it will be released on the 2.x line.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-5907-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 011ff6353237fd3c23a5be1487dff67e8374a84d
# Push it to GitHub
git push --set-upstream origin backport/backport-5907-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
* Add update settings allowlist for searchable snapshot Allow search related settings to be updated for searchable snapshots. Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Add feature flag check Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Use set instead of string arrays for allowed list Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> Signed-off-by: Rabi Panda <adnapibar@gmail.com> (cherry picked from commit 011ff63) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add update settings allowlist for searchable snapshot Allow search related settings to be updated for searchable snapshots. Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Add feature flag check Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Use set instead of string arrays for allowed list Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> Signed-off-by: Rabi Panda <adnapibar@gmail.com> (cherry picked from commit 011ff63) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Rabi Panda <adnapibar@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add update settings allowlist for searchable snapshot Allow search related settings to be updated for searchable snapshots. Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Add feature flag check Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Use set instead of string arrays for allowed list Signed-off-by: Rabi Panda <adnapibar@gmail.com> * Update Changelog Signed-off-by: Rabi Panda <adnapibar@gmail.com> Signed-off-by: Rabi Panda <adnapibar@gmail.com> (cherry picked from commit 011ff63) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Rabi Panda <adnapibar@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Rabi Panda adnapibar@gmail.com
Description
Allow search related settings to be updated for searchable snapshots.
Issues Resolved
Resolves #4966
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.