Description
Currently _forcemerge
chooses to honor max_num_segments
over the maximum segment size. So if the maximum segment size is 5GB (default) and you ask a 10GB shard to be force-merged then you will get a 10GB segment. It makes it hard to have a one-size-fits-all policy regarding the value of max_num_segments
that should be provided: merging shards of 10GB down to 1 segment is probably fine, merging shards of 300GB down to 1 segment maybe not.
Maybe one way to work around this issue would be to have a configurable maximum segment size for forced merges as well, and to honor the maximum segment size over max_num_segments
. For instance say the maximum segment size for forced merges is 50GB then a 300GB shard would more likely be reduced to 6-7 segments.
This would probably be helpful for ILM.