[DOC] Document force_merge API (and new only_expunge_deletes
behavior in 2.12)
#5388
Closed
1 of 4 tasks
only_expunge_deletes
behavior in 2.12)
#5388
What do you want to do?
Tell us about your request.
Relates to opensearch-project/OpenSearch#10603, which doesn't change any APIs but does change existing behavior.
I don't believe we currently have any documentation around the
force_merge
API. We do have https://opensearch.org/docs/latest/dashboards/im-dashboards/forcemerge/, but that's just a UI component to simplify access to theforce_merge
API. I think we should have a section forforce_merge
under https://opensearch.org/docs/latest/api-reference/index-apis/index/.Anyway, this Stackoverflow question (https://stackoverflow.com/questions/55903641/is-it-ok-to-forcemerge-with-only-expunge-deletes-on-a-read-write-index) from 2019 essentially covers the problem solved by opensearch-project/OpenSearch#10603.
Essentially, under normal circumstances, OpenSearch will do background segment merges that produce segments with size at most
index.merge.policy.max_merged_segment
(default 5GB). When you force merge, that max segment size is ignored -- every shard could potentially get merged down to a single segment, regardless of size. The problem is that you now have segments bigger than 5GB that may accumulate deleted documents. Those segments cannot possibly participate in any future merges unless the total deletion count would bring them back under 5GB.Given that there's a parameter called
only_expunge_deletes
, it's not unreasonable that some people (including me -- I've been burned by this) would think that it's safe to use that parameter to force a merge that only expunges deletes (without producing giant zombie segments that never participate in future merges). Unfortunately, until now, those people would have been wrong.This change makes it so that
only_expunge_deletes
will still honor the value ofindex.merge.policy.max_merged_segment
.What other resources are available?
N/A
The text was updated successfully, but these errors were encountered: