-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ILM: searchable snapshot executes before migrate in cold/frozen #68861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ILM: searchable snapshot executes before migrate in cold/frozen #68861
Conversation
This moves the execution of the `searchable_snapshot` action before the `migrate` action in the `cold` and `frozen` phases for a more efficient data migration (ie. mounting it as a searchable snapshot directly on the target tier)
|
Pinging @elastic/es-core-features (Team:Core/Features) |
|
Note: I'll have a look over the needed documentation changes (if any) in a subsequent PR. |
|
@elasticmachine update branch |
dakrone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of small comments, otherwise this looks good!
| if (phase.getActions().get(SearchableSnapshotAction.NAME) != null) { | ||
| // the `searchable_snapshot` action defines migration rules itself, so no need to inject a migrate action | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we still want to inject a migrate action for the frozen phase, so that a searchable snapshot created in the cold phase transitions to frozen nodes when it reaches the frozen phase, even if there is a searchable snapshot action (because the searchable snapshot action could end up being a noop if the settings are the same)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right, good shout!
| assert DataTier.validTierName(targetTier) : "invalid data tier name:" + targetTier; | ||
|
|
||
| BranchingStep conditionalSkipActionStep = new BranchingStep(preMigrateBranchingKey, migrationKey, nextStepKey, | ||
| (index, clusterState) -> skipMigrateAction(phase, clusterState.metadata().index(index))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some debug logging about how we're skipping the migration because of XYZ for this? I think it'd be helpful if someone is trying to diagnose why migrate behaves the way it does.
|
@elasticmachine update branch |
|
Mentioned the relation between the |
…action Not that searchable_snapshot can precede other actions in the same phase (eg. in frozen it is followed by `migrate`) we need to allow the mounted index to resume executing the ILM policy starting with a step that's part of a new action (ie. migrate). This adds support to resume the execution of the mounted index from another action. With older versions the execution would resume from the PhaseCompleteStep as it was the last action in a phase, which was handled as a special case in the `CopyExecutionStateStep`. This commit generalises the `CopyExecutionStateStep` to be able to resume from any `StepKey`.
| // a policy with only the cold phase will have a null "nextStepKey", hence the "null" nextStepKey passed in below when that's the | ||
| // case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not true anymore. the next step will be the (phase) complete one.
dakrone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for changing this!
…tic#68861) This moves the execution of the `searchable_snapshot` action before the `migrate` action in the `cold` and `frozen` phases for more efficient data migration (ie. mounting it as a searchable snapshot directly on the target tier) Now that searchable_snapshot can precede other actions in the same phase (eg. in frozen it is followed by `migrate`) we need to allow the mounted index to resume executing the ILM policy starting with a step that's part of a new action (ie. migrate). This adds support to resume the execution of the mounted index from another action. With older versions, the execution would resume from the PhaseCompleteStep as it was the last action in a phase, which was handled as a special case in the `CopyExecutionStateStep`. This generalises the `CopyExecutionStateStep` to be able to resume from any `StepKey`. (cherry picked from commit 800ae51) Signed-off-by: Andrei Dan <[email protected]>
…) (#68971) This moves the execution of the `searchable_snapshot` action before the `migrate` action in the `cold` and `frozen` phases for more efficient data migration (ie. mounting it as a searchable snapshot directly on the target tier) Now that searchable_snapshot can precede other actions in the same phase (eg. in frozen it is followed by `migrate`) we need to allow the mounted index to resume executing the ILM policy starting with a step that's part of a new action (ie. migrate). This adds support to resume the execution of the mounted index from another action. With older versions, the execution would resume from the PhaseCompleteStep as it was the last action in a phase, which was handled as a special case in the `CopyExecutionStateStep`. This generalises the `CopyExecutionStateStep` to be able to resume from any `StepKey`. (cherry picked from commit 800ae51) Signed-off-by: Andrei Dan <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
This moves the execution of the
searchable_snapshotaction before themigrateaction in thecoldandfrozenphases for a more efficientdata migration (ie. mounting it as a searchable snapshot directly on the
target tier)
Resolves #68635