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

[extension/filestorage] Online file storage compaction #9327

Merged

Conversation

pmm-sumo
Copy link
Contributor

@pmm-sumo pmm-sumo commented Apr 15, 2022

Description:

Adds online filestorage compaction

Link to tracking Issue: Addresses core/#5159

Testing: Benchmarks and several tests added. Also tested manually in several scenarios

Documentation: README.md updated

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 15, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: swiatekm-sumo / name: Mikołaj Świątek (9a32567897acce8c04418802d6eb744f95d9bf56)

@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch from 56ce702 to 9a32567 Compare April 15, 2022 16:51
@swiatekm
Copy link
Contributor

swiatekm commented Apr 16, 2022

I wonder if we shouldn't separate the changes adding the new compaction condition from changes to the interface. Before, client.Compact() was a destructive operation that returned a new client, now it operates on the client in-place. Making that a separate change would also let us fix the issue where compaction failing on start makes the client creation fail, whereas it could just continue as is.

extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
extension/storage/filestorage/client_test.go Show resolved Hide resolved
extension/storage/filestorage/extension.go Outdated Show resolved Hide resolved
Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

I did some integration testing of this PR. With changes proposed in this review, it worked perfectly fine in a standard k8s environment, pushing around 10k records per second through compactions as the persistent queue grew and drained.

extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 9, 2022
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this May 23, 2022
@overmeulen
Copy link

Hi, isn't this dev going to be merged ?
I was really looking forward to having this feature

@pmm-sumo pmm-sumo reopened this May 24, 2022
@pmm-sumo
Copy link
Contributor Author

@overmeulen sorry for the delay, I'm getting back to this right now

@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch 2 times, most recently from d7193a8 to b8a53ad Compare May 24, 2022 13:48
@pmm-sumo pmm-sumo removed the Stale label May 24, 2022
@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch from b8a53ad to 46e3556 Compare May 24, 2022 19:02
@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch 3 times, most recently from 0ae6a0e to b481e78 Compare June 2, 2022 15:11
@pmm-sumo pmm-sumo marked this pull request as ready for review June 2, 2022 17:18
@pmm-sumo pmm-sumo requested a review from a team June 2, 2022 17:18
@pmm-sumo pmm-sumo requested a review from djaglowski as a code owner June 2, 2022 17:18
extension/storage/filestorage/README.md Show resolved Hide resolved
extension/storage/filestorage/README.md Outdated Show resolved Hide resolved
extension/storage/filestorage/README.md Outdated Show resolved Hide resolved
Comment on lines 28 to 29
- `compaction.rebound_size_below_mib` (default: 10) - specifies the maximum size of actually allocated data for compaction to happen
- `compaction.rebound_total_size_above_mib` (default: 100) - specifies the minimum overall size of the allocated space (both actually used and free pages)
Copy link
Member

Choose a reason for hiding this comment

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

Were these terms, "total size above" and "size below", chosen for this extension, or are they established elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This are new terms. I spent some time to figure out names that would be a good match here and this is what I came up with eventually (e.g. using "rebound" for what happens here). If you have any other suggestions, those are always welcome :)

Copy link
Member

@djaglowski djaglowski Jun 7, 2022

Choose a reason for hiding this comment

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

I think "rebound" is a very intuitive term.

I found these two parameters to be a little less intuitive, but ultimately I think between the diagram and descriptions it becomes reasonably clear.

If I were to chose alternate terms, I might try to include the word "threshold", which I think would convey that something happens when the value is crossed. I also think it might be helpful to present these in a way that more directly reflects the statefulness of the system. Maybe something like:

  • compaction.rebound_needed_threshold_mib (default: 100) - when allocated data exceeds this amount, the "compaction needed" flag will be set
  • compaction.rebound_trigger_threshold_mib (default: 10) - if the "compaction needed" flag is set and allocated data drops below this amount, compaction will begin and the "compaction needed" flag will be cleared

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great advice, I like these suggestions a lot @djaglowski. What do you think @swiatekm-sumo? I am going to apply these

@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch 2 times, most recently from 28a80dc to 8500382 Compare June 7, 2022 18:36
@djaglowski
Copy link
Member

@pmm-sumo, looks good to me. Let me know if I should merge or wait for @swiatekm-sumo to weigh in

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

Some minor nits, looks good overall.

extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
extension/storage/filestorage/client.go Outdated Show resolved Hide resolved
extension/storage/filestorage/client_test.go Show resolved Hide resolved
@pmm-sumo pmm-sumo force-pushed the filestorage/online-compaction branch from ade6036 to 614d1cd Compare June 13, 2022 16:20
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.

5 participants