Skip to content

Conversation

@nielsbauman
Copy link
Contributor

The following order of events was possible:

  • An ILM policy update cleared cachedSteps
  • ILM retrieves the step definition for an index, this populates cachedSteps with the outdated policy
  • The updated policy is put in lifecyclePolicyMap

Any subsequent cache retrievals will see the old step definition.

By clearing cachedSteps after we update lifecyclePolicyMap, we ensure eventual consistency between the policy and the cache.

Fixes #118406

The following order of events was possible:
- An ILM policy update cleared `cachedSteps`
- ILM retrieves the step definition for an index, this populates `cachedSteps` with the outdated policy
- The updated policy is put in `lifecyclePolicyMap`

Any subsequent cache retrievals will see the old step definition.

By clearing `cachedSteps` _after_ we update `lifecyclePolicyMap`, we
ensure eventual consistency between the policy and the cache.

Fixes elastic#118406
@nielsbauman nielsbauman added >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 labels Apr 15, 2025
@nielsbauman nielsbauman requested a review from gmarouli April 15, 2025 11:55
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @nielsbauman, I've created a changelog YAML for you.

Copy link
Contributor

@gmarouli gmarouli left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @nielsbauman 🚀

@nielsbauman nielsbauman enabled auto-merge (squash) April 16, 2025 10:54
@nielsbauman nielsbauman merged commit 5383f0f into elastic:main Apr 16, 2025
17 checks passed
@nielsbauman nielsbauman deleted the fix-ilm-cache branch April 16, 2025 11:58
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 126840

@nielsbauman
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

elasticsearchmachine pushed a commit that referenced this pull request Apr 17, 2025
The following order of events was possible:
- An ILM policy update cleared `cachedSteps`
- ILM retrieves the step definition for an index, this populates `cachedSteps` with the outdated policy
- The updated policy is put in `lifecyclePolicyMap`

Any subsequent cache retrievals will see the old step definition.

By clearing `cachedSteps` _after_ we update `lifecyclePolicyMap`, we
ensure eventual consistency between the policy and the cache.

Fixes #118406

(cherry picked from commit 5383f0f)

# Conflicts:
#	muted-tests.yml
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 >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] SearchableSnapshotActionIT testUpdatePolicyToAddPhasesYieldsInvalidActionsToBeSkipped failing

3 participants