Make HybridDirectory MMAP Extensions Configurable#3837
Make HybridDirectory MMAP Extensions Configurable#3837dblock merged 2 commits intoopensearch-project:mainfrom
Conversation
Gradle Check (Jenkins) Run Completed with:
|
@mattweber I believe we need to get #3807 first, working on it |
Gradle Check (Jenkins) Run Completed with:
|
|
thanks @reta |
@mattweber could you rebase please? |
Make the HybridDirectory's list of mmap extensions configurable via index settings instead of being hard-coded to a specfic set. Set defaults to the list of currently hard-coded values for backwards compatibility. Signed-off-by: Matt Weber <matt@mattweber.org>
114c39b to
8a264c5
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3837 +/- ##
============================================
- Coverage 70.52% 70.48% -0.04%
+ Complexity 56655 56638 -17
============================================
Files 4557 4557
Lines 272682 272685 +3
Branches 40038 40037 -1
============================================
- Hits 192310 192215 -95
- Misses 64203 64285 +82
- Partials 16169 16185 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| case HYBRIDFS: | ||
| // Use Lucene defaults | ||
| final FSDirectory primaryDirectory = FSDirectory.open(location, lockFactory); | ||
| final Set<String> mmapExtensions = new HashSet<>(indexSettings.getValue(IndexModule.INDEX_STORE_HYBRID_MMAP_EXTENSIONS)); |
There was a problem hiding this comment.
@mattweber I am trying to wrap my head around these two properties INDEX_STORE_PRE_LOAD_SETTING and INDEX_STORE_HYBRID_MMAP_EXTENSIONS, which apparently serve the same purpose (and do have same set of values), the HybridDirectory is looking like PreLoadMMapDirectory (except the setPreload thing) ... why do we need both?
There was a problem hiding this comment.
@reta INDEX_STORE_PRE_LOAD_SETTING controls which files automatically get loaded into os cache and I don't believe this has any defaults as it is an expensive operation. This PR adds INDEX_STORE_HYBRID_MMAP_EXTENSIONS which controls which extensions are with opened with mmap store. The current defaults were picked by elastic after doing benchmarks. I would like it configurable so a user can tune to their specific usecase. For example, I want to mmap everything EXCEPT stored fields. The settings are related, but not the same.
|
I know nothing about this stuff, let's have @mch2 take a look for a second pair of 👀 ? |
| Property.NodeScope | ||
| ); | ||
|
|
||
| public static final Setting<List<String>> INDEX_STORE_HYBRID_MMAP_EXTENSIONS = Setting.listSetting( |
There was a problem hiding this comment.
This is an expert parameter which, I suspect, few are going to touch. Can we javadoc this as expert with a description similar to above?
| List.of("nvd", "dvd", "tim", "tip", "dim", "kdd", "kdi", "cfs", "doc"), | ||
| Function.identity(), | ||
| Property.IndexScope, | ||
| Property.NodeScope |
There was a problem hiding this comment.
Do we also want to set this as a final setting (Property.Final)?
There was a problem hiding this comment.
@nknize I don't think so, I would want to be able to change this by closing index, updating setting, then reopening. I thought final would prevent that scenario, but I could be wrong since I am not super familiar with that setting.
There was a problem hiding this comment.
It would prevent that scenario. +1 to go w/o final.
Signed-off-by: Matt Weber <matt@mattweber.org>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
nknize
left a comment
There was a problem hiding this comment.
LGTM! Sorry for the hold up.
| List.of("nvd", "dvd", "tim", "tip", "dim", "kdd", "kdi", "cfs", "doc"), | ||
| Function.identity(), | ||
| Property.IndexScope, | ||
| Property.NodeScope |
There was a problem hiding this comment.
It would prevent that scenario. +1 to go w/o final.
mch2
left a comment
There was a problem hiding this comment.
Sorry had to do some homework to understand the settings. I have no concerns.
* Make HybridDirectory MMAP Extensions Configurable Make the HybridDirectory's list of mmap extensions configurable via index settings instead of being hard-coded to a specfic set. Set defaults to the list of currently hard-coded values for backwards compatibility. Signed-off-by: Matt Weber <matt@mattweber.org> * Add javadoc to INDEX_STORE_HYBRID_MMAP_EXTENSIONS. Signed-off-by: Matt Weber <matt@mattweber.org> (cherry picked from commit b08a2b8)
* Make HybridDirectory MMAP Extensions Configurable Make the HybridDirectory's list of mmap extensions configurable via index settings instead of being hard-coded to a specfic set. Set defaults to the list of currently hard-coded values for backwards compatibility. Signed-off-by: Matt Weber <matt@mattweber.org> * Add javadoc to INDEX_STORE_HYBRID_MMAP_EXTENSIONS. Signed-off-by: Matt Weber <matt@mattweber.org> (cherry picked from commit b08a2b8) Co-authored-by: Matt Weber <matt@mattweber.org>
Make the
HybridDirectory's list of mmap extensions configurablevia index settings instead of being hard-coded.
Set defaults to the list of currently hard-coded values for
backwards compatibility.
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.