Skip to content

[ML] Prevent retention classes from failing when deleting documents in read-only indices #125408

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

Merged

Conversation

valeriy42
Copy link
Contributor

@valeriy42 valeriy42 commented Mar 21, 2025

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

@valeriy42 valeriy42 added >bug :ml Machine learning Team:ML Meta label for the ML team v8.18.1 v8.19.0 v9.1.0 labels Mar 21, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

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

@davidkyle davidkyle added v9.0.1 auto-backport Automatically create backport pull requests when merged labels Mar 21, 2025
@valeriy42 valeriy42 requested a review from davidkyle March 21, 2025 14:32
@valeriy42 valeriy42 self-assigned this Mar 21, 2025
@@ -31,6 +31,7 @@ abstract class AbstractExpiredJobDataRemover implements MlDataRemover {
this.client = client;
this.jobIterator = jobIterator;
this.parentTaskId = parentTaskId;

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@valeriy42 valeriy42 requested a review from Copilot April 14, 2025 14:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

docs/changelog/125408.yaml:2

  • Typo detected: 'UnusuedStatsRemover' should be corrected to 'UnusedStatsRemover'.
summary: Prevent `UnusuedStatsRemover` from failing when deleting documents in read-only indices

@valeriy42 valeriy42 changed the title [ML] Prevent UnusedStatsRemover from failing when deleting documents in read-only indices [ML] Prevent retention classes from failing when deleting documents in read-only indices May 22, 2025
@valeriy42 valeriy42 requested a review from davidkyle May 22, 2025 13:53
@valeriy42 valeriy42 merged commit c822a57 into elastic:main May 23, 2025
18 checks passed
@valeriy42 valeriy42 deleted the enhancement/1532-unused-stats-remover branch May 23, 2025 17:50
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts

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

valeriy42 added a commit to valeriy42/elasticsearch that referenced this pull request Jun 2, 2025
…n read-only indices (elastic#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)
valeriy42 added a commit to valeriy42/elasticsearch that referenced this pull request Jun 2, 2025
…n read-only indices (elastic#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)
@valeriy42
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0
8.19
8.18

Questions ?

Please refer to the Backport tool documentation

valeriy42 added a commit to valeriy42/elasticsearch that referenced this pull request Jun 2, 2025
…n read-only indices (elastic#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)
elasticsearchmachine pushed a commit that referenced this pull request Jun 2, 2025
…ments in read-only indices (#125408) (#128748)

* [ML] Prevent retention classes from failing when deleting documents in read-only indices (#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)

* [CI] Auto commit changes from spotless

* fit build failure

---------

Co-authored-by: elasticsearchmachine <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Jun 2, 2025
…ents in read-only indices (#125408) (#128747)

* [ML] Prevent retention classes from failing when deleting documents in read-only indices (#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)

* [CI] Auto commit changes from spotless

* fit build failure

---------

Co-authored-by: elasticsearchmachine <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Jun 2, 2025
…ments in read-only indices (#125408) (#128749)

* [ML] Prevent retention classes from failing when deleting documents in read-only indices (#125408)

Classes like UnusedStatsRemover delete orphaned documents without an associated job. When the indices are made read-only it will start failing as read-only means no delete.

This PR ensures that the non-writable indices are not included in the delete-by-query requests.

(cherry picked from commit c822a57)

* [CI] Auto commit changes from spotless

* fit build failure

---------

Co-authored-by: elasticsearchmachine <[email protected]>
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 backport pending >bug :ml Machine learning Team:ML Meta label for the ML team v8.18.3 v8.19.0 v9.0.3 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants