Add explicit generation member to data streams#55342
Add explicit generation member to data streams#55342danhermann merged 4 commits intoelastic:masterfrom
Conversation
…Y backing index naming logic
|
Pinging @elastic/es-core-features (:Core/Features/Data streams) |
server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java
Outdated
Show resolved
Hide resolved
henningandersen
left a comment
There was a problem hiding this comment.
I added a comment, I think the list of indices in the stream should have a defined order, making the write index always the last one?
| @@ -1384,7 +1384,7 @@ private SortedMap<String, IndexAbstraction> buildIndicesLookup() { | |||
|
|
|||
| IndexMetadata writeIndex = backingIndices.get(backingIndices.size() - 1); | |||
There was a problem hiding this comment.
I wonder if we should simply keep this (and the IndexAbstraction.DataStream constructor) as it was, except to add an assertion that the generation we have should match the name of the last index in the list. I think we want that to hold true anyway?
There was a problem hiding this comment.
I agree that the backing index list should have a defined order and that we can simplify the validation that the generation matches the last name in the list.
If you're also suggesting that we keep the separate writeIndex parameter on the IndexAbstraction.DataStream constructor, I don't see why that would continue to be necessary since the value for the writeIndex parameter would always be backingIndices.get(backingIndices.size() - 1)?
There was a problem hiding this comment.
Ah yes, you are right, we do not need to keep that.
|
@elasticmachine run elasticsearch-ci/1 |
Adds an explicit
generationattribute to data streams. The current write index is derived from the generation and the data stream validates that it contains a backing index corresponding to its generation.Also DRYs up the logic for naming backing indices for data streams.
Related to #53100