Skip to content

Split RolloverStep into Wait and Action steps#35524

Merged
AthenaEryma merged 12 commits intoelastic:masterfrom
AthenaEryma:ilm/check-then-rollover
Nov 16, 2018
Merged

Split RolloverStep into Wait and Action steps#35524
AthenaEryma merged 12 commits intoelastic:masterfrom
AthenaEryma:ilm/check-then-rollover

Conversation

@AthenaEryma
Copy link
Copy Markdown
Contributor

@AthenaEryma AthenaEryma commented Nov 14, 2018

RolloverAction will now periodically check the rollover conditions using
the Rollover API with the dry_run option as an AsyncWaitStep, then run
the rollover itself by calling the Rollover API with no conditions,
which will always roll over, as an AsyncActionStep. This will resolve
race condition issues in policies using RolloverAction.

Replaces #35391 as this approach is more streamlined.

Relates to #35313

Also relates to #35244


Background for this PR: We agreed that it would be best to be able to separate checking the rollover conditions from executing the rollover. In the middle of refactoring the API to accomplish this, I noticed that this is already possible: Calling the Rollover API without providing conditions will unconditionally roll over the index, without using any hacky workarounds such as max_size: 0b. This is not mentioned in the Rollover API documentation - I will be opening a separate PR to add it to the docs.

RolloverAction will now periodically check the rollover conditions using
the Rollover API with the dry_run option as an AsyncWaitStep, then run
the rollover itself by calling the Rollover API with no conditions,
which will always roll over, as an AsyncActionStep. This will resolve
race condition issues in policies using RolloverAction.
@AthenaEryma AthenaEryma added >bug blocker :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. labels Nov 14, 2018
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

Copy link
Copy Markdown
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

Can we re-enable the ChangePolicyforIndexIT#testChangePolicyForIndex test as part of this PR so we ca be sure that this fixes the original issue?

@AthenaEryma
Copy link
Copy Markdown
Contributor Author

AthenaEryma commented Nov 14, 2018

Thanks for the reminder @colings86, I've reinstated the test which was failing (ChangePolicyforIndexIT#testChangePolicyForIndex) after running it locally 200x with the regular 1s polling interval, as well as 200x with a polling interval of 100ms to encourage it to fail if it was going to - I encountered no failures.

Copy link
Copy Markdown
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

This LGTM but I'd like @dakrone to take a look too as a second pair of eyes before we merge

Copy link
Copy Markdown
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM too, I left one minor comment

@dakrone dakrone dismissed colings86’s stale review November 15, 2018 20:52

left a LGTM contingent on my LGTM

@AthenaEryma AthenaEryma merged commit 3883e9b into elastic:master Nov 16, 2018
AthenaEryma added a commit to AthenaEryma/elasticsearch that referenced this pull request Nov 16, 2018
RolloverAction will now periodically check the rollover conditions using
the Rollover API with the dry_run option as an AsyncWaitStep, then run
the rollover itself by calling the Rollover API with no conditions,
which will always roll over, as an AsyncActionStep. This will resolve
race condition issues in policies using RolloverAction.
AthenaEryma added a commit that referenced this pull request Nov 16, 2018
RolloverAction will now periodically check the rollover conditions using
the Rollover API with the dry_run option as an AsyncWaitStep, then run
the rollover itself by calling the Rollover API with no conditions,
which will always roll over, as an AsyncActionStep. This will resolve
race condition issues in policies using RolloverAction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. >non-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants