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

Reindex support for TSDB creating indices #86704

Merged
merged 2 commits into from
May 12, 2022

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented May 11, 2022

This teaches reindex to infer if the destination index is a tsdb index
if it doesn't yet exist. It looks at the templates that apply to the
index and checks what settings they use. So you should be able to
reindex into a non-existant index and automatically get the tsdb
support.

@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 11, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

This teaches reindex to infer if the destination index is a tsdb index
if it doesn't yet exist. It looks at the templates that apply to the
index and checks what settings they use. So you should be able to
reindex into a non-existant index and automatically get the tsdb
support.
@sethmlarson sethmlarson added the Team:Clients Meta label for clients team label May 11, 2022
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@@ -53,6 +70,16 @@ private ClusterState stateWithIndex(Settings.Builder settings) {
return ClusterState.builder(ClusterState.EMPTY_STATE).metadata(Metadata.builder(Metadata.EMPTY_METADATA).put(meta)).build();
}

private Settings.Builder standardSettings() {
return Settings.builder().put(IndexSettings.MODE.getKey(), IndexMode.STANDARD);
Copy link
Member

Choose a reason for hiding this comment

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

maybe randomly return an empty setting? Since standard is the default.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

public void testMissingIndexWithTsdbTemplateClearsId() throws Exception {
Metadata.Builder metadata = Metadata.builder();
metadata.put("c", new ComponentTemplate(new Template(tsdbSettings().build(), null, null), null, null));
metadata.put("c", new ComposableIndexTemplate(List.of("dest_index"), null, List.of("c"), null, null, null));
Copy link
Member

Choose a reason for hiding this comment

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

maybe randomly add the settings to component or composable index template?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@nik9000 nik9000 added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label May 12, 2022
@elasticsearchmachine elasticsearchmachine merged commit 852bfb7 into elastic:master May 12, 2022
@nik9000 nik9000 deleted the tsdb_reindex3 branch May 12, 2022 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Clients Meta label for clients team v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants