Try to move some more norms/docvalues merging out of SegmentMerger [LUCENE-5744]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Today, SegmentMerger opens up all the norms/docvalues and calls merge on the codec.
Can we improve this? In general these things are lazy-loaded, but it would be nice for example, in the case of norms or memory docvalues, to not actually load up things into their hashmap during merging (this would be just a few lines of code), or maybe in the future, even stream the data from disk if not loaded already.
This would help a lot with RAM spikes during merging, which can happen if someone has a lot of "latent" norms, e.g. fields they rarely search on.
---
Migrated from [LUCENE-5744](https://issues.apache.org/jira/browse/LUCENE-5744) by Robert Muir (@rmuir)
Contributor guide
Research direction
Start at SegmentMerger and trace how it opens norms and docvalues before calling the codec's merge operation. Compare the current lazy-loading behavior with the memory docvalues and norms paths, then determine a concrete way to avoid loading data into hashmaps during merging. Done means merging no longer causes the described RAM spikes while preserving codec merge behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, search
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100