Skip to content

Make HybridDirectory MMAP Extensions Configurable#3837

Merged
dblock merged 2 commits intoopensearch-project:mainfrom
mattweber:configurable_hybrid_store
Jul 21, 2022
Merged

Make HybridDirectory MMAP Extensions Configurable#3837
dblock merged 2 commits intoopensearch-project:mainfrom
mattweber:configurable_hybrid_store

Conversation

@mattweber
Copy link
Copy Markdown
Contributor

Make the HybridDirectory's list of mmap extensions configurable
via index settings instead of being hard-coded.
Set defaults to the list of currently hard-coded values for
backwards compatibility.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --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.

@mattweber mattweber requested review from a team and reta as code owners July 9, 2022 23:42
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@mattweber
Copy link
Copy Markdown
Contributor Author

@reta can you please rerun the tests, failure seems unrelated so I opened #3838.

@reta
Copy link
Copy Markdown
Contributor

reta commented Jul 10, 2022

@reta can you please rerun the tests, failure seems unrelated so I opened #3838.

@mattweber I believe we need to get #3807 first, working on it

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@mattweber
Copy link
Copy Markdown
Contributor Author

thanks @reta

@reta
Copy link
Copy Markdown
Contributor

reta commented Jul 10, 2022

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>
@mattweber mattweber force-pushed the configurable_hybrid_store branch from 114c39b to 8a264c5 Compare July 11, 2022 00:57
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 11, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.48%. Comparing base (bfac8fc) to head (c36a65d).
⚠️ Report is 4799 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dblock dblock requested a review from mch2 July 11, 2022 21:48
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));
Copy link
Copy Markdown
Contributor

@reta reta Jul 12, 2022

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?

Copy link
Copy Markdown
Contributor Author

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.

@mattweber
Copy link
Copy Markdown
Contributor Author

Thanks @reta! @dblock what do you think about this?

@dblock
Copy link
Copy Markdown
Member

dblock commented Jul 14, 2022

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(
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Contributor

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)?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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 <matt@mattweber.org>
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@mattweber
Copy link
Copy Markdown
Contributor Author

@nknize @reta please kick off tests again, unrelated failures

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@mattweber
Copy link
Copy Markdown
Contributor Author

@nknize @mch2 see any issues with this? Hope to get it in and backported to 2x so it will make one of the next releases. Thanks.

Copy link
Copy Markdown
Contributor

@nknize nknize left a 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
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member

@mch2 mch2 left a 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.

@dblock dblock merged commit b08a2b8 into opensearch-project:main Jul 21, 2022
@dblock dblock added backport 2.x Backport to 2.x branch documentation pending Tracks issues which have PRs merged but documentation changes pending labels Jul 21, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 21, 2022
* 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)
dblock pushed a commit that referenced this pull request Jul 21, 2022
* 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>
@nknize nknize mentioned this pull request Aug 28, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x Backport to 2.x branch documentation pending Tracks issues which have PRs merged but documentation changes pending

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants