Skip to content

Skip unreferenced files pruning after restore for searchable snapshots shards#68843

Merged
tlrx merged 1 commit intoelastic:7.xfrom
tlrx:skip-prune-unreferenced-files-7.x
Feb 11, 2021
Merged

Skip unreferenced files pruning after restore for searchable snapshots shards#68843
tlrx merged 1 commit intoelastic:7.xfrom
tlrx:skip-prune-unreferenced-files-7.x

Conversation

@tlrx
Copy link
Copy Markdown
Member

@tlrx tlrx commented Feb 10, 2021

When a shard is restored from a snapshot there is an after
restore step during which files on disk that are not referenced
anymore by the restored segments infos file are deleted from
disk. The deletion is executed using the
Lucene.pruneUnreferencedFiles() method which opens a new
IndexWriter and closes it in order to kick off Lucene's internal
index files deleter.

This step is not necessary for searchable snapshot shards
which use the snapshot store type because such shards
report a list of files coming from a shard snapshot which
never contain unreferenced files. Skipping this step avoids
extra unnecessary work when mounting a searchable
snapshot index.

Backport of #68821

…s shards (elastic#68821)

When a shard is restored from a snapshot there is an after 
restore step during which files on disk that are not referenced 
anymore by the restored segments infos file are deleted from 
disk. The deletion is executed using the 
Lucene.pruneUnreferencedFiles() method which opens a new 
IndexWriter and closes it in order to kick off Lucene's internal 
index files deleter.

This step is not necessary for searchable snapshot shards 
which use the snapshot store type because such shards 
report a list of files coming from a shard snapshot which 
never contain unreferenced files. Skipping this step avoids 
extra unnecessary work when mounting a searchable 
snapshot index.
@tlrx tlrx added >non-issue :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs backport v7.12.0 labels Feb 10, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team. label Feb 10, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@tlrx tlrx merged commit 5c4492e into elastic:7.x Feb 11, 2021
@tlrx tlrx deleted the skip-prune-unreferenced-files-7.x branch February 11, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Meta label for distributed team. v7.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants