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

API for adding and removing indices from a data stream #79279

Merged
merged 15 commits into from
Oct 19, 2021

Conversation

danhermann
Copy link
Contributor

@danhermann danhermann commented Oct 15, 2021

This PR includes just the REST endpoint. The service itself was added in previous PRs linked to #75852.

Closes #75852

@danhermann danhermann changed the title REST endpoint for data stream modification service API for adding and removing indices from a data stream Oct 15, 2021
@sethmlarson sethmlarson added the Team:Clients Meta label for clients team label Oct 15, 2021
@danhermann danhermann requested a review from dakrone October 15, 2021 18:03
@danhermann
Copy link
Contributor Author

Pinging @elastic/kibana-stack-management since this is a new API

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Generally looks good to me! I left a couple of comments but nothing major (I know it's still a draft PR also)

Comment on lines +64 to +65
private String dataStream;
private String index;
Copy link
Member

Choose a reason for hiding this comment

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

Since this is not really big enough to be a builder class, I think we should make these final (it's not too hard for a user to pass them in the constructor)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally had all the members as final but I believe they have to be mutable so the parser is able to construct them here.

@danhermann danhermann marked this pull request as ready for review October 15, 2021 21:42
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/clients-team (Team:Clients)

@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Okay I took another look at this, I left a few comments, hopefully nothing too major.

I was also wondering about documentation, are we planning on doing that in a follow-up PR?

@danhermann
Copy link
Contributor Author

I was also wondering about documentation, are we planning on doing that in a follow-up PR?

Yes, I'll write up the docs in a follow-up PR.

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Member

@dakrone dakrone 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 one really minor comment that doesn't need another review after addressing.

Out of curiosity, do you think we should (in future work, not time-constrained) support changing which index is the write index of a data stream the same way that we support it for aliases? Does that even make sense for a data stream?

import java.util.ArrayList;
import java.util.List;

public class ModifyDataStreamsRequestTests extends AbstractWireSerializingTestCase<Request> {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an override to mutateInstance for this class also so that it runs the full mutation tests?

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

LGTM, I left one really minor comment that doesn't need another review after addressing.

Thanks, @dakrone!

Out of curiosity, do you think we should (in future work, not time-constrained) support changing which index is the write index of a data stream the same way that we support it for aliases? Does that even make sense for a data stream?

There may be some edge cases in which changing the write index could be useful. Generally speaking, I think it's something that's better avoided since data stream backing indices, under normal usage, will accumulate sequential data in mostly non-overlapping time intervals which facilitates fast retrieval. Allowing arbitrary replacement of the write index could weaken that. It's probably worth a discussion about if we could allow it for the cases where it might be useful without weakening some of the core benefits of data streams.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Some comments on the API specification:

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

LGTM

@danhermann
Copy link
Contributor Author

@sethmlarson, thanks for catching the errors in the API spec!

@danhermann danhermann merged commit 2e05e3e into elastic:master Oct 19, 2021
@danhermann danhermann deleted the 75852_rest_endpoint branch October 19, 2021 13:21
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Oct 19, 2021
* upstream/master:
  Validate tsdb's routing_path (elastic#79384)
  Adjust the BWC version for the return200ForClusterHealthTimeout field (elastic#79436)
  API for adding and removing indices from a data stream (elastic#79279)
  Exposing the ability to log deprecated settings at non-critical level (elastic#79107)
  Convert operator privilege license object to LicensedFeature (elastic#79407)
  Mute SnapshotBasedIndexRecoveryIT testSeqNoBasedRecoveryIsUsedAfterPrimaryFailOver (elastic#79456)
  Create cache files with CREATE_NEW & SPARSE options (elastic#79371)
  Revert "[ML] Use a new annotations index for future annotations (elastic#79151)"
  [ML] Use a new annotations index for future annotations (elastic#79151)
  [ML] Removing legacy code from ML/transform auditor (elastic#79434)
  Fix rate agg with custom `_doc_count` (elastic#79346)
  Optimize SLM Policy Queries (elastic#79341)
  Fix execution of exists query within nested queries on field with doc_values disabled (elastic#78841)
  Stricter UpdateSettingsRequest parsing on the REST layer (elastic#79227)
  Do not release snapshot file download permit during recovery retries (elastic#79409)
  Preserve request headers in a mixed version cluster (elastic#79412)
  Adjust versions after elastic#79044 backport to 7.x (elastic#79424)
  Mute BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests (elastic#79429)
  Fail on SSPL licensed x-pack sources (elastic#79348)

# Conflicts:
#	server/src/test/java/org/elasticsearch/index/TimeSeriesModeTests.java
danhermann added a commit to danhermann/elasticsearch that referenced this pull request Oct 19, 2021
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 >feature Team:Clients Meta label for clients team Team:Data Management Meta label for data/management team v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an API for adding and removing indices from a data stream
5 participants