Skip to content

Commit 7e59794

Browse files
authored
Log every use of ILM Move to Step API (elastic#41171)
Usage of the ILM Move to Step API can result in some very odd situations, and for diagnosing problems arising from these situations it would be nice to have a record of when this API was called with what parameters. Also, adds a dedicated logger for TransportMoveToStepAction, rather than using the (deprecated) inherited one.
1 parent db13043 commit 7e59794

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleRunner.java

+3
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ static ClusterState moveClusterStateToStep(String indexName, ClusterState curren
307307
"] with policy [" + indexPolicySetting + "] does not exist");
308308
}
309309

310+
logger.info("moving index [{}] from [{}] to [{}] in policy [{}]",
311+
indexName, currentStepKey, nextStepKey, indexPolicySetting);
312+
310313
return IndexLifecycleRunner.moveClusterStateToNextStep(idxMeta.getIndex(), currentState, currentStepKey,
311314
nextStepKey, nowSupplier, forcePhaseDefinitionRefresh);
312315
}

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportMoveToStepAction.java

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
package org.elasticsearch.xpack.indexlifecycle.action;
88

9+
import org.apache.logging.log4j.LogManager;
10+
import org.apache.logging.log4j.Logger;
911
import org.elasticsearch.action.ActionListener;
1012
import org.elasticsearch.action.support.ActionFilters;
1113
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
@@ -25,6 +27,8 @@
2527
import org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService;
2628

2729
public class TransportMoveToStepAction extends TransportMasterNodeAction<Request, Response> {
30+
private static final Logger logger = LogManager.getLogger(TransportMoveToStepAction.class);
31+
2832
IndexLifecycleService indexLifecycleService;
2933
@Inject
3034
public TransportMoveToStepAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,

0 commit comments

Comments
 (0)