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
Don't migrate system indices that match user templates #87262
Conversation
it. Users should delete or change their templates during system feature migration.
Hi @williamrandolph, I've created a changelog YAML for you. |
@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() { |
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.
Convenience method so that the errors we return actual contain the template name we failed on.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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); |
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 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?
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 think both apply, is this legacy or not template usage from kibana: https://github.com/elastic/kibana/blob/3730dd0779ed8efd74aee88f57422781ec1ac122/x-pack/plugins/security/server/session_management/session_index.ts#L61-L92
Superseded by #87979. |
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