Skip to content
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

Don't migrate system indices that match user templates #87262

Conversation

williamrandolph
Copy link
Contributor

In 7.x, legacy and composable templates may apply to system indices. We don't want this behavior during feature migration. The destination index should get its settings, mappings, and aliases from its system index descriptor. A user who gets this warning should modify their templates so that they do not match system indices, at least during the migration.

Fixes #86801

it. Users should delete or change their templates during system
feature migration.
@williamrandolph williamrandolph added :Core/Infra/Core Core issues without another label >bug v7.17.5 labels May 31, 2022
@elasticsearchmachine
Copy link
Collaborator

Hi @williamrandolph, I've created a changelog YAML for you.

@williamrandolph
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/part-2

looks like it was some kind of timeout on an unrelated test

@@ -161,6 +161,11 @@ public static Builder builder(String name) {
return new Builder(name);
}

@Override
public String toString() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Convenience method so that the errors we return actual contain the template name we failed on.

@grcevski grcevski marked this pull request as ready for review June 21, 2022 00:17
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jun 21, 2022
@elasticmachine
Copy link
Collaborator

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

@grcevski grcevski requested a review from rjernst June 21, 2022 00:18
@grcevski grcevski added blocker and removed blocker labels Jun 22, 2022
@grcevski
Copy link
Contributor

I think this PR needs to check for unmanaged indices and not block the migration, since the Kibana security-session template will definitely be flagged as a problem template elastic/kibana#134897

@@ -381,6 +383,41 @@ private void migrateSingleIndex(ClusterState clusterState, Consumer<BulkByScroll
}
Index oldIndex = imd.getIndex();
String newIndexName = migrationInfo.getNextIndexName();

final String v2template = MetadataIndexTemplateService.findV2Template(clusterState.metadata(), newIndexName, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought v2 templates already don't match system indices, and the problem was only caused by legacy templates - I'll try to double check this, but I'll also ask: Am I just straight-up wrong about that?

Copy link
Contributor

Choose a reason for hiding this comment

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

@grcevski
Copy link
Contributor

Superseded by #87979.

@grcevski grcevski closed this Jun 23, 2022
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.17.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants