We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5dbede commit e030dd5Copy full SHA for e030dd5
modules/elasticsearch/src/main/java/org/elasticsearch/indices/store/IndicesStore.java
@@ -131,8 +131,11 @@ public void close() {
131
}
132
if (shardCanBeDeleted) {
133
ShardId shardId = indexShardRoutingTable.shardId();
134
- logger.debug("[{}][{}] deleting shard that is no longer used", shardId.index().name(), shardId.id());
135
- FileSystemUtils.deleteRecursively(nodeEnv.shardLocation(shardId));
+ File shardLocation = nodeEnv.shardLocation(shardId);
+ if (shardLocation.exists()) {
136
+ logger.debug("[{}][{}] deleting shard that is no longer used", shardId.index().name(), shardId.id());
137
+ FileSystemUtils.deleteRecursively(shardLocation);
138
+ }
139
140
141
0 commit comments