Skip to content

Generate random rollup index names for RollupILMAction#69237

Merged
talevy merged 7 commits intoelastic:masterfrom
talevy:rollup-random
Feb 24, 2021
Merged

Generate random rollup index names for RollupILMAction#69237
talevy merged 7 commits intoelastic:masterfrom
talevy:rollup-random

Conversation

@talevy
Copy link
Copy Markdown
Contributor

@talevy talevy commented Feb 18, 2021

This commit moves away from the static rollup-{indexName} rollup index
naming strategy and moves towards a randomized rollup index name scheme.

This will reduce the complications that exist if the RollupStep fails and retries
in any way. A separate cleanup will still be required for failed temporary indices,
but at least there will not be a conflict.

This commit generates the new rollup index name in the LifecycleExecutionState so
that it can be used in RollupStep and UpdateRollupIndexPolicyStep on a per-index
basis.

This commit moves away from the static `rollup-{indexName}` rollup index
naming strategy and moves towards a randomized rollup index name scheme.

This will reduce the complications that exist if the RollupStep fails and retries
in any way. A separate cleanup will still be required for failed temporary indices,
but at least there will not be a conflict.

This commit generates the new rollup index name in the LifecycleExecutionState so
that it can be used in RollupStep and UpdateRollupIndexPolicyStep on a per-index
basis.
@talevy talevy added >non-issue :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data v8.0.0 Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.13.0 labels Feb 18, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@talevy talevy added the :Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. label Feb 18, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Feb 18, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@talevy talevy requested a review from csoulios February 19, 2021 15:45
Copy link
Copy Markdown
Contributor

@csoulios csoulios left a comment

Choose a reason for hiding this comment

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

Overall, PR looks good. I have only left a comment about index naming in data streams.

The convention is that data stream indices are prefixed with a . and I don't see why we should not follow it.


// TODO(talevy): find alternative to lowercasing UUID? kind of defeats the expectation of the UUID here. index names must lowercase
public static String generateRollupIndexName(String indexName) {
return "rollup-" + indexName + "-" + UUIDs.randomBase64UUID().toLowerCase(Locale.ROOT);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder what should happen if index is a member of a data stream. If the name of the index is .ds-index-2022-01-01-000001, rollup index would be rollup-.ds-index-2022-01-01-000001-<random uuid>.

Is this the expected behavior or would we expect the rollup index to be named .rollup-ds-index-2022-01-01-000001-<random uuid> and keep the . prefix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, this is a strange departure. I believe Shrink Action in ILM did not use the . syntax because ILM operates more generally on indices, not data streams. So shrunk- as a prefix made sense. For consistency (#65633 (comment)) with both Searchable Snapshot and Shrink, this rollup- prefix was chosen.

If we wish to change this depending on whether ILM is operating on a datastream or not, I think we can bring this up for discussion with the ILM team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd like to continue this conversation outside of this PR if you think that is reasonable.

It may make sense to update all the actions to follow this pattern.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is part of a bigger discussion (outside of this PR), we can handle it on the core/features team and we can update this if/when we have a decision on how to treat these

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In this case, I am fine with moving on with this naming now. Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thank you everyone!

@talevy talevy merged commit c1c5103 into elastic:master Feb 24, 2021
@talevy talevy deleted the rollup-random branch February 24, 2021 20:31
talevy added a commit to talevy/elasticsearch that referenced this pull request Feb 24, 2021
This commit moves away from the static `rollup-{indexName}` rollup index
naming strategy and moves towards a randomized rollup index name scheme.

This will reduce the complications that exist if the RollupStep fails and retries
in any way. A separate cleanup will still be required for failed temporary indices,
but at least there will not be a conflict.

This commit generates the new rollup index name in the LifecycleExecutionState so
that it can be used in RollupStep and UpdateRollupIndexPolicyStep on a per-index
basis.
talevy added a commit that referenced this pull request Feb 25, 2021
This commit moves away from the static `rollup-{indexName}` rollup index
naming strategy and moves towards a randomized rollup index name scheme.

This will reduce the complications that exist if the RollupStep fails and retries
in any way. A separate cleanup will still be required for failed temporary indices,
but at least there will not be a conflict.

This commit generates the new rollup index name in the LifecycleExecutionState so
that it can be used in RollupStep and UpdateRollupIndexPolicyStep on a per-index
basis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/ILM+SLM DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. >non-issue :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.13.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants