Skip to content

fix(v2): compaction-worker temp directory cleanup #3847

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

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Jan 16, 2025

Currently, compaction-worker does not cleanup the directory it uses for "staging" (kind of temp).

Typically, this is not a problem, because the intermediate data is deleted during the compaction process. However, the disk space (including ephemeral volumes) might be exhausted in case if the compactor fails to finish the compaction.

Comment on lines +376 to +380
defer func() {
if err = os.RemoveAll(tempdir); err != nil {
level.Warn(logger).Log("msg", "failed to remove compaction directory", "path", tempdir, "err", err)
}
}()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Although the content is removed, the job directory isn't

@kolesnikovae kolesnikovae marked this pull request as ready for review January 16, 2025 07:50
@kolesnikovae kolesnikovae requested a review from a team as a code owner January 16, 2025 07:50
@kolesnikovae kolesnikovae merged commit 2d0cf87 into main Jan 16, 2025
19 checks passed
@kolesnikovae kolesnikovae deleted the fix/compaction-worker-temp-dir branch January 16, 2025 07:57
shelldandy pushed a commit to shelldandy/pyroscope that referenced this pull request Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants