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: Improve refs garbage collection for redis Redis using TTL #983

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

xNok
Copy link
Contributor

@xNok xNok commented Jan 21, 2025

We had many issues with Redis growing in size due to garbage collection not covering all the corner cases. Scanning all the repositories is not sustainable, and thus, using the webhook system seemed much more sustainable. So, a while ago, I decided to improve garbage collection by making sure all refs had a TTL so they would eventually be garbage collected.

I initially didn't open a pull request since Redis 7.4 now supports the TTL index on HSet. When I implemented this feature, I thought it would soon be obsolete. However, all things considered, it might still be relevant, so here it is.

Essentially, for each type (Project, Ref, and Metrics), we add a key with a TTL. When running the garbage collection job, if this key is no longer present, we delete the related element from the HSET.

@coveralls
Copy link

Coverage Status

coverage: 64.413% (-0.8%) from 65.207%
when pulling 41e5d46 on ESLFACEITGROUP:improve-refs-garbage-collection
into 088f5f9 on mvisonneau:main.

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