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

Tsdb/compaction #5783

Merged
merged 12 commits into from
Apr 7, 2022
Merged

Tsdb/compaction #5783

merged 12 commits into from
Apr 7, 2022

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Apr 6, 2022

This PR introduces a first pass at a TSDB compactor. It also standardizes the names of TSDB files to the format "index-${from}-${through}-${checksum}.tsdb". It combines multiple TSDB files and dedupes their contents where appropriate.

To do this, I've added a Checksum() uint32 method where appropriate (IndexReader and TSDBIndex).
For added performance, I also moved the []ChunkMetas pool into the underlying tsdb/index package although it's still exported and used by the tsdb package as well as the index package now.

ref #5428

@owen-d owen-d requested a review from a team as a code owner April 6, 2022 13:09
Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

just one minor suggestion but overall it looks great!

)
}

func (i Identifier) Combine(parentDir string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call it Filepath or BuildFilepath?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I like that better. Will fix.

@owen-d owen-d merged commit 0c826b8 into grafana:main Apr 7, 2022
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.

None yet

2 participants