Validate that system indices aren't also hidden indices#72768
Merged
williamrandolph merged 11 commits intoelastic:masterfrom May 25, 2021
Merged
Validate that system indices aren't also hidden indices#72768williamrandolph merged 11 commits intoelastic:masterfrom
williamrandolph merged 11 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Contributor
Author
|
@elasticmachine test this please |
jaymode
requested changes
May 12, 2021
|
|
||
| if (isSystem) { | ||
| if (cursor.value.getSettings().getAsBoolean(IndexMetadata.SETTING_INDEX_HIDDEN, false)) { | ||
| throw new IllegalStateException("Cannot define index [" + cursor.value.getIndex().getName() + |
Member
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
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.
jaymode
requested changes
May 24, 2021
.../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
williamrandolph
added a commit
to williamrandolph/elasticsearch
that referenced
this pull request
May 26, 2021
* 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
williamrandolph
added a commit
that referenced
this pull request
May 26, 2021
) * 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
williamrandolph
added a commit
that referenced
this pull request
May 26, 2021
) * 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
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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