Elasticsearch hard
Elasticsearch allows 'Force Merging' an index to a single segment (`max_num_segments=1`). Why is this operation strictly prohibited for indices that are still actively receiving writes?
- A It will cause the Master node to lose contact with the Data nodes due to CPU starvation.
- B Segment Explosion: It creates one massive immutable segment. New writes will create tiny new segments. Since merging logic favors segments of similar size, the massive segment will likely never be merged again, effectively 'locking in' thousands of deleted documents that can never be physically removed.
- C It voids the AWS/Elastic support agreement for that specific cluster.
- D It forces all searchable data into the JVM Heap, causing immediate OOM.
Answer: B. Segment Explosion: It creates one massive immutable segment. New writes will create tiny new segments. Since merging logic favors segments of similar size, the massive segment will likely never be merged again, effectively 'locking in' thousands of deleted documents that can never be physically removed.
Force Merge is a 'Read-Only' optimization. If you keep writing, you ruin the merge policy's ability to keep the index clean. Deletes only reclaim space when segments merge. If a segment is 50GB and everything else is 10MB, the 50GB segment sits there forever, potentially wasting 30%+ of its space on 'Soft-Deleted' tombstones.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What are the two primary reasons for configuring one or more 'Replica Shards' for an index?
- When a String field is mapped as `text`, what process is performed to enable full-text search capability?
- What is the primary benefit of splitting an Elasticsearch index into multiple 'Primary Shards'?
- Every document stored in an Elasticsearch index is uniquely tracked by which mandatory metadata field?
- Elasticsearch search results include a metadata field called `_score`. What does this value primarily indicate?
- What is the primary architectural purpose of Elasticsearch in a modern software stack?