Skip to content

Conversation

@danhermann
Copy link
Contributor

@danhermann danhermann commented Mar 26, 2021

If a naming conflict for a new write index is detected when a data stream rolls over, it will now increment its own generation until the new write index's name does not conflict with any other indices, aliases, or data streams. This allows us to remove the trappy validation around name conflicts for the backing indices of data streams.

Fixes #70905.

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

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

@danhermann danhermann requested a review from martijnvg March 26, 2021 21:15
@danhermann
Copy link
Contributor Author

@martijnvg, the main part of this change is in the first commit. The second commit moves DataStreamTestHelper to the same package as DataStream to facilitate testing so it makes a bunch of simple changes to import statements in lots of different test classes. The last three commits add or fix tests or remove obsolete tests.

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

long currentTimeMillis = timeProvider.getAsLong();
do {
newWriteIndexName = DataStream.getDefaultBackingIndexName(getName(), ++generation, currentTimeMillis);
} while (clusterMetadata.getIndicesLookup().containsKey(newWriteIndexName));
Copy link
Member

Choose a reason for hiding this comment

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

👍 simple and nicely encapsulated in this method

@danhermann danhermann merged commit 2c6ba92 into elastic:master Mar 29, 2021
@danhermann danhermann deleted the 70905_improve_data_stream_rollover branch March 29, 2021 12:36
@danhermann
Copy link
Contributor Author

Thanks, @martijnvg!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the data stream rollover more flexible

4 participants