Skip to content

Conversation

@HiDAl
Copy link

@HiDAl HiDAl commented Jun 15, 2023

Allows having different StepRule shapes:

  • only check maxRetries
  • only check maxTimeOn
  • check both

adding specific factory methods

Tackle PR #96092 's comments

Allows having different StepRule shapes:
 - only check maxRetries
 - only check maxTimeOn
 - check both

adding specific factory methods
@HiDAl HiDAl added >refactoring :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v8.9.0 labels Jun 15, 2023
@HiDAl HiDAl requested a review from andreidan June 15, 2023 08:40
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@HiDAl HiDAl force-pushed the make-steps-retries-configurable branch from a4f3656 to 0adfc46 Compare June 15, 2023 08:49
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.

Thanks for working on this Pablo.

Left some rather minor suggestions

Comment on lines 136 to 138
// The no-follower step is added here because an `unfollowAction` is added before the `shrinkAction` in the follower
// cluster.
stepRule(WaitForNoFollowersStep.NAME, ONE_DAY)
stepRuleOnlyCheckRetries(WaitForNoFollowersStep.NAME, MAX_RETRIES)
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment can be removed - now that we're only looking at max retries for the WaitForNoFollowerStep.
(same for above in the SearchableSnapshotAction)

And thinking about it some more, I think it's ok to not have MAX_TIME on this step because we can have policies without rollover. So a policy with only the warm phase and a shrink action could stay in WaitForNoFollowerStep on the leader cluster for a long time if the index is actively written to still or if a user on the follower cluster doesn't manually (this is a policy without rollover - the rollover action sets this automatically otherwise) set the indexing_complete setting to true

stepRule(WaitForIndexColorStep.NAME, ONE_DAY),
stepRuleFullChecks(WaitForDataTierStep.NAME, ONE_DAY, MAX_RETRIES),
stepRuleFullChecks(WaitForIndexColorStep.NAME, ONE_DAY, MAX_RETRIES),
// The no-follower step is added here because an `UnfollowAction` is added before the `shrinkAction` in the follower cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

As bellow, we can remove this comment

Comment on lines 148 to 149
stepRuleFullChecks(ForceMergeStep.NAME, ONE_DAY, 100L),
stepRuleFullChecks(SegmentCountStep.NAME, ONE_DAY, 100L)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use MAX_RETRIES here

public record StepRule(String step, TimeValue maxTimeOn, long maxRetries) implements RuleConfig {
static StepRule stepRule(String name, TimeValue maxTimeOn) {
return new StepRule(name, maxTimeOn, 100);
public record StepRule(String step, TimeValue maxTimeOn, Long maxRetries) implements RuleConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we override the canonical constructor and add a validation that either maxTimeOn or maxRetries are different than null ? And otherwise, if both are null, throw an IllegalArgumentException ?

@HiDAl HiDAl requested a review from andreidan June 15, 2023 10:56
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 Pablo 🚀

@HiDAl HiDAl merged commit 4e4b95d into elastic:main Jun 15, 2023
@HiDAl HiDAl deleted the make-steps-retries-configurable branch June 15, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/ILM+SLM Index and Snapshot lifecycle management >refactoring Team:Data Management Meta label for data/management team v8.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants