Skip to content
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

Enable merge on refresh and merge on commit on Opensearch #1345

Closed
itiyamas opened this issue Oct 8, 2021 · 1 comment · Fixed by #2535
Closed

Enable merge on refresh and merge on commit on Opensearch #1345

itiyamas opened this issue Oct 8, 2021 · 1 comment · Fixed by #2535
Assignees
Labels
enhancement Enhancement or improvement to existing feature or request Indexing & Search

Comments

@itiyamas
Copy link
Contributor

itiyamas commented Oct 8, 2021

Lucene added support for merge on refresh a while back.

Lucene creates one segment per concurrent write to Lucene index. As a result of this, in highly concurrent environments(more write threads), Lucene generates lot of small segments. This increases the search cost. Since the immediately created segments are merged, they are potentially hot in cache and hence can be retrieved faster- thereby improving merge cost as well.

The change fixes this problem by quickly merging the segments during refresh and commit and then opening the reader on the merged segment. The user needs to just set a configurable wait time for merge in order to allow Lucene's IndexWriter to try merging within that duration. This feature is disabled by default.

Choosing the merge wait timeout
One typical approach to achieve this could be setting the DEFAULT_MAX_FULL_FLUSH_MERGE_WAIT_MILLIS to a fraction of refresh interval. For higher refresh intervals, this could turn out to be a a really long timeout. May be we can add a ceiling on this wait time.

Should we expose this to users as an expert setting?

@itiyamas itiyamas added the enhancement Enhancement or improvement to existing feature or request label Oct 8, 2021
@reta
Copy link
Collaborator

reta commented Mar 17, 2022

@dblock could you please assign it to me? I am curious to look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Indexing & Search
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants