Adjusting the merge policy setting to make merges less aggressive#3128
Open
shatejas wants to merge 10 commits intoopensearch-project:mainfrom
Open
Adjusting the merge policy setting to make merges less aggressive#3128shatejas wants to merge 10 commits intoopensearch-project:mainfrom
shatejas wants to merge 10 commits intoopensearch-project:mainfrom
Conversation
The default setting for opensearch changed, this caused faiss graph creation to use more CPU possibly affecting searches for cases where merge and search is happening on the same cluster. This change makes sure k-NN indices have less aggressive defaults Signed-off-by: Tejas Shah <shatejas@amazon.com>
Signed-off-by: Tejas Shah <shatejas@amazon.com>
navneet1v
reviewed
Feb 24, 2026
navneet1v
reviewed
Feb 24, 2026
CHANGELOG.md
Outdated
|
|
||
| ### Bug Fixes | ||
| * Fix score conversion logic for radial exact search [#3110](https://github.com/opensearch-project/k-NN/pull/3110) | ||
| * Adjusting the merge policy setting to make merges less aggressive [#3128](https://github.com/opensearch-project/k-NN/pull/3128) |
Collaborator
There was a problem hiding this comment.
we should move this to enhancement section
navneet1v
reviewed
Feb 24, 2026
Comment on lines
+291
to
+294
| // Aggressive merges for k-NN can hogg CPU which can degrade search performance | ||
| // These settings are being overridden to make it less aggressive | ||
| // Core has max_merge_at_once default as 30, which can make merges more aggressive | ||
| .put("index.merge.policy.max_merge_at_once", 10) |
Collaborator
There was a problem hiding this comment.
also lets have a IT to validate that index settings are getting set with correct values for index.knn true and false
Signed-off-by: Tejas Shah <shatejas@amazon.com>
Signed-off-by: Tejas Shah <shatejas@amazon.com>
kotwanikunal
approved these changes
Feb 24, 2026
| String derivedSourceEnabled = getIndexSettingByName(indexName, KNN_DERIVED_SOURCE_ENABLED); | ||
| assertEquals(Boolean.toString(isKnnIndex), derivedSourceEnabled); | ||
|
|
||
| String maxMergeAtOnce = getIndexSettingByName(indexName, "index.merge.policy.max_merge_at_once", !isKnnIndex); |
Member
There was a problem hiding this comment.
nit: We can use the settings key here as well
Signed-off-by: Tejas Shah <shatejas@amazon.com>
Signed-off-by: Tejas Shah <shatejas@amazon.com>
navneet1v
previously approved these changes
Mar 10, 2026
Collaborator
|
@shatejas Lets fix the CI issues. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3128 +/- ##
=========================================
Coverage 82.43% 82.44%
Complexity 3874 3874
=========================================
Files 418 418
Lines 14474 14479 +5
Branches 1851 1851
=========================================
+ Hits 11932 11937 +5
Misses 1782 1782
Partials 760 760 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Navneet Verma <navneev@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The default setting for opensearch changed, this caused faiss graph creation to use more CPU possibly affecting searches for cases where merge and search is happening on the same cluster. This change makes sure k-NN indices have less aggressive defaults
Related Issues
None
Testing details
Index created:
Check List
--signoff.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.