-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Validate that system indices aren't also hidden indices #72768
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
Validate that system indices aren't also hidden indices #72768
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
@elasticmachine test this please |
|
|
||
| if (isSystem) { | ||
| if (cursor.value.getSettings().getAsBoolean(IndexMetadata.SETTING_INDEX_HIDDEN, false)) { | ||
| throw new IllegalStateException("Cannot define index [" + cursor.value.getIndex().getName() + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this should throw an error but rather ensure that the setting is set to false and if not, correct it, in this task.
This validation should happen elsewhere. Maybe in the MetadataUpdateSettingsService or the setting validator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In TransportUpdateSettingsAction, we validate that a settings update with unknown origin isn't trying to change the settings of a system index. Since that validation already brings together cluster state, system indices, and index settings, it seemed like a good place to add another layer of validation.
.../java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/SystemIndexMetadataUpgradeService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Validate that system indices aren't also hidden inidices * Remove hidden from ingest geo system index * Add test coverage * Remove hidden setting from system index even if not upgrading
) * Validate that system indices aren't also hidden indices (#72768) * Validate that system indices aren't also hidden inidices * Remove hidden from ingest geo system index * Add test coverage * Remove hidden setting from system index even if not upgrading * Fix compilation for backport
) * Validate that system indices aren't also hidden indices (#72768) * Validate that system indices aren't also hidden inidices * Remove hidden from ingest geo system index * Add test coverage * Remove hidden setting from system index even if not upgrading * Fix compilation for backport
Although system indices will be mostly invisible to users in 8.0, we use a different mechanism for this than what "hidden indices" use. By design, we shouldn't use both at once. When we create a system index descriptor or set the "system" property on an existing index, we need to validate that the index isn't hidden.
Fixes #72631