Skip to content
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

Miscellaneous ILM cleanups #118488

Merged
merged 8 commits into from
Dec 11, 2024
Merged

Conversation

joegallo
Copy link
Contributor

This is an unconnected bunch of commits that are just tidying some little things here and there that I ran into in the ILM code while I was working on my current task.

This is a continuation of #118466 and #118338, there's also a little bit of #118354 in there, too.

@joegallo joegallo added >non-issue :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v9.0.0 v8.18.0 labels Dec 11, 2024
@joegallo joegallo requested a review from masseyke December 11, 2024 17:28
@elasticsearchmachine
Copy link
Collaborator

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

@joegallo joegallo added the auto-backport Automatically create backport pull requests when merged label Dec 11, 2024
Function<String, LifecycleAction> randomAction = getNameToActionFunction();
// as what actions end up in the hot phase influence what actions are allowed in the subsequent phases we'll move the hot phase
// at the front of the phases to process (if it exists)
if (phaseNames.contains(TimeseriesLifecycleType.HOT_PHASE)) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we not need to worry about HOT_PHASE coming first any more? I don't really understand why it was necessary in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My read of it is that this code was maybe necessary once, but the loop after this that I didn't remove ended up making this code redundant anyway. https://github.com/elastic/elasticsearch/pull/118488/files/93a7c08283627686d9ef83f7e80793be004c8bb8#diff-ea4f8cb2981d1e363c5308fc815b3ce4f94ec116f7e9691d69bbe63d96c607a4R155-R161

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that tracks the history -- the first (now redundant) block that I've removed was added in #64883, while the second was added a few months later in #68864.

@@ -269,9 +269,8 @@ public Set<Step.StepKey> parseStepKeysFromPhase(String policy, String currentPha
return parseStepsFromPhase(policy, currentPhase, phaseDefNonNull).stream().map(Step::getKey).collect(Collectors.toSet());
} catch (IOException e) {
logger.trace(
() -> String.format(
Locale.ROOT,
"unable to parse steps for policy [{}], phase [{}], and phase definition [{}]",
Copy link
Member

Choose a reason for hiding this comment

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

Oh nice -- we pick up a bug fix!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm just annoyed I didn't catch this on the first go around!

@@ -1436,6 +1436,6 @@ private void assertClusterStateStepInfo(
assertEquals(expectedstepInfoValue, newLifecycleState.stepInfo());
assertEquals(oldLifecycleState.phaseTime(), newLifecycleState.phaseTime());
assertEquals(oldLifecycleState.actionTime(), newLifecycleState.actionTime());
assertEquals(newLifecycleState.stepTime(), newLifecycleState.stepTime());
Copy link
Member

Choose a reason for hiding this comment

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

Nice, another (test) bug fix.

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

LGTM, although I don't understand the one block of test code you removed (or why it was there in the first place).

@joegallo joegallo merged commit 4f80175 into elastic:main Dec 11, 2024
16 checks passed
@joegallo joegallo deleted the ilm-miscellaneous-cleanups branch December 11, 2024 19:31
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

joegallo added a commit to joegallo/elasticsearch that referenced this pull request Dec 11, 2024
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Data Management/ILM+SLM Index and Snapshot lifecycle management >non-issue Team:Data Management Meta label for data/management team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants