-
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
Make HybridDirectory MMAP Extensions Configurable #3837
Make HybridDirectory MMAP Extensions Configurable #3837
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 <[email protected]>
114c39b
to
8a264c5
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #3837 +/- ##
============================================
+ Coverage 70.52% 70.60% +0.07%
- Complexity 56655 56673 +18
============================================
Files 4557 4557
Lines 272682 272685 +3
Branches 40038 40037 -1
============================================
+ Hits 192310 192522 +212
+ Misses 64203 63915 -288
- Partials 16169 16248 +79
Continue to review full report at Codecov.
|
@@ -97,9 +97,10 @@ protected Directory newFSDirectory(Path location, LockFactory lockFactory, Index | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 👀 ? |
@@ -148,6 +148,14 @@ public final class IndexModule { | |||
Property.NodeScope | |||
); | |||
|
|||
public static final Setting<List<String>> INDEX_STORE_HYBRID_MMAP_EXTENSIONS = Setting.listSetting( |
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 is an expert parameter which, I suspect, few are going to touch. Can we javadoc this as expert
with a description similar to above?
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.
@nknize sure can
List.of("nvd", "dvd", "tim", "tip", "dim", "kdd", "kdi", "cfs", "doc"), | ||
Function.identity(), | ||
Property.IndexScope, | ||
Property.NodeScope |
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.
Do we also want to set this as a final setting (Property.Final
)?
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would prevent that scenario. +1 to go w/o final.
Signed-off-by: Matt Weber <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would prevent that scenario. +1 to go w/o final.
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.
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 <[email protected]> * Add javadoc to INDEX_STORE_HYBRID_MMAP_EXTENSIONS. Signed-off-by: Matt Weber <[email protected]> (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 <[email protected]> * Add javadoc to INDEX_STORE_HYBRID_MMAP_EXTENSIONS. Signed-off-by: Matt Weber <[email protected]> (cherry picked from commit b08a2b8) Co-authored-by: Matt Weber <[email protected]>
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.