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

Always show composed_of field for composable index templates #105315

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Feb 8, 2024

Prior to e786cfa we inadvertently always added composable index templates with composed_of: [] beacuse
e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630 created a new ComposableIndexTemplate from an existing one, and the .composedOf() field returned an empty list of no component templates were provided:

public List<String> composedOf() {
if (componentTemplates == null) {
return List.of();
}
return componentTemplates;
}

This meant that before 8.12.0 we would always show composed_of: [] for composable index templates. This commit recreates this behavior, and always displays the empty list even if no component templates are used by a composable index template.

Resolves #104627

Prior to e786cfa we inadvertently always added composable index
templates with `composed_of: []` beacuse
elastic@e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630
created a new `ComposableIndexTemplate` from an existing one, and the `.composedOf()` field returned
an empty list of no component templates were provided:

https://github.com/elastic/elasticsearch/blob/89e714ee5dc60db8b4979ab6372ff767e108e9da/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java#L172-L177

This meant that before 8.12.0 we would always show `composed_of: []` for composable index templates.
This commit recreates this behavior, and always displays the empty list even if no component
templates are used by a composable index template.

Resolves elastic#104627
@dakrone dakrone added >bug :Data Management/Indices APIs APIs to create and manage indices and templates v8.13.0 labels Feb 8, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Feb 8, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@dakrone
Copy link
Member Author

dakrone commented Feb 12, 2024

@elasticmachine update branch

@dakrone
Copy link
Member Author

dakrone commented Feb 13, 2024

@elasticmachine update branch

@marcgise
Copy link

It would be nice to have this fix on 8.12.2 version... please. Thanks

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM!

@marcgise
Copy link

marcgise commented Feb 15, 2024

Will it be solved before 8.14.0? Please, solve it in Java API too...

@dakrone dakrone merged commit 009a847 into elastic:main Feb 15, 2024
14 checks passed
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Feb 15, 2024
…ic#105315)

* Always show `composed_of` field for composable index templates

Prior to e786cfa we inadvertently always added composable index
templates with `composed_of: []` beacuse
elastic@e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630
created a new `ComposableIndexTemplate` from an existing one, and the `.composedOf()` field returned
an empty list of no component templates were provided:

https://github.com/elastic/elasticsearch/blob/89e714ee5dc60db8b4979ab6372ff767e108e9da/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java#L172-L177

This meant that before 8.12.0 we would always show `composed_of: []` for composable index templates.
This commit recreates this behavior, and always displays the empty list even if no component
templates are used by a composable index template.

Resolves elastic#104627
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.12
8.13

dakrone added a commit to dakrone/elasticsearch that referenced this pull request Feb 15, 2024
…ic#105315)

* Always show `composed_of` field for composable index templates

Prior to e786cfa we inadvertently always added composable index
templates with `composed_of: []` beacuse
elastic@e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630
created a new `ComposableIndexTemplate` from an existing one, and the `.composedOf()` field returned
an empty list of no component templates were provided:

https://github.com/elastic/elasticsearch/blob/89e714ee5dc60db8b4979ab6372ff767e108e9da/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java#L172-L177

This meant that before 8.12.0 we would always show `composed_of: []` for composable index templates.
This commit recreates this behavior, and always displays the empty list even if no component
templates are used by a composable index template.

Resolves elastic#104627
elasticsearchmachine pushed a commit that referenced this pull request Feb 15, 2024
…) (#105571)

* Always show `composed_of` field for composable index templates

Prior to e786cfa we inadvertently always added composable index
templates with `composed_of: []` beacuse
e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630
created a new `ComposableIndexTemplate` from an existing one, and the `.composedOf()` field returned
an empty list of no component templates were provided:

https://github.com/elastic/elasticsearch/blob/89e714ee5dc60db8b4979ab6372ff767e108e9da/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java#L172-L177

This meant that before 8.12.0 we would always show `composed_of: []` for composable index templates.
This commit recreates this behavior, and always displays the empty list even if no component
templates are used by a composable index template.

Resolves #104627
elasticsearchmachine pushed a commit that referenced this pull request Feb 15, 2024
…) (#105572)

* Always show `composed_of` field for composable index templates

Prior to e786cfa we inadvertently always added composable index
templates with `composed_of: []` beacuse
e786cfa#diff-5081302eb39033199deb1977d544d1cd7867212a92b8d77e0aa0ded361272b11L618-L630
created a new `ComposableIndexTemplate` from an existing one, and the `.composedOf()` field returned
an empty list of no component templates were provided:

https://github.com/elastic/elasticsearch/blob/89e714ee5dc60db8b4979ab6372ff767e108e9da/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java#L172-L177

This meant that before 8.12.0 we would always show `composed_of: []` for composable index templates.
This commit recreates this behavior, and always displays the empty list even if no component
templates are used by a composable index template.

Resolves #104627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team v8.12.2 v8.13.1 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Response of GET index_templates is missing requiered field composed_of
5 participants