stop throwing an IllegalStateException for unrecognized steps (#32212)
Since the reason for a step not being found in a registry may be due to staleness of the registry between it and the cluster state, we do not want to throw an IllegalStateException. Staleness is something that will be self-healing after follow-up applications of the cluster state updates, so this is a recoverable issue that should log a warning instead of throwing an exception Closes #32181.
This commit is contained in:
parent
a314efc920
commit
6e9f33843d
|
@ -9,6 +9,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
|
import org.elasticsearch.action.support.TransportAction;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.cluster.metadata.MetaData;
|
import org.elasticsearch.cluster.metadata.MetaData;
|
||||||
|
@ -64,8 +65,11 @@ public class IndexLifecycleRunner {
|
||||||
}
|
}
|
||||||
Step currentStep = getCurrentStep(stepRegistry, policy, indexSettings);
|
Step currentStep = getCurrentStep(stepRegistry, policy, indexSettings);
|
||||||
if (currentStep == null) {
|
if (currentStep == null) {
|
||||||
throw new IllegalStateException(
|
// This may happen in the case that there is invalid ilm-step index settings or the stepRegistry is out of
|
||||||
"current step for index [" + indexMetaData.getIndex().getName() + "] with policy [" + policy + "] is not recognized");
|
// sync with the current cluster state
|
||||||
|
logger.warn("current step [" + getCurrentStepKey(indexSettings) + "] for index [" + indexMetaData.getIndex().getName()
|
||||||
|
+ "] with policy [" + policy + "] is not recognized");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
logger.debug("running policy with current-step[" + currentStep.getKey() + "]");
|
logger.debug("running policy with current-step[" + currentStep.getKey() + "]");
|
||||||
if (currentStep instanceof TerminalPolicyStep) {
|
if (currentStep instanceof TerminalPolicyStep) {
|
||||||
|
@ -164,6 +168,23 @@ public class IndexLifecycleRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is intended for handling moving to different steps from {@link TransportAction} executions.
|
||||||
|
* For this reason, it is reasonable to throw {@link IllegalArgumentException} when state is not as expected.
|
||||||
|
* @param indexName
|
||||||
|
* The index whose step is to change
|
||||||
|
* @param currentState
|
||||||
|
* The current {@link ClusterState}
|
||||||
|
* @param currentStepKey
|
||||||
|
* The current {@link StepKey} found for the index in the current cluster state
|
||||||
|
* @param nextStepKey
|
||||||
|
* The next step to move the index into
|
||||||
|
* @param nowSupplier
|
||||||
|
* The current-time supplier for updating when steps changed
|
||||||
|
* @param stepRegistry
|
||||||
|
* The steps registry to check a step-key's existence in the index's current policy
|
||||||
|
* @return The updated cluster state where the index moved to <code>nextStepKey</code>
|
||||||
|
*/
|
||||||
static ClusterState moveClusterStateToStep(String indexName, ClusterState currentState, StepKey currentStepKey,
|
static ClusterState moveClusterStateToStep(String indexName, ClusterState currentState, StepKey currentStepKey,
|
||||||
StepKey nextStepKey, LongSupplier nowSupplier,
|
StepKey nextStepKey, LongSupplier nowSupplier,
|
||||||
PolicyStepsRegistry stepRegistry) {
|
PolicyStepsRegistry stepRegistry) {
|
||||||
|
@ -180,10 +201,9 @@ public class IndexLifecycleRunner {
|
||||||
throw new IllegalArgumentException("index [" + indexName + "] is not on current step [" + currentStepKey + "]");
|
throw new IllegalArgumentException("index [" + indexName + "] is not on current step [" + currentStepKey + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
Step nextStep = stepRegistry.getStep(indexPolicySetting, nextStepKey);
|
||||||
stepRegistry.getStep(indexPolicySetting, nextStepKey);
|
if (nextStep == null) {
|
||||||
} catch (IllegalStateException e) {
|
throw new IllegalArgumentException("step [" + nextStepKey + "] with policy [" + indexPolicySetting + "] does not exist");
|
||||||
throw new IllegalArgumentException(e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return IndexLifecycleRunner.moveClusterStateToNextStep(idxMeta.getIndex(), currentState, currentStepKey, nextStepKey, nowSupplier);
|
return IndexLifecycleRunner.moveClusterStateToNextStep(idxMeta.getIndex(), currentState, currentStepKey, nextStepKey, nowSupplier);
|
||||||
|
@ -358,7 +378,7 @@ public class IndexLifecycleRunner {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isActionChanged(StepKey stepKey, LifecyclePolicy currentPolicy, LifecyclePolicy newPolicy) {
|
private static boolean isActionChanged(StepKey stepKey, LifecyclePolicy currentPolicy, LifecyclePolicy newPolicy) {
|
||||||
LifecycleAction currentAction = getActionFromPolicy(currentPolicy, stepKey.getPhase(), stepKey.getAction());
|
LifecycleAction currentAction = getActionFromPolicy(currentPolicy, stepKey.getPhase(), stepKey.getAction());
|
||||||
LifecycleAction newAction = getActionFromPolicy(newPolicy, stepKey.getPhase(), stepKey.getAction());
|
LifecycleAction newAction = getActionFromPolicy(newPolicy, stepKey.getPhase(), stepKey.getAction());
|
||||||
|
@ -385,7 +405,7 @@ public class IndexLifecycleRunner {
|
||||||
* state where it is able to deal with the policy being updated to
|
* state where it is able to deal with the policy being updated to
|
||||||
* <code>newPolicy</code>. If any of these indexes is not in a state wheree
|
* <code>newPolicy</code>. If any of these indexes is not in a state wheree
|
||||||
* it can deal with the update the method will return <code>false</code>.
|
* it can deal with the update the method will return <code>false</code>.
|
||||||
*
|
*
|
||||||
* @param policyName
|
* @param policyName
|
||||||
* the name of the policy being updated
|
* the name of the policy being updated
|
||||||
* @param newPolicy
|
* @param newPolicy
|
||||||
|
|
|
@ -5,10 +5,12 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.indexlifecycle;
|
package org.elasticsearch.xpack.indexlifecycle;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.Diff;
|
import org.elasticsearch.cluster.Diff;
|
||||||
import org.elasticsearch.cluster.DiffableUtils;
|
import org.elasticsearch.cluster.DiffableUtils;
|
||||||
|
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||||
import org.elasticsearch.xpack.core.ClientHelper;
|
import org.elasticsearch.xpack.core.ClientHelper;
|
||||||
import org.elasticsearch.xpack.core.indexlifecycle.ErrorStep;
|
import org.elasticsearch.xpack.core.indexlifecycle.ErrorStep;
|
||||||
import org.elasticsearch.xpack.core.indexlifecycle.IndexLifecycleMetadata;
|
import org.elasticsearch.xpack.core.indexlifecycle.IndexLifecycleMetadata;
|
||||||
|
@ -23,6 +25,8 @@ import java.util.TreeMap;
|
||||||
import java.util.function.LongSupplier;
|
import java.util.function.LongSupplier;
|
||||||
|
|
||||||
public class PolicyStepsRegistry {
|
public class PolicyStepsRegistry {
|
||||||
|
private static final Logger logger = ESLoggerFactory.getLogger(PolicyStepsRegistry.class);
|
||||||
|
|
||||||
// keeps track of existing policies in the cluster state
|
// keeps track of existing policies in the cluster state
|
||||||
private SortedMap<String, LifecyclePolicyMetadata> lifecyclePolicyMap;
|
private SortedMap<String, LifecyclePolicyMetadata> lifecyclePolicyMap;
|
||||||
// keeps track of what the first step in a policy is
|
// keeps track of what the first step in a policy is
|
||||||
|
@ -104,13 +108,9 @@ public class PolicyStepsRegistry {
|
||||||
}
|
}
|
||||||
Map<Step.StepKey, Step> steps = stepMap.get(policy);
|
Map<Step.StepKey, Step> steps = stepMap.get(policy);
|
||||||
if (steps == null) {
|
if (steps == null) {
|
||||||
throw new IllegalStateException("policy [" + policy + "] does not exist");
|
return null;
|
||||||
}
|
}
|
||||||
Step step = steps.get(stepKey);
|
return steps.get(stepKey);
|
||||||
if (step == null) {
|
|
||||||
throw new IllegalStateException("step [" + stepKey + "] does not exist");
|
|
||||||
}
|
|
||||||
return step;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Step getFirstStep(String policy) {
|
public Step getFirstStep(String policy) {
|
||||||
|
|
|
@ -52,10 +52,12 @@ public class ExecuteStepsUpdateTaskTests extends ESTestCase {
|
||||||
private static final StepKey firstStepKey = new StepKey("phase_1", "action_1", "step_1");
|
private static final StepKey firstStepKey = new StepKey("phase_1", "action_1", "step_1");
|
||||||
private static final StepKey secondStepKey = new StepKey("phase_1", "action_1", "step_2");
|
private static final StepKey secondStepKey = new StepKey("phase_1", "action_1", "step_2");
|
||||||
private static final StepKey thirdStepKey = new StepKey("phase_1", "action_1", "step_3");
|
private static final StepKey thirdStepKey = new StepKey("phase_1", "action_1", "step_3");
|
||||||
|
private static final StepKey invalidStepKey = new StepKey("invalid", "invalid", "invalid");
|
||||||
private ClusterState clusterState;
|
private ClusterState clusterState;
|
||||||
private PolicyStepsRegistry policyStepsRegistry;
|
private PolicyStepsRegistry policyStepsRegistry;
|
||||||
private String mixedPolicyName;
|
private String mixedPolicyName;
|
||||||
private String allClusterPolicyName;
|
private String allClusterPolicyName;
|
||||||
|
private String invalidPolicyName;
|
||||||
private Index index;
|
private Index index;
|
||||||
private MockClusterStateActionStep firstStep;
|
private MockClusterStateActionStep firstStep;
|
||||||
private MockClusterStateWaitStep secondStep;
|
private MockClusterStateWaitStep secondStep;
|
||||||
|
@ -75,17 +77,23 @@ public class ExecuteStepsUpdateTaskTests extends ESTestCase {
|
||||||
thirdStep = new MockStep(thirdStepKey, null);
|
thirdStep = new MockStep(thirdStepKey, null);
|
||||||
mixedPolicyName = randomAlphaOfLengthBetween(5, 10);
|
mixedPolicyName = randomAlphaOfLengthBetween(5, 10);
|
||||||
allClusterPolicyName = randomAlphaOfLengthBetween(1, 4);
|
allClusterPolicyName = randomAlphaOfLengthBetween(1, 4);
|
||||||
|
invalidPolicyName = randomAlphaOfLength(11);
|
||||||
Phase mixedPhase = new Phase("first_phase", TimeValue.ZERO, Collections.singletonMap(MockAction.NAME,
|
Phase mixedPhase = new Phase("first_phase", TimeValue.ZERO, Collections.singletonMap(MockAction.NAME,
|
||||||
new MockAction(Arrays.asList(firstStep, secondStep, thirdStep))));
|
new MockAction(Arrays.asList(firstStep, secondStep, thirdStep))));
|
||||||
Phase allClusterPhase = new Phase("first_phase", TimeValue.ZERO, Collections.singletonMap(MockAction.NAME,
|
Phase allClusterPhase = new Phase("first_phase", TimeValue.ZERO, Collections.singletonMap(MockAction.NAME,
|
||||||
new MockAction(Arrays.asList(firstStep, allClusterSecondStep))));
|
new MockAction(Arrays.asList(firstStep, allClusterSecondStep))));
|
||||||
|
Phase invalidPhase = new Phase("invalid_phase", TimeValue.ZERO, Collections.singletonMap(MockAction.NAME,
|
||||||
|
new MockAction(Arrays.asList(new MockClusterStateActionStep(firstStepKey, invalidStepKey)))));
|
||||||
LifecyclePolicy mixedPolicy = new LifecyclePolicy(TestLifecycleType.INSTANCE, mixedPolicyName,
|
LifecyclePolicy mixedPolicy = new LifecyclePolicy(TestLifecycleType.INSTANCE, mixedPolicyName,
|
||||||
Collections.singletonMap(mixedPhase.getName(), mixedPhase));
|
Collections.singletonMap(mixedPhase.getName(), mixedPhase));
|
||||||
LifecyclePolicy allClusterPolicy = new LifecyclePolicy(TestLifecycleType.INSTANCE, allClusterPolicyName,
|
LifecyclePolicy allClusterPolicy = new LifecyclePolicy(TestLifecycleType.INSTANCE, allClusterPolicyName,
|
||||||
Collections.singletonMap(allClusterPhase.getName(), allClusterPhase));
|
Collections.singletonMap(allClusterPhase.getName(), allClusterPhase));
|
||||||
|
LifecyclePolicy invalidPolicy = new LifecyclePolicy(TestLifecycleType.INSTANCE, invalidPolicyName,
|
||||||
|
Collections.singletonMap(invalidPhase.getName(), invalidPhase));
|
||||||
Map<String, LifecyclePolicyMetadata> policyMap = new HashMap<>();
|
Map<String, LifecyclePolicyMetadata> policyMap = new HashMap<>();
|
||||||
policyMap.put(mixedPolicyName, new LifecyclePolicyMetadata(mixedPolicy, Collections.emptyMap()));
|
policyMap.put(mixedPolicyName, new LifecyclePolicyMetadata(mixedPolicy, Collections.emptyMap()));
|
||||||
policyMap.put(allClusterPolicyName, new LifecyclePolicyMetadata(allClusterPolicy, Collections.emptyMap()));
|
policyMap.put(allClusterPolicyName, new LifecyclePolicyMetadata(allClusterPolicy, Collections.emptyMap()));
|
||||||
|
policyMap.put(invalidPolicyName, new LifecyclePolicyMetadata(invalidPolicy, Collections.emptyMap()));
|
||||||
policyStepsRegistry = new PolicyStepsRegistry();
|
policyStepsRegistry = new PolicyStepsRegistry();
|
||||||
|
|
||||||
IndexMetaData indexMetadata = IndexMetaData.builder(randomAlphaOfLength(5))
|
IndexMetaData indexMetadata = IndexMetaData.builder(randomAlphaOfLength(5))
|
||||||
|
@ -165,6 +173,26 @@ public class ExecuteStepsUpdateTaskTests extends ESTestCase {
|
||||||
assertThat(LifecycleSettings.LIFECYCLE_STEP_INFO_SETTING.get(newState.metaData().index(index).getSettings()), equalTo(""));
|
assertThat(LifecycleSettings.LIFECYCLE_STEP_INFO_SETTING.get(newState.metaData().index(index).getSettings()), equalTo(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testExecuteInvalidStartStep() throws IOException {
|
||||||
|
setStateToKey(firstStepKey);
|
||||||
|
Step startStep = policyStepsRegistry.getStep(mixedPolicyName, firstStepKey);
|
||||||
|
long now = randomNonNegativeLong();
|
||||||
|
ExecuteStepsUpdateTask task = new ExecuteStepsUpdateTask(invalidPolicyName, index, startStep, policyStepsRegistry, () -> now);
|
||||||
|
ClusterState newState = task.execute(clusterState);
|
||||||
|
assertSame(newState, clusterState);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testExecuteUntilNullStep() throws IOException {
|
||||||
|
setStateToKey(firstStepKey);
|
||||||
|
Step startStep = policyStepsRegistry.getStep(invalidPolicyName, firstStepKey);
|
||||||
|
long now = randomNonNegativeLong();
|
||||||
|
ExecuteStepsUpdateTask task = new ExecuteStepsUpdateTask(invalidPolicyName, index, startStep, policyStepsRegistry, () -> now);
|
||||||
|
ClusterState newState = task.execute(clusterState);
|
||||||
|
StepKey currentStepKey = IndexLifecycleRunner.getCurrentStepKey(newState.metaData().index(index).getSettings());
|
||||||
|
assertThat(currentStepKey, equalTo(invalidStepKey));
|
||||||
|
}
|
||||||
|
|
||||||
public void testExecuteIncompleteWaitStepNoInfo() throws IOException {
|
public void testExecuteIncompleteWaitStepNoInfo() throws IOException {
|
||||||
secondStep.setWillComplete(false);
|
secondStep.setWillComplete(false);
|
||||||
setStateToKey(secondStepKey);
|
setStateToKey(secondStepKey);
|
||||||
|
|
|
@ -332,18 +332,13 @@ public class IndexLifecycleRunnerTests extends ESTestCase {
|
||||||
|
|
||||||
public void testRunPolicyWithNoStepsInRegistry() {
|
public void testRunPolicyWithNoStepsInRegistry() {
|
||||||
String policyName = "cluster_state_action_policy";
|
String policyName = "cluster_state_action_policy";
|
||||||
StepKey stepKey = new StepKey("phase", "action", "cluster_state_action_step");
|
|
||||||
ClusterService clusterService = mock(ClusterService.class);
|
ClusterService clusterService = mock(ClusterService.class);
|
||||||
IndexLifecycleRunner runner = new IndexLifecycleRunner(new PolicyStepsRegistry(), clusterService, () -> 0L);
|
IndexLifecycleRunner runner = new IndexLifecycleRunner(new PolicyStepsRegistry(), clusterService, () -> 0L);
|
||||||
IndexMetaData indexMetaData = IndexMetaData.builder("my_index").settings(settings(Version.CURRENT))
|
IndexMetaData indexMetaData = IndexMetaData.builder("my_index").settings(settings(Version.CURRENT))
|
||||||
.numberOfShards(randomIntBetween(1, 5)).numberOfReplicas(randomIntBetween(0, 5)).build();
|
.numberOfShards(randomIntBetween(1, 5)).numberOfReplicas(randomIntBetween(0, 5)).build();
|
||||||
|
// verify that no exception is thrown
|
||||||
IllegalStateException exception = expectThrows(IllegalStateException.class,
|
runner.runPolicy(policyName, indexMetaData, null, randomBoolean());
|
||||||
() -> runner.runPolicy(policyName, indexMetaData, null, randomBoolean()));
|
|
||||||
assertEquals("current step for index [my_index] with policy [cluster_state_action_policy] is not recognized",
|
|
||||||
exception.getMessage());
|
|
||||||
Mockito.verifyZeroInteractions(clusterService);
|
Mockito.verifyZeroInteractions(clusterService);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRunPolicyUnknownStepType() {
|
public void testRunPolicyUnknownStepType() {
|
||||||
|
@ -524,13 +519,8 @@ public class IndexLifecycleRunnerTests extends ESTestCase {
|
||||||
.put(LifecycleSettings.LIFECYCLE_ACTION, "action_1")
|
.put(LifecycleSettings.LIFECYCLE_ACTION, "action_1")
|
||||||
.put(LifecycleSettings.LIFECYCLE_STEP, "step_3")
|
.put(LifecycleSettings.LIFECYCLE_STEP, "step_3")
|
||||||
.build();
|
.build();
|
||||||
IllegalStateException exception = expectThrows(IllegalStateException.class,
|
assertNull(IndexLifecycleRunner.getCurrentStep(registry, policyName, invalidIndexSettings));
|
||||||
() -> IndexLifecycleRunner.getCurrentStep(registry, policyName, invalidIndexSettings));
|
assertNull(IndexLifecycleRunner.getCurrentStep(registry, "policy_does_not_exist", invalidIndexSettings));
|
||||||
assertEquals("step [{\"phase\":\"phase_1\",\"action\":\"action_1\",\"name\":\"step_3\"}] does not exist", exception.getMessage());
|
|
||||||
|
|
||||||
exception = expectThrows(IllegalStateException.class,
|
|
||||||
() -> IndexLifecycleRunner.getCurrentStep(registry, "policy_does_not_exist", invalidIndexSettings));
|
|
||||||
assertEquals("policy [policy_does_not_exist] does not exist", exception.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMoveClusterStateToNextStep() {
|
public void testMoveClusterStateToNextStep() {
|
||||||
|
@ -688,7 +678,8 @@ public class IndexLifecycleRunnerTests extends ESTestCase {
|
||||||
() -> IndexLifecycleRunner.moveClusterStateToStep(indexName, clusterState, currentStepKey,
|
() -> IndexLifecycleRunner.moveClusterStateToStep(indexName, clusterState, currentStepKey,
|
||||||
nextStepKey, () -> now, stepRegistry));
|
nextStepKey, () -> now, stepRegistry));
|
||||||
assertThat(exception.getMessage(),
|
assertThat(exception.getMessage(),
|
||||||
equalTo("step [{\"phase\":\"next_phase\",\"action\":\"next_action\",\"name\":\"next_step\"}] does not exist"));
|
equalTo("step [{\"phase\":\"next_phase\",\"action\":\"next_action\",\"name\":\"next_step\"}] " +
|
||||||
|
"with policy [my_policy] does not exist"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMoveClusterStateToErrorStep() throws IOException {
|
public void testMoveClusterStateToErrorStep() throws IOException {
|
||||||
|
|
|
@ -79,8 +79,7 @@ public class PolicyStepsRegistryTests extends ESTestCase {
|
||||||
public void testGetStepUnknownPolicy() {
|
public void testGetStepUnknownPolicy() {
|
||||||
String policyName = randomAlphaOfLengthBetween(2, 10);
|
String policyName = randomAlphaOfLengthBetween(2, 10);
|
||||||
PolicyStepsRegistry registry = new PolicyStepsRegistry(null, null, Collections.emptyMap());
|
PolicyStepsRegistry registry = new PolicyStepsRegistry(null, null, Collections.emptyMap());
|
||||||
IllegalStateException exception = expectThrows(IllegalStateException.class, () -> registry.getStep(policyName, MOCK_STEP_KEY));
|
assertNull(registry.getStep(policyName, MOCK_STEP_KEY));
|
||||||
assertThat(exception.getMessage(), equalTo("policy [" + policyName +"] does not exist"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetStepUnknownStepKey() {
|
public void testGetStepUnknownStepKey() {
|
||||||
|
@ -91,8 +90,7 @@ public class PolicyStepsRegistryTests extends ESTestCase {
|
||||||
PolicyStepsRegistry registry = new PolicyStepsRegistry(null, null, stepMap);
|
PolicyStepsRegistry registry = new PolicyStepsRegistry(null, null, stepMap);
|
||||||
Step.StepKey unknownStepKey = new Step.StepKey(MOCK_STEP_KEY.getPhase(),
|
Step.StepKey unknownStepKey = new Step.StepKey(MOCK_STEP_KEY.getPhase(),
|
||||||
MOCK_STEP_KEY.getAction(),MOCK_STEP_KEY.getName() + "not");
|
MOCK_STEP_KEY.getAction(),MOCK_STEP_KEY.getName() + "not");
|
||||||
IllegalStateException exception = expectThrows(IllegalStateException.class, () -> registry.getStep(policyName, unknownStepKey));
|
assertNull(registry.getStep(policyName, unknownStepKey));
|
||||||
assertThat(exception.getMessage(), equalTo("step [" + unknownStepKey +"] does not exist"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testUpdateFromNothingToSomethingToNothing() {
|
public void testUpdateFromNothingToSomethingToNothing() {
|
||||||
|
|
|
@ -138,7 +138,7 @@ teardown:
|
||||||
action: "invalid"
|
action: "invalid"
|
||||||
name: "invalid"
|
name: "invalid"
|
||||||
- match: { error.root_cause.0.type: "illegal_argument_exception" }
|
- match: { error.root_cause.0.type: "illegal_argument_exception" }
|
||||||
- match: { error.root_cause.0.reason: "step [{\"phase\":\"invalid\",\"action\":\"invalid\",\"name\":\"invalid\"}] does not exist" }
|
- match: { error.root_cause.0.reason: "step [{\"phase\":\"invalid\",\"action\":\"invalid\",\"name\":\"invalid\"}] with policy [my_moveable_timeseries_lifecycle] does not exist" }
|
||||||
|
|
||||||
- do:
|
- do:
|
||||||
acknowledge: true
|
acknowledge: true
|
||||||
|
|
Loading…
Reference in New Issue