File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 66
77package org .elasticsearch .xpack .core .indexlifecycle ;
88
9+ import org .apache .logging .log4j .LogManager ;
10+ import org .apache .logging .log4j .Logger ;
911import org .elasticsearch .cluster .ClusterState ;
1012import org .elasticsearch .cluster .metadata .IndexMetaData ;
1113import org .elasticsearch .cluster .metadata .MetaData ;
2123 */
2224public class CopyExecutionStateStep extends ClusterStateActionStep {
2325 public static final String NAME = "copy_execution_state" ;
26+
27+ private static final Logger logger = LogManager .getLogger (CopyExecutionStateStep .class );
28+
2429 private String shrunkIndexPrefix ;
2530
31+
2632 public CopyExecutionStateStep (StepKey key , StepKey nextStepKey , String shrunkIndexPrefix ) {
2733 super (key , nextStepKey );
2834 this .shrunkIndexPrefix = shrunkIndexPrefix ;
@@ -35,6 +41,11 @@ String getShrunkIndexPrefix() {
3541 @ Override
3642 public ClusterState performAction (Index index , ClusterState clusterState ) {
3743 IndexMetaData indexMetaData = clusterState .metaData ().index (index );
44+ if (indexMetaData == null ) {
45+ // Index must have been since deleted, ignore it
46+ logger .debug ("[{}] lifecycle action for index [{}] executed but index no longer exists" , getKey ().getAction (), index .getName ());
47+ return clusterState ;
48+ }
3849 // get source index
3950 String indexName = indexMetaData .getIndex ().getName ();
4051 // get target shrink index
You can’t perform that action at this time.
0 commit comments