Skip to content

Conversation

@martijnvg
Copy link
Member

This allows indexing documents into a data stream alias.
The ingestion is that forwarded to the write index of the data stream
that is marked as write data stream.
The is_write_index parameter can be used to indicate what the write data stream is,
when updating / adding a data steam alias.

Relates to #66163

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label May 27, 2021
@elasticmachine
Copy link
Collaborator

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

@martijnvg martijnvg added the WIP label May 27, 2021
@martijnvg martijnvg force-pushed the data_stream_aliases_write_flag branch from 0e6946b to da18f13 Compare May 27, 2021 11:26
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. I left a couple questions below, but none are blocking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this apply also to aliases that point to a single data stream?

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case write get forwarded to the write data stream's write index.

Comment on lines 472 to 477
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not especially familiar with the snapshot/restore code, but does this work if some of the alias's data streams are present in intersectingDataStreams but the alias's write data stream is not? Also, it looks like it would drop data streams from the alias if they were already present in the cluster but not part of the restore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that is right. I need to fix that (and add a test for it). I wasn't completely finished with this pr yet (meant to open this as a draft pr, but forgot to select it as such).

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, it looks like it would drop data streams from the alias if they were already present in the cluster but not part of the restore?

This code just selects the data streams with aliases from the snapshot to restore. As part of the RestoreSnapshotStateTask this is merged with the cluster state the snapshot is restored into (see applyDataStreamRestores() method).

martijnvg added 7 commits May 31, 2021 11:08
This allows indexing documents into a data stream alias.
The ingestion is that forwarded to the write index of the data stream
that is marked as write data stream.
The `is_write_index` parameter can be used to indicate what the write data stream is,
when updating / adding a data steam alias.

Relates to elastic#66163
@martijnvg martijnvg force-pushed the data_stream_aliases_write_flag branch from c914bd8 to a6531cb Compare May 31, 2021 10:10
@martijnvg martijnvg merged commit afc17bd into elastic:master May 31, 2021
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request May 31, 2021
Backport elastic#73462 7.x

This allows indexing documents into a data stream alias.
The ingestion is that forwarded to the write index of the data stream
that is marked as write data stream.
The `is_write_index` parameter can be used to indicate what the write data stream is,
when updating / adding a data steam alias.

Relates to elastic#66163
martijnvg added a commit that referenced this pull request Jun 1, 2021
Backporting  #73462 to 7.x branch.

This allows indexing documents into a data stream alias.
The ingestion is that forwarded to the write index of the data stream
that is marked as write data stream.
The `is_write_index` parameter can be used to indicate what the write data stream is,
when updating / adding a data steam alias.

Relates to #66163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v7.14.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants