Skip to content

Add ways to force-merge down to 1 segment #31742

Closed
@jpountz

Description

@jpountz

Lucene just added a change to the TieredMergePolicy (default merge policy) which prevents it from force-merging indices down to 1 segment if this wouldn't meet the requirement that all segments must be less than the maximum segment size, 5GB by default. For instance if you have a 23GB shard and force-merge it down to 1 segment, you would en up with something like 5 or 6 segments.

There has been feedback that the ability to force-merge to 1 segment is important for time-series data, so we discussed several ideas:

  • override Lucene's merge policy to revert to the previous behavior
  • add a new separate API to freeze indices (wrong name because it currently means something else, but you get the idea) and make clear that it should only be called on read-only data
  • keep Lucene's new behaviour, document the maximum size parameter (index.merge.policy.max_merged_segment), and tell users that if they actually want to merge down to 1 segment then they first need to update that setting. Maybe we could try to detect when an index becomes read-only and automatically update that setting.

In any case there is still the option to implement the first option in 6.x and only introduce the change in master so that the break is introduced in a major release.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions