Skip to content

Commit

Permalink
Fix after restore Lucene.pruneUnreferencedFiles() conditional (elasti…
Browse files Browse the repository at this point in the history
…c#81047)

In elastic#68821 we introduced a condition to skip the pruning of 
unreferenced files after the restore of a snapshot for 
searchable snapshot shards. Sadly I managed to mess 
this up in a refactoring (elastic#75308) few months after.

This commit reintroduces the right conditional which is 
to NOT prune Lucene files for searchable snapshot shards.
  • Loading branch information
tlrx committed Nov 25, 2021
1 parent 85d12e5 commit 9dabd18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void restore(SnapshotFiles snapshotFiles, Store store, ActionListener<Voi

private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMetadata restoredSegmentsFile) {
try {
if (isSearchableSnapshotStore(store.indexSettings().getSettings())) {
if (isSearchableSnapshotStore(store.indexSettings().getSettings()) == false) {
Lucene.pruneUnreferencedFiles(restoredSegmentsFile.name(), store.directory());
}
} catch (IOException e) {
Expand Down

0 comments on commit 9dabd18

Please sign in to comment.