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

Support 'include_type_name' in RestGetIndicesAction #37149

Merged
merged 11 commits into from
Jan 9, 2019

Conversation

cbuescher
Copy link
Member

This change adds support for the 'include_type_name' parameter for the
indices.get API. This parameter, which defaults to false starting in 7.0,
changes the response to not include the indices type names any longer.

If the parameter is set in the request, we additionally emit a deprecation
warning since using the parameter should be only temporarily necessary while
adapting to the new response format and we will remove it with the next major
version.

This change adds support for the 'include_type_name' parameter for the
indices.get API. This parameter, which defaults to `false` starting in 7.0,
changes the response to not include the indices type names any longer.

If the parameter is set in the request, we additionally emit a deprecation
warning since using the parameter should be only temporarily necessary while
adapting to the new response format and we will remove it with the next major
version.
@cbuescher cbuescher added :Search Foundations/Mapping Index mappings, including merging and defining field types >deprecation v7.0.0 labels Jan 4, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@@ -52,6 +52,35 @@ setup:
- is_true: test_index.settings
- is_true: test_index.mappings

---
"Test include_type_name":
- skip:
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: this can be removed after the parameter support has been backported to 6.x

cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Jan 4, 2019
I started referring to this parameter name from various places in elastic#37149 so I
think it's a good idea to simplify things by referring to a common constant.
@cbuescher cbuescher force-pushed the types-deprecation-get-indices branch 2 times, most recently from 8f3cb9b to 7ebb0cb Compare January 4, 2019 20:37
@cbuescher cbuescher force-pushed the types-deprecation-get-indices branch from 7ebb0cb to 4a07eed Compare January 4, 2019 20:44
@cbuescher
Copy link
Member Author

@elasticmachine run the gradle build tests 1

cbuescher pushed a commit that referenced this pull request Jan 7, 2019
I started referring to this parameter name from various places in #37149 so I
think it's a good idea to simplify things by referring to a common constant.
@cbuescher
Copy link
Member Author

@elasticmachine run the gradle build tests 1

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

Thanks @cbuescher, this looks like it's on a good track. My main questions are around the Java HLRC:

  • I had assumed we would flatten GetIndexResponse#mappings to be of type ImmutableOpenMap<String, MappingMetaData>, to avoid nesting the mappings under the _doc key.
  • When we backport to 6.x, are we planning to add note under 'breaking changes', and also a 'breaking' label to the PR? My understanding from reading this PR is that for the Java HLRC we will force include_type_name = false.

Finally, maybe a Java HLRC expert could take a look to make sure this breaking approach is okay.

@cbuescher
Copy link
Member Author

* I had assumed we would flatten `GetIndexResponse#mappings` to be of type `ImmutableOpenMap<String, MappingMetaData>`, to avoid nesting the mappings under the `_doc` key.

If we want to do this, I would only do it in the getter in GetIndexResponse, but leave the internal mappings field as is. Otherwise we also need to touch serialization and possible how the mappings are filled in TransportGetIndexAction. I think these are internal refactorings that we should do later, maybe even only on 8.0 where we remove all this cruft.

Changing the Java-API of GetIndexResponse however would be breaking, at least in 7.0. I wouldn't backport this change to 6.x. It would also mean ppl. would be able to get at the "old" type names via the REST API but not e.g. using the old transport client, which might be considered odd.

@cbuescher
Copy link
Member Author

My understanding from reading this PR is that for the Java HLRC we will force `include_type_name = false`.

So far I thought we could make the 6.x HLRC client force include_type_name = true to get back the legacy format. The 6.x client needs to be forward compatible, so they should be able to talk to both 6.x and 7.0 nodes. I think it would help people transitioning if they would not need to update any of their own application logic before moving to the 7.0 client which will force the new response behaviour and will swallow the type information.

@cbuescher cbuescher force-pushed the types-deprecation-get-indices branch from 92c6e86 to 296f2bc Compare January 7, 2019 22:09
@cbuescher
Copy link
Member Author

@jtibshirani thanks for the review, I pushed a round of changes and tried to respond to your two questions above. Let me know if these answers make sense or you have objections. If we cannot decide on the GetIndexResponse#mappings change for now, we can leave it out of this PR perhaps and discuss it in more details elsewhere? It should be easy to add if we agree on doing so later on as well.

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

A few more comments, it looks very close! Sounds good about revisiting the mappings HLRC change later. It would be good to have a high-bandwidth discussion about this in person.

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

I left a few comments for your consideration, but they are minor and I don't think need another round of review.

@cbuescher
Copy link
Member Author

@jtibshirani thanks for the last round of review and the thumbs up, I pushed another commit adressing you last comments. Waiting for green CI now before I merge.

@cbuescher
Copy link
Member Author

@elasticmachine run default distro tests

@cbuescher cbuescher merged commit c149bb8 into elastic:master Jan 9, 2019
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Jan 9, 2019
This change adds support for the 'include_type_name' parameter for the
indices.get API. This parameter, which defaults to `false` starting in 7.0,
changes the response to not include the indices type names any longer.

If the parameter is set in the request, we additionally emit a deprecation
warning since using the parameter should be only temporarily necessary while
adapting to the new response format and we will remove it with the next major
version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking >deprecation :Search Foundations/Mapping Index mappings, including merging and defining field types v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants