Skip to content

Conversation

@williamrandolph
Copy link
Contributor

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

@williamrandolph williamrandolph changed the title Validate that system indices aren't also hidden inidices Validate that system indices aren't also hidden indices May 5, 2021
@williamrandolph williamrandolph added :Core/Infra/Core Core issues without another label >bug v7.14.0 v8.0.0 labels May 7, 2021
@williamrandolph williamrandolph marked this pull request as ready for review May 7, 2021 03:07
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label May 7, 2021
@elasticmachine
Copy link
Collaborator

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

@williamrandolph williamrandolph requested a review from jaymode May 10, 2021 13:09
@williamrandolph
Copy link
Contributor Author

@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() +
Copy link
Member

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?

Copy link
Contributor Author

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.

@williamrandolph williamrandolph requested a review from jaymode May 14, 2021 23:02
@williamrandolph williamrandolph requested a review from jaymode May 25, 2021 17:13
Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

LGTM

@williamrandolph williamrandolph merged commit 584974e into elastic:master May 25, 2021
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
@williamrandolph
Copy link
Contributor Author

7.x backport PR: #73428 (needed some modifications to compile)
7.13 backport commit: ce362d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v7.13.1 v7.14.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not allow system indices to be hidden

5 participants