Skip to content

Conversation

@colings86
Copy link
Contributor

Backport of #35193

colings86 and others added 30 commits August 17, 2018 11:54
Also tweaks some of the code in the steps of the allocate action
Also adds tests for those steps and ReplicasAction.toSteps
The force-merge is an a TODO state due to the
unresolved issue around best_compression.

- updated ReadOnlyStep with tests
- implemented an update to the ForceMergeAction
- added UpdateBestCompressionSettingsStep
- added tests for SegmentCountStep
Various classes had some code that was not used and is not going to be needed so this change cleans up those classes so we don’t have dead code hanging around
Also renames EnoughShardsWaitStep to ReplicasAllocatedStep, removes it from the allocate action and adds a check that th number of replicas in the cluster state is correct to it.
- added ShrinkStep/Tests
- AsyncActionStep now passes in IndexMetaData instead of Index
- Delete usage of ClusterStateActionStep
- with ClusterStateActionStep gone, InitializePolicyContextStep
  is the only other ClusterState-nonWait step
- Migrate setting-updates to UpdateSettingsStep
Adds some missing tests including checking the hashcode and equals methods of `DeleteStep`, `StepKey`, and `TerminalPolicyStep` as well as adding a test for `DeleteAction.toSteps()`
Specifically for the initialPolicyContextStep and the PhaseAfterStep
this resulted in a few new steps being introduced

- AliasStep
- EnoughShardsWaitStep
- ShrinkStep
- ShrunkenIndexCheckStep
- make DeleteActionTests pass
- remove getType from LifecycleType
To make it in line with the fact that other equality tests use multiple iterations
Also fixes failing EnoughShardsWaitStep
- Renames EnoughShardsWaitStep to ShrunkShardsAllocatedStep
- Changes ShrunkShardsAllocatedStep to check the shards of the shrunken index rather than the current one
- shrink index prefix is now passed into the steps of the shrink aciton
- Related Test Changes
This is needed so that clients have the ability to serialise and deserialise the objects it creates and gets back.
…4387)

Previously, phase X's `after` step had `X` as its associated phase. This causes confusion because
we have only entered phase `X` once the `after` step is complete. Therefore, this refactor
pushes the after's phase to be associated with the previous phase. This first phase is an exception. 
The first phase's `after` step is associated with the first phase (not some non-existent prior phase).
dakrone and others added 23 commits October 25, 2018 12:43
This contains updates to the ILM Docs explaining how updates to policies work and
affect policy execution on indices.
ILM would return a resource-not-found exception when requesting policies
while the IndexLifecycleMetaData is not initialized. The behavior here
should not be as extreme since it is not the user's fault.

This commit changes the behavior so that it succeeds and returns no policies
when no policy names are explicitely specified, otherwise keep the same behavior
of throwing an exception
In some cases it wasn't mutating and caused test failures
we are restructuring the docs, this migrates ILM docs outside of the x-pack doc structure.
The Move To Step API now checks to see if the target step is an
AsyncActionStep, and if so, runs it.

Previously, AsyncActionSteps would only be run when they are entered by
executing the previous step, so if an AsyncActionStep was entered via
the Move To Step API, ILM would never touch that index again.
Previously, if ClusterStateActionSteps or ClusterStateWaitSteps threw an
exception executing, the exception would only be caught and logged by
the generic ClusterStateUpdateTask machinery and the index would become
stuck on that step.

Now, exceptions thrown in these steps will be caught and the index will
be moved to the Error step.
This PR renames the CRUD APIS for ILM

GET _ilm/<policy>, _ilm -> _ilm/policy/<policy>, _ilm/policy
PUT _ilm/<policy> -> _ilm/policy/<policy>
DELETE _ilm/<policy> -> _ilm/policy/<policy>

closes #34929.
… alias (#35065)

The ILM Rollover Step can execute on the incorrect index if the rollover alias
exists on another valid index, but not the one the step is executing against. This
is a problem and is now guarded against
…ef (#35070)

* [DOCS] Fixed edit links for ILM APIs and added the APIs to the REST API section.

* [DOCS] Fixed link to ILM APIs.
the settings variable was previously created by
the AbstractComponent class inherited by IndexLifecycleService.
this is no more.
This commit does a few things

- moves ILM-specifc rest yaml tests into plugin/ilm/qa, and creates special
  :plugin:ilm:qa:rest module to test them
- removes the with-security tests of the yaml tests since they are covered in
  the rest tests now
- moves ChangePolicyforIndexIT into the qa/multi-node project since that test is
  not currently running in main ilm since integTest is disabled
ILM's Shrink Action was using a nodes "_name" attribute to
allocate to prepare for the shrink step. Since the name is
configurable by a user and may use the same name for
multiple nodes on one machine, _id is safer since it is guaranteed
to be unique.

closes #35043.
@colings86 colings86 added :Data Management/ILM+SLM Index and Snapshot lifecycle management v6.6.0 backport labels Nov 2, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@colings86 colings86 merged commit 821f2bb into 6.x Nov 2, 2018
@colings86 colings86 deleted the index-lifecycle-6.x branch November 6, 2018 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Data Management/ILM+SLM Index and Snapshot lifecycle management v6.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.