Skip to content

Fix the timestamp field of a data stream to @timestamp#59210

Merged
martijnvg merged 9 commits intoelastic:7.xfrom
martijnvg:backport_59076
Jul 8, 2020
Merged

Fix the timestamp field of a data stream to @timestamp#59210
martijnvg merged 9 commits intoelastic:7.xfrom
martijnvg:backport_59076

Conversation

@martijnvg
Copy link
Copy Markdown
Member

Backport #59076 of to 7.x branch.

The commit makes the following changes:

  • The timestamp field of a data stream definition in a composable
    index template can only be set to '@timestamp'.
  • Removed custom data stream timestamp field validation and reuse the validation from TimestampFieldMapper and
    instead only check that the _timestamp field mapping has been defined on a backing index of a data stream.
  • Moved code that injects _timestamp meta field mapping from MetadataCreateIndexService#applyCreateIndexRequestWithV2Template58956(...) method
    to MetadataIndexTemplateService#collectMappings(...) method.
  • Fixed a bug (Component templates are considered invalid without timestamp_field #58956) that cases timestamp field validation to be performed
    for each template and instead of the final mappings that is created.
  • only apply _timestamp meta field if index is created as part of a data stream or data stream rollover,
    this fixes a docs test, where a regular index creation matches (logs-*) with a template with a data stream definition.

Relates to #58642
Relates to #53100
Closes #58956
Closes #58583

martijnvg added 4 commits July 8, 2020 10:01
Backport elastic#59076 of to 7.x branch.

The commit makes the following changes:
* The timestamp field of a data stream definition in a composable
  index template can only be set to '@timestamp'.
* Removed custom data stream timestamp field validation and reuse the validation from `TimestampFieldMapper` and
  instead only check that the _timestamp field mapping has been defined on a backing index of a data stream.
* Moved code that injects _timestamp meta field mapping from `MetadataCreateIndexService#applyCreateIndexRequestWithV2Template58956(...)` method
  to `MetadataIndexTemplateService#collectMappings(...)` method.
* Fixed a bug (elastic#58956) that cases timestamp field validation to be performed
  for each template and instead of the final mappings that is created.
* only apply _timestamp meta field if index is created as part of a data stream or data stream rollover,
this fixes a docs test, where a regular index creation matches (logs-*) with a template with a data stream definition.

Relates to elastic#58642
Relates to elastic#53100
Closes elastic#58956
Closes elastic#58583
(a change got in after I merged in master into this pr, but didn't notice it until I merged this pr)
@martijnvg martijnvg added backport :StorageEngine/Data streams Data streams and their lifecycles v7.9.0 labels Jul 8, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Data streams)

@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Jul 8, 2020
@martijnvg
Copy link
Copy Markdown
Member Author

@elasticmachine run elasticsearch-ci/2

@martijnvg
Copy link
Copy Markdown
Member Author

ci/2 failed, because of Cannot get property 'test.fixtures.gcs-fixture-other.tcp.80' on extra properties extension as it does not exist.
Waiting until #58795 gets resolved.

@martijnvg
Copy link
Copy Markdown
Member Author

@elasticmachine run elasticsearch-ci/2

@martijnvg martijnvg merged commit 17bd559 into elastic:7.x Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :StorageEngine/Data streams Data streams and their lifecycles Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants