-
Couldn't load subscription status.
- Fork 25.6k
Refactor CleanupShrinkIndexStep to CleanupGeneratedIndexStep
#133356
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
Changes from 3 commits
bd209df
df469f5
ed647b6
35d60ca
2caa2d5
7d90604
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,8 @@ public List<Step> toSteps(Client client, String phase, Step.StepKey nextStepKey) | |
| StepKey waitTimeSeriesEndTimePassesKey = new StepKey(phase, NAME, WaitUntilTimeSeriesEndTimePassesStep.NAME); | ||
| StepKey readOnlyKey = new StepKey(phase, NAME, ReadOnlyAction.NAME); | ||
| StepKey checkTargetShardsCountKey = new StepKey(phase, NAME, CheckTargetShardsCountStep.NAME); | ||
| StepKey cleanupShrinkIndexKey = new StepKey(phase, NAME, CleanupShrinkIndexStep.NAME); | ||
| StepKey oldCleanupShrinkIndexKey = new StepKey(phase, NAME, CleanupGeneratedIndexStep.OLD_NAME); | ||
| StepKey cleanupShrinkIndexKey = new StepKey(phase, NAME, CleanupGeneratedIndexStep.NAME); | ||
|
||
| StepKey generateShrinkIndexNameKey = new StepKey(phase, NAME, GenerateUniqueIndexNameStep.NAME); | ||
| StepKey setSingleNodeKey = new StepKey(phase, NAME, SetSingleNodeAllocateStep.NAME); | ||
| StepKey allocationRoutedKey = new StepKey(phase, NAME, CheckShrinkReadyStep.NAME); | ||
|
|
@@ -240,13 +241,16 @@ public List<Step> toSteps(Client client, String phase, Step.StepKey nextStepKey) | |
| cleanupShrinkIndexKey, | ||
| numberOfShards | ||
| ); | ||
| // The cleanup step was renamed, so we need to forward indices in the old step to the new one, i.e. during an upgrade | ||
| NoopStep oldCleanupShrinkIndexStep = new NoopStep(oldCleanupShrinkIndexKey, cleanupShrinkIndexKey); | ||
| // We generate a unique shrink index name but we also retry if the allocation of the shrunk index is not possible, so we want to | ||
| // delete the "previously generated" shrink index (this is a no-op if it's the first run of the action and we haven't generated a | ||
| // shrink index name) | ||
| CleanupShrinkIndexStep cleanupShrinkIndexStep = new CleanupShrinkIndexStep( | ||
| CleanupGeneratedIndexStep cleanupShrinkIndexStep = new CleanupGeneratedIndexStep( | ||
| cleanupShrinkIndexKey, | ||
| generateShrinkIndexNameKey, | ||
| client | ||
| client, | ||
| ShrinkIndexNameSupplier::getShrinkIndexName | ||
| ); | ||
| // generate a unique shrink index name and store it in the ILM execution state | ||
| GenerateUniqueIndexNameStep generateUniqueIndexNameStep = new GenerateUniqueIndexNameStep( | ||
|
|
@@ -313,6 +317,7 @@ public List<Step> toSteps(Client client, String phase, Step.StepKey nextStepKey) | |
| waitUntilTimeSeriesEndTimeStep, | ||
| readOnlyStep, | ||
| checkTargetShardsCountStep, | ||
| oldCleanupShrinkIndexStep, | ||
| cleanupShrinkIndexStep, | ||
| generateUniqueIndexNameStep, | ||
| setSingleNodeStep, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.