Skip to content

Conversation

@dakrone
Copy link
Member

@dakrone dakrone commented Jun 4, 2021

This changes the CopyExecutionStateStep to copy all of the existing state from the original to the
new index after a shrink or searchable snapshot ILM action.

It also has two other changes
First, it fixes issues in LifecycleExecutionState.equals and hashCode where parts were missing,
and modifies the tests better so they would catch these issues better.

Second, it moves the lifecycle policy validation out of the constructor to a new method. This is
required because PolicyStepsRegistry constructs a new LifecyclePolicy out of the cached phase
JSON combined with the policy from the cluster state. In the event that the cached JSON contains an
action that prevents subsequent actions from being defined, we need to leniently allow this
behavior, because those steps will be ignored (see #64883 for this original implementation). The
policy is still validated when loaded elsewhere however.

Resolves #73791

This changes the `CopyExecutionStateStep` to copy all of the existing state from the original to the
new index after a shrink or searchable snapshot ILM action.

It also has two other changes
First, it fixes issues in `LifecycleExecutionState.equals` and `hashCode` where parts were missing,
and modifies the tests better so they would catch these issues better.

Second, it moves the lifecycle policy validation out of the constructor to a new method. This is
required because `PolicyStepsRegistry` constructs a new `LifecyclePolicy` out of the cached phase
JSON combined with the policy from the cluster state. In the event that the cached JSON contains an
action that prevents subsequent actions from being defined, we need to leniently allow this
behavior, because those steps will be ignored (see elastic#64883 for this original implementation). The
policy is still validated when loaded elsewhere however.

Resolves elastic#73791
@dakrone dakrone added >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.0.0 v7.14.0 v7.13.2 labels Jun 4, 2021
@dakrone dakrone requested a review from andreidan June 4, 2021 21:16
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jun 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@dakrone
Copy link
Member Author

dakrone commented Jun 4, 2021

@elasticmachine update branch

@dakrone
Copy link
Member Author

dakrone commented Jun 4, 2021

@elasticmachine run elasticsearch-ci/part-2

Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this Lee

@dakrone dakrone merged commit 3ee8020 into elastic:master Jun 7, 2021
@dakrone dakrone deleted the fix-copy-execution-state branch June 7, 2021 15:03
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Jun 7, 2021
This changes the CopyExecutionStateStep to copy all of the existing state from the original to the
new index after a shrink or searchable snapshot ILM action.

It also has two other changes
First, it fixes issues in LifecycleExecutionState.equals and hashCode where parts were missing,
and modifies the tests better so they would catch these issues better.

Second, it moves the lifecycle policy validation out of the constructor to a new method. This is
required because PolicyStepsRegistry constructs a new LifecyclePolicy out of the cached phase
JSON combined with the policy from the cluster state. In the event that the cached JSON contains an
action that prevents subsequent actions from being defined, we need to leniently allow this
behavior, because those steps will be ignored (see elastic#64883 for this original implementation). The
policy is still validated when loaded elsewhere however.

Resolves elastic#73791
# Conflicts:
#	x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Jun 7, 2021
This changes the CopyExecutionStateStep to copy all of the existing state from the original to the
new index after a shrink or searchable snapshot ILM action.

It also has two other changes
First, it fixes issues in LifecycleExecutionState.equals and hashCode where parts were missing,
and modifies the tests better so they would catch these issues better.

Second, it moves the lifecycle policy validation out of the constructor to a new method. This is
required because PolicyStepsRegistry constructs a new LifecyclePolicy out of the cached phase
JSON combined with the policy from the cluster state. In the event that the cached JSON contains an
action that prevents subsequent actions from being defined, we need to leniently allow this
behavior, because those steps will be ignored (see elastic#64883 for this original implementation). The
policy is still validated when loaded elsewhere however.

Resolves elastic#73791
# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java
#	x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java
dakrone added a commit that referenced this pull request Jun 7, 2021
…73849)

This changes the CopyExecutionStateStep to copy all of the existing state from the original to the
new index after a shrink or searchable snapshot ILM action.

It also has two other changes
First, it fixes issues in LifecycleExecutionState.equals and hashCode where parts were missing,
and modifies the tests better so they would catch these issues better.

Second, it moves the lifecycle policy validation out of the constructor to a new method. This is
required because PolicyStepsRegistry constructs a new LifecyclePolicy out of the cached phase
JSON combined with the policy from the cluster state. In the event that the cached JSON contains an
action that prevents subsequent actions from being defined, we need to leniently allow this
behavior, because those steps will be ignored (see #64883 for this original implementation). The
policy is still validated when loaded elsewhere however.

Resolves #73791
# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java
#	x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java
dakrone added a commit that referenced this pull request Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v7.13.2 v7.14.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CopyExecutionStateStep does not copy all execution state within ILM

4 participants