Skip to content

Correcting the index version filter in migration reindex logic #118487

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
merged 1 commit into from
Dec 11, 2024

Conversation

masseyke
Copy link
Member

This corrects the index version filter in the migration reindex logic. We want to require reindexing of indices if they were created before the current version, because those indices will not be writable in the next version. So for Elasticsearch 9, we want to return any indices created before Elasticsearch 9 because those will not be writable in Elasticsearch 10. When this is backported to 8.18 we will want to change this version to Elasticsearch 8.0.0 because Elasticsearch 9 will not support writing to any indices created before 8.0.0.

@masseyke masseyke marked this pull request as ready for review December 11, 2024 19:19
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Dec 11, 2024
@elasticsearchmachine
Copy link
Collaborator

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

* The version before which we do not support writes in the _next_ major version of Elasticsearch. For example, Elasticsearch 10.x will
* not support writing to indices created before version 9.0.0.
*/
private static final IndexVersion MINIMUM_WRITEABLE_VERSION_AFTER_UPGRADE = IndexVersions.UPGRADE_TO_LUCENE_10_0_0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good explanation and naming 👍

* This predicate allows through only indices that were created with a previous lucene version, meaning that they need to be reindexed
* in order to be writable in the _next_ lucene version.
*/
public static Predicate<Index> getOldIndexVersionPredicate(Metadata metadata) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe change predicate name to hasOldIndexVersion

Copy link
Contributor

Choose a reason for hiding this comment

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

Err maybe not. I see that the current naming is meant to explain that you are making a predicate from the metadata

@masseyke masseyke merged commit 2c5efd2 into elastic:main Dec 11, 2024
16 checks passed
@masseyke masseyke deleted the remove-use-of-isLegacyVersion branch December 11, 2024 19:39
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Dec 11, 2024
elasticsearchmachine pushed a commit that referenced this pull request Dec 11, 2024
…) (#118503)

* Correcting the index version filter in migration reindex logic (#118487)

* fixing the version for 8.x
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
…ic#118487) (elastic#118503)

* Correcting the index version filter in migration reindex logic (elastic#118487)

* fixing the version for 8.x
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
…ic#118487) (elastic#118503)

* Correcting the index version filter in migration reindex logic (elastic#118487)

* fixing the version for 8.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Data streams Data streams and their lifecycles >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