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

Flag data stream as "needs a new index" to handle mappings updates where no documents are indexed #89346

Closed
dakrone opened this issue Aug 15, 2022 · 2 comments
Assignees
Labels
:Data Management/Data streams Data streams and their lifecycles >enhancement Team:Data Management Meta label for data/management team

Comments

@dakrone
Copy link
Member

dakrone commented Aug 15, 2022

Description

Currently when fleet makes a mapping change (for example, a package being updated) that is linked to a set of data streams, it tries to apply the mapping update to the data stream's backing indices. If the mapping update can be made, then everything is great. If the mapping change cannot be made (a non-additive change) then the mappings are updated in the template and a new rollover is forced for the data stream, to make the mappings take effect on a newly created index immediately.

This, however, can lead to many empty indices, because the data stream linked to an integration may not actually be receiving any data. If the package were upgraded 3-4 times, it could result in 3-4 empty indices for the data stream. Since the data stream is manually rolled over (an unconditional rollover request), the work for #86203 won't help, because we will not know that the data stream is not receiving any data.

One idea for fixing this would be to introduce a flag for the data stream that indicated "roll over the data stream the very next time you receive a document." This would allow fleet to update the mappings as many times as necessary without creating any new empty indices. In the event that the data stream never receives a document, then there will still be no empty indices. If the data stream is being used, then a manual rollover will still not be necessary, as the next document after updating this flag would cause the data stream to roll over.

@dakrone dakrone added >enhancement :Data Management/Data streams Data streams and their lifecycles labels Aug 15, 2022
@dakrone dakrone changed the title Flag data stream as "needs a new index" to handle mappings updates where no indexed data Flag data stream as "needs a new index" to handle mappings updates where no documents are indexed Aug 15, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Aug 15, 2022
@elasticsearchmachine
Copy link
Collaborator

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

@gmarouli
Copy link
Contributor

Fixed by #103309

axw added a commit to axw/elasticsearch that referenced this issue Jan 22, 2024
Apply automatic rollovers lazily, upon the next write,
to avoid unnecessary empty backing indices.
See elastic#89346
elasticsearchmachine pushed a commit that referenced this issue Jan 23, 2024
Apply automatic rollovers lazily, upon the next write, to avoid
unnecessary empty backing indices.

See #89346

Fixes #104083
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 >enhancement Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

3 participants