diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index dc45e1874c72f..4e40bb87a23f5 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -350,7 +350,7 @@ protected void doStop() { for (final Index index : indices) { indicesStopExecutor.execute(() -> { try { - removeIndex(index, IndexRemovalReason.NO_LONGER_ASSIGNED, "shutdown"); + removeIndex(index, IndexRemovalReason.SHUTDOWN, "shutdown"); } finally { latch.countDown(); } diff --git a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index ff2d71ea3a4fc..d4fa43f204062 100644 --- a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -950,6 +950,7 @@ enum IndexRemovalReason { * like the shards files, state and transaction logs are kept around in the case of a disaster recovery. */ NO_LONGER_ASSIGNED, + /** * The index is deleted. Persistent parts of the index like the shards files, state and transaction logs are removed once * all resources are released. @@ -974,6 +975,13 @@ enum IndexRemovalReason { * like the shards files, state and transaction logs are kept around in the case of a disaster recovery. */ REOPENED, + + /** + * The index is closed as part of the node shutdown process. The index should be removed and all associated resources released. + * Persistent parts of the index like the shards files, state and transaction logs should be kept around in the case the node + * restarts. + */ + SHUTDOWN, } } }