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

Update IndexTemplateMetaData to allow unknown fields #38448

Merged
merged 3 commits into from Feb 6, 2019

Conversation

Projects
None yet
6 participants
@martijnvg
Copy link
Member

commented Feb 5, 2019

Update IndexTemplateMetaData to use ObjectParser
The IndexTemplateMetaData class used old parsing logic and was not
resiliant to new fields. This commit updates it to use the
ConstructingObjectParser and allow unknown fields.

Also a test was added that randomly generates a response that an ES node would returns and
this test verifies that HLRC can parse it. This gives us the test coverage and confidence that
new parsing code is working well.

Relates #36938

hub-cap and others added some commits Feb 4, 2019

Update IndexTemplateMetaData to use ObjectParser
The IndexTemplateMetaData class used old parsing logic and was not
resiliant to new fields. This commit updates it to use the
ConstructingObjectParser and allow unknown fields.

Relates #36938
@elasticmachine

This comment has been minimized.

Copy link

commented Feb 5, 2019

@hub-cap

hub-cap approved these changes Feb 5, 2019

Copy link
Contributor

left a comment

LGTM but i wrote 1/2 the code so id like an independent set of 👓

@dakrone

dakrone approved these changes Feb 5, 2019

Copy link
Member

left a comment

LGTM

@jakelandis

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

I don't think this can go back to 6.7 , since if I read this correctly... it also removes support for the deprecated "template" field, which Logstash (and possibly others) still uses on 6.x. Also we should probably add this as a breaking change and add to deprecation info API.

EDIT: this is client only code, so we don't need to add to deprecation info API

@jakelandis
Copy link
Contributor

left a comment

LGTM for 7.x only

However, I would encourage a test that explicitly tests that "template" is no longer supported.

I just realized this is only for the client code (not server side), so no need to add to breaking changes for server. I am OK with the client being more aggressive here then the server w/r/t to support for the deprecated field. (A test here would help to communicate that too).

@jakelandis

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

@martijnvg - if you merge this is 7.x, could you please log a follow up issue to remove support for "template" in the server side parsers, targeted at 8.0 ?

@martijnvg

This comment has been minimized.

Copy link
Member Author

commented Feb 5, 2019

@jakelandis The IndexTemplateMetaData.Builder#toInnerXContent(...) method never serializes the index patterns under the pattern key, always under the index_patterns key. Since what this method generates, is what the hrlc will parse, I think this PR can be backported to 6.7? I'm not saying we should, but there is no harm in backporting it?

The logic that with the pattern key is only used for reading xcontent from the client on the server side. This parsing code was copied to hlrc, but can safely be removed.

if you merge this is 7.x, could you please log a follow up issue to remove support for "template" in the server side parsers, targeted at 8.0 ?

Yes, I will open an issue for this.

@jakelandis

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2019

@martijnvg - I see now, I missed this part: "IndexTemplateMetaData.Builder#toInnerXContent(...) method never serializes..." Thanks for explaining.

LGTM for 6.x too.

@martijnvg martijnvg merged commit 9492dce into elastic:master Feb 6, 2019

7 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci/1 Build finished.
Details
elasticsearch-ci/2 Build finished.
Details
elasticsearch-ci/default-distro Build finished.
Details
elasticsearch-ci/docbldesx Build finished.
Details
elasticsearch-ci/oss-distro-docs Build finished.
Details
elasticsearch-ci/packaging-sample Build finished.
Details

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Feb 6, 2019

Update IndexTemplateMetaData to allow unknown fields (elastic#38448)
Updated IndexTemplateMetaData to use ObjectParser.

The IndexTemplateMetaData class used old parsing logic and was not
resiliant to new fields. This commit updates it to use the
ConstructingObjectParser and allow unknown fields.

Relates elastic#36938

Co-authored-by: Michael Basnight <mbasnight@gmail.com>
Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>

martijnvg added a commit that referenced this pull request Feb 6, 2019

Update IndexTemplateMetaData to allow unknown fields (#38448) (#38493)
Updated IndexTemplateMetaData to use ObjectParser.

The IndexTemplateMetaData class used old parsing logic and was not
resiliant to new fields. This commit updates it to use the
ConstructingObjectParser and allow unknown fields.

Relates #36938

Co-authored-by: Michael Basnight <mbasnight@gmail.com>
Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 6, 2019

Merge remote-tracking branch 'elastic/master' into enable-bwc-retenti…
…on-leases-recovery

* elastic/master:
  SQL: Allow look-ahead resolution of aliases for WHERE clause (elastic#38450)
  Add API key settings documentation (elastic#38490)
  Remove support for maxRetryTimeout from low-level REST client (elastic#38085)
  Update IndexTemplateMetaData to allow unknown fields (elastic#38448)
  Mute testRetentionLeasesSyncOnRecovery (elastic#38488)
  Change the min supported version to 6.7.0 for API keys (elastic#38481)

@colings86 colings86 added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019

dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Feb 12, 2019

Update IndexTemplateMetaData to allow unknown fields (elastic#38448)
Updated IndexTemplateMetaData to use ObjectParser.

The IndexTemplateMetaData class used old parsing logic and was not
resiliant to new fields. This commit updates it to use the
ConstructingObjectParser and allow unknown fields.

Relates elastic#36938

Co-authored-by: Michael Basnight <mbasnight@gmail.com>
Co-authored-by: Martijn van Groningen <martijn.v.groningen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.