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

Fix data stream alias validation. #81040

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

martijnvg
Copy link
Member

@martijnvg martijnvg commented Nov 25, 2021

In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes #80972

@martijnvg martijnvg added the >bug label Nov 25, 2021
@martijnvg martijnvg force-pushed the fix_data_stream_alias_validation branch from 328b22f to 8e54116 Compare November 25, 2021 16:07
@martijnvg martijnvg marked this pull request as ready for review November 25, 2021 16:07
@martijnvg martijnvg requested a review from danhermann November 25, 2021 16:07
@martijnvg martijnvg added :Data Management/Data streams Data streams and their lifecycles v7.16.1 v8.0.0 labels Nov 25, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Nov 25, 2021
@elasticmachine
Copy link
Collaborator

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

@martijnvg martijnvg force-pushed the fix_data_stream_alias_validation branch from 41fcfa5 to 36dd4e6 Compare November 25, 2021 20:46
In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes elastic#80972
@martijnvg martijnvg force-pushed the fix_data_stream_alias_validation branch from 36dd4e6 to e4793d4 Compare November 25, 2021 20:49
Copy link
Contributor

@danhermann danhermann left a comment

Choose a reason for hiding this comment

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

LGTM

@martijnvg martijnvg merged commit 5c43302 into elastic:master Nov 30, 2021
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 30, 2021
In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes elastic#80972
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 30, 2021
In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes elastic#80972
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.0
7.16

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 30, 2021
…ngIndicesAlias() test

and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to elastic#81040
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 30, 2021
…ngIndicesAlias() test

and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to elastic#81040
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Nov 30, 2021
…ngIndicesAlias() test

and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to elastic#81040
elasticsearchmachine pushed a commit that referenced this pull request Nov 30, 2021
* Fix data stream alias validation. (#81040)

In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes #80972

* adjust to 7.16 reality

* Unmute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test
and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to #81040
martijnvg added a commit that referenced this pull request Nov 30, 2021
…ngIndicesAlias() test (#81142)

and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to #81040
elasticsearchmachine pushed a commit that referenced this pull request Nov 30, 2021
* Fix data stream alias validation. (#81040)

In case of restoring a snapshot, it is possible to overwrite an existing
data stream with a data stream alias from a snapshot. This change fixes
this by improving the generic duplicate name validation.

On top of this the lack of data stream alias validation in Metadata.Builder#build()
method resulted in cases where data stream aliases could be added for existing
index aliases, data streams or indices with the same name.

Closes #80972

* Unmute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test
and fix the test problem, which is that testRestoreDataStreamAliasWithConflictingDataStream()
test needs to remove the composable index template that it adds. The base test class
doesn't remove any composable index templates and this template interferes with the
testRestoreDataStreamAliasWithConflictingIndicesAlias() test.

Relates to #81040
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Nov 30, 2021
* upstream/master:
  [ML] Parent datafeed actions to the datafeed's persistent task (elastic#81143)
  Simplify ConcreteIndices and its usage in TransportBulkAction (elastic#81098)
  Unmute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test (elastic#81142)
  TSDB: Do not allow index splits for time series indices (elastic#81125)
  Reduce verbosity-increase timeout to 3m (elastic#81118)
  Mute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test
  Fix stopping of old elasticsearch cluster (elastic#81059)
  Fix data stream alias validation. (elastic#81040)
  Add replicated field to get data stream api response. (elastic#80988)
@danhermann danhermann added v7.16.0 and removed v7.16.1 labels Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team v7.16.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snapshot restore requests allow you to restore data stream alias with conflicting name
4 participants