Use READONCE io context for nrt, add MMap grouping options #774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
MMapDirectory
in the newer lucene versions use the new java native memory api, if available. By default, mapping files from the same segment use a ref counted memoryArena
. When we open files for nrt operations, the mappings will persist until the segment is closed. This can lead to an accumulation of mappings of the same files.Opening files for nrt operations have been changed to use the
READONCE
io context. This avoids use of mmap file groupings. This could not be used forRecvRawFileV2Handler
, since this type of mapping can only be used by the opening thread. We will need to handle this another way in the future for acked copy.The config now exposes
mmapGrouping
to set the grouping function:SEGMENT
(default) - All files from the same segment are groupedSEGMENT_EXCEPT_SI
- All files from the same segment are grouped, except.si
files. The segment info file for all index segments are read on completion of an nrt point. This option may be useful to stop accumulation of these mappings on replicas.NONE
- No file grouping