Update blockbuilder to periodically flush wals and sort traces#4550
Merged
mdisibio merged 6 commits intografana:mainfrom Jan 15, 2025
Merged
Update blockbuilder to periodically flush wals and sort traces#4550mdisibio merged 6 commits intografana:mainfrom
mdisibio merged 6 commits intografana:mainfrom
Conversation
…dress performance bottleneck in block completion time. Also add benchmark, and disk cleanup fixes
mapno
reviewed
Jan 14, 2025
mapno
approved these changes
Jan 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Block builder flush performance contained an accidental regression that make it a lot slower than generators and ingesters at flushing blocks. It created the WAL blocks unordered, which meant that a lot of random seeking around the files was required in order to iterator the traces in order by ID and copy them to the final backend block. And it didn't periodically flush the WAL blocks, instead it was one huge flush at the end. Now it works exactly like generators and ingesters, in that it periodically flushes idle traces, and each flush is sorted by ID. Then there is no file seeking required when it completes the WAL to the final backend block. This gives about 10x speed improvement.
Additional changes:
TODO
Now that we are using liveTraces, we can now easily honor tenant max trace size too.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]