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

LTS : Implement more efficient space reclamation after truncation. #4912

Closed
sachin-j-joshi opened this issue Jun 30, 2020 · 0 comments · Fixed by #6421
Closed

LTS : Implement more efficient space reclamation after truncation. #4912

sachin-j-joshi opened this issue Jun 30, 2020 · 0 comments · Fixed by #6421
Assignees
Labels
area/lts kind/enhancement Improvements that should be made version/0.1.1

Comments

@sachin-j-joshi
Copy link
Contributor

Problem description
Currently the truncation is implemented at the granularity of chunks. Only the chunks that are completely below truncate offset are are removed. For the chunks that are partially contain valid data (i.e truncate offset in the middle of chunk) such chunks are not deleted. The head portion of the chunk is still occupying storage.

This is a problem if the chunks end up being really big.
In this case we will not actually reclaim any space at all.

Problem location
ChunkedSegmentStorage::truncate

Suggestions for an improvement

One obvious solution is to create a small chunk, copy valid portion of old chunk to it and then delete the old chunk.
However we need to be careful not to unnecessarily move data again and again. Table and attribute segments are often appended to and truncated at front - moving data in such cases every time we truncate will result in poor performance.
Ideal the space reclamation is done as background job.
Develop and implement some basic heuristics to trigger (or not trigger ) such background on specific segments.

@sachin-j-joshi sachin-j-joshi self-assigned this Jun 30, 2020
@sachin-j-joshi sachin-j-joshi changed the title PDP-34 Simplified-LTS : Implement more efficient space reclamation after truncation. LTS : Implement more efficient space reclamation after truncation. Nov 10, 2021
@sachin-j-joshi sachin-j-joshi added version/0.1.1 kind/enhancement Improvements that should be made labels Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lts kind/enhancement Improvements that should be made version/0.1.1
Projects
None yet
1 participant