Skip to content

Commit

Permalink
[SearchableSnapshot] Deleted the cache path on index deletion.
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Jain <harshjai@amazon.com>
  • Loading branch information
Harsh Jain committed Mar 24, 2023
1 parent e4d9fb5 commit c13bd58
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.opensearch.common.io.FileSystemUtils;
import org.opensearch.common.settings.Settings;
import org.opensearch.env.NodeEnvironment;
import org.opensearch.index.IndexModule;
Expand Down Expand Up @@ -60,6 +61,7 @@ public void beforeIndexShardDeleted(ShardId shardId, Settings settings) {
fileCache.remove(subPath.toRealPath());
}
}
FileSystemUtils.deleteSubDirectories(shardPath.getRootDataPath());
}
} catch (IOException ioe) {
log.error(() -> new ParameterizedMessage("Error removing items from cache during shard deletion {})", shardId), ioe);
Expand Down

0 comments on commit c13bd58

Please sign in to comment.