Skip to content

Introduce IndexSettingDeprecatedInV8AndRemovedInV9 Setting property #120334

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

Conversation

alexey-ivanov-es
Copy link
Contributor

Index-scope settings deprecated in one major version cannot be removed in the next major version after the deprecation because they might still be used in indices created by the previous version. These settings should remain in the code but be prohibited when new indices are created.

To achieve this, such settings should be marked as IndexSettingDeprecatedInVXAndRemovedInVY and there is a special check to prohibit their usage in newer indices. In V9 Elasticsearch Elasticsearch will still support reading indices created by V7, so IndexSettingDeprecatedInV7AndRemovedInV8 will remain in the code.

Currently, there are plans to deprecate index-scope settings in 8.18 and remove them in 9.0. This change introduces the IndexSettingDeprecatedInV8AndRemovedInV9 constant to mark these settings.

The check to enforce the prohibition of settings removed in V9 will be introduced separately once we have IndexVersion after marking all relevant settings as removed.

@alexey-ivanov-es alexey-ivanov-es requested a review from a team as a code owner January 16, 2025 23:11
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Jan 16, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine
Copy link
Collaborator

Hi @alexey-ivanov-es, I've created a changelog YAML for you.

Copy link
Contributor

@JVerwolf JVerwolf left a comment

Choose a reason for hiding this comment

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

Does IndexSettingDeprecatedInV8AndRemovedInV9 also need to be added to the following?:

  • public boolean isDeprecatedAndRemoved()
  • org.elasticsearch.xpack.migrate.action.CreateIndexFromSourceTransportAction#filterSettings

@alexey-ivanov-es
Copy link
Contributor Author

@JVerwolf
No:

The check to enforce the prohibition of settings removed in V9 will be introduced separately once we have IndexVersion after marking all relevant settings as removed.

Before we have IndexVersion for V9 release these settings should continue to work as deprecated, so we shouldn't throw exception if they are used and we shouldn't filter out them during reindexing

Copy link
Contributor

@JVerwolf JVerwolf left a comment

Choose a reason for hiding this comment

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

LGTM

@alexey-ivanov-es alexey-ivanov-es merged commit d53c99c into elastic:main Jan 22, 2025
16 checks passed
@alexey-ivanov-es alexey-ivanov-es deleted the IndexSettingDeprecatedInV8AndRemovedInV9 branch January 22, 2025 19:32
@cbuescher
Copy link
Member

Quick question after reading this:

Currently, there are plans to deprecate index-scope settings in 8.18 and remove them in 9.0. This change introduces the IndexSettingDeprecatedInV8AndRemovedInV9 constant to mark these settings.

Does "remove" here mean using the setting in 9 will throw an error, but the settings constant remains for backwards compatibility with indices created in 7 or 8? I assume so but "removal" somehow sounds like removal of the settings themselves from the codebase. We cannot really do that now for settings that might still be used in version 7 indices.

@alexey-ivanov-es
Copy link
Contributor Author

@cbuescher

Does "remove" here mean using the setting in 9 will throw an error, but the settings constant remains for backwards compatibility with indices created in 7 or 8?

Yes, that's correct - users won't be able to use the setting anymore, but it will remain in the codebase. As you rightly said, it's still needed for backward compatibility and this is exactly why we need IndexSettingDeprecatedInV8AndRemovedInV9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Settings Settings infrastructure and APIs >enhancement Team:Core/Infra Meta label for core/infra team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants