-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[extension/storage/filestorage] Add CleanupOnStart flag for compaction temporary files #32863
Conversation
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor nit, but use errors.Join once
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Each extension instance can create multiple clients. Moving the logic to extension start is better aligned with the extension lifecycle and prevent potential collisions, all clients will share the same compaction folder already cleaned up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some lint issues to address. You can run many of the checks locally with make -C extension/storage/filestorage
Description:
This PR includes a new flag cleanup_on_start for the compaction section.
During compaction a copy of the database is created, when the process is unexpectedly terminated that temporary file is not removed. That could lead to disk exhaustion given the following scenario:
This mitigates the potential risk of those temporary files left in a short period of time, by this scenario or similar ones.
Testing:
Included corner case where two instances of the extensions are spawned and one is compacting while the other would attempt to cleanup.
Documentation:
Included description in the README of the new configuration flag