Skip to content

Conversation

@lukewhiting
Copy link
Contributor

@lukewhiting lukewhiting commented Feb 13, 2025

This PR modified the Reindex Datastreams endpoint to allow it to correctly handle restarting a reindex job in the 24 hours after it completes.

Currently, because we cache the job for 24 hours after completion, you can't start a new reindex for the same datastream as it will throw an exception due to the duplicated persistent task ID.

The PR updates that behaviour so that the endpoint now checks for an existing task for that datastream, if it finds one, it check the status. If still running, fail as before but if complete then remove that task from the cache and start a new task.

@lukewhiting lukewhiting force-pushed the es-10851-allow-reindex-when-completed branch from 77b4b93 to 7c1b83b Compare February 17, 2025 12:12
@lukewhiting lukewhiting marked this pull request as ready for review February 17, 2025 14:03
@lukewhiting lukewhiting added the auto-backport Automatically create backport pull requests when merged label Feb 17, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Feb 17, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@parkertimmins parkertimmins left a comment

Choose a reason for hiding this comment

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

Looks correct to me. But Keith knows this code better, so let's wait to merge until he has taken a look.

@masseyke
Copy link
Member

Looks good to me, but can you add a note about it at https://github.com/elastic/elasticsearch/blob/main/docs/reference/migration/apis/data-stream-reindex.asciidoc?plain=1#L25?

@lukewhiting
Copy link
Contributor Author

Warning

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

Ignoring this so it can be picked up in backport. Will open the relevant docs repo issue once this is merged.

@github-actions
Copy link
Contributor

Warning

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

@elastic elastic deleted a comment from github-actions bot Feb 19, 2025
@github-actions
Copy link
Contributor

Warning

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

@github-actions
Copy link
Contributor

Warning

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

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

@lukewhiting lukewhiting merged commit e3792d1 into elastic:main Feb 20, 2025
16 of 17 checks passed
lukewhiting added a commit to lukewhiting/elasticsearch that referenced this pull request Feb 20, 2025
…c#122510)

* Allow data stream reindex tasks to be re-run after completion

* Docs update

* Update docs/reference/migration/apis/data-stream-reindex.asciidoc

Co-authored-by: Keith Massey <[email protected]>

---------

Co-authored-by: Keith Massey <[email protected]>
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0
8.18
8.x

lukewhiting added a commit to lukewhiting/elasticsearch that referenced this pull request Feb 20, 2025
…c#122510)

* Allow data stream reindex tasks to be re-run after completion

* Docs update

* Update docs/reference/migration/apis/data-stream-reindex.asciidoc

Co-authored-by: Keith Massey <[email protected]>

---------

Co-authored-by: Keith Massey <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Feb 20, 2025
… (#123035)

* Allow data stream reindex tasks to be re-run after completion

* Docs update

* Update docs/reference/migration/apis/data-stream-reindex.asciidoc



---------

Co-authored-by: Keith Massey <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Feb 20, 2025
… (#123037)

* Allow data stream reindex tasks to be re-run after completion

* Docs update

* Update docs/reference/migration/apis/data-stream-reindex.asciidoc



---------

Co-authored-by: Keith Massey <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Feb 20, 2025
… (#123036)

* Allow data stream reindex tasks to be re-run after completion

* Docs update

* Update docs/reference/migration/apis/data-stream-reindex.asciidoc



---------

Co-authored-by: Keith Massey <[email protected]>
@lukewhiting lukewhiting deleted the es-10851-allow-reindex-when-completed branch April 2, 2025 08:52
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/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v8.18.1 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants