Question about Segment described in "Elasticsearch: The Definitive Guide"

.del files like all other segment files are immutable and therefore never updated. when the deleted/updated documents are refreshed a new .del file will be flushed to disk (but not f-synced) and the IndexReader will be updated to include the new segments (which includes the new .del file as this is part of that segment).

The commit point is simply a list of the segments which are part of the index. If this commit point is not written (e.g. because of a node failure) the index will not contain the documents (and deletions) in the segment and upon restart the index will represent the state before the uncommitted segment(s) were flushed. Again this is where the translog comes into play and will replay all operations received by Elasticsearch between the last successful commit point and the failure.

1 Like