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

feat: built-in periodic gc #87

Merged
merged 7 commits into from
Feb 19, 2024
Merged

feat: built-in periodic gc #87

merged 7 commits into from
Feb 19, 2024

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Feb 13, 2024

Closes #65.

DEPENDS ON ipfs/boxo#579

Matches (I think) the behaviour of our current script: https://github.com/ipshipyard/waterworks-infra/blob/master/ansible/roles/rainbow/files/rainbow-gc.sh

Every hour, calls GC if less than 30% of the disk space is available.

Only works on Unix based systems.

@hacdias hacdias requested review from lidel and aschmahmann February 13, 2024 13:37
@hacdias hacdias self-assigned this Feb 13, 2024
@hacdias hacdias force-pushed the gc branch 2 times, most recently from 2d434bb to 05330a8 Compare February 13, 2024 16:28
gc_windows.go Outdated Show resolved Hide resolved
gc_run.go Outdated Show resolved Hide resolved
Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

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

Generally LGTM, found a small bug and it seems like we can probably abstract over some of the OS layer specifics.

Adding tests here seems annoying, but wonder if we should have a basic one. For example set the GC interval to 1s and free 100% and make sure the data gets GC'd from the blockstore layer (nothing we can really do about the DB layer if that GC happens separately).

gc_run.go Outdated Show resolved Hide resolved
@hacdias
Copy link
Member Author

hacdias commented Feb 15, 2024

@aschmahmann I refactored with the package you mentioned for cross-os compatibility.

I also added a test, but it is far from what I would want. We need a way to actually start an isolated rainbow instance with all configurations. That's tracked in #89.

@hacdias hacdias requested a review from aschmahmann February 15, 2024 07:14
the server handler registers global prometheus stuff. if we do that twice,
panics. we have to figure out how to do this without globally setting prometheus
@hacdias
Copy link
Member Author

hacdias commented Feb 15, 2024

@aschmahmann can you also take a look at ipfs/boxo#579? There was a race condition in the tests that that PR fixes.

Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

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

LGTM aside from the one change

docs/environment-variables.md Outdated Show resolved Hide resolved
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

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

LGTM (once the other PR is merged)

@hacdias hacdias enabled auto-merge (squash) February 19, 2024 10:17
@hacdias hacdias merged commit d7b8111 into main Feb 19, 2024
10 checks passed
@hacdias hacdias deleted the gc branch February 19, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Built-in GC configuration to run periodically
2 participants