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: use lease to manage local cache for gc #155

Closed
wants to merge 3 commits into from

Conversation

Desiki-high
Copy link
Collaborator

@Desiki-high Desiki-high commented Jul 2, 2023

Now acceld's GarbageCollect will clear all caches when content size is over the threshold. We should use the lease to choose which content blob should be reserved. The updatedAt can help us choose.

Changes:

  • Move the updatedAt to lease bucket (labels).
  • Update updatedAt when pushing blob.
  • Rewrite GC by lease. When the local cache size over threshold, gc will delte local blobs until size less than threshold which order by updatedAt.

Reference: #141.

@Desiki-high Desiki-high force-pushed the feat-lm branch 2 times, most recently from 1403831 to 2a58d93 Compare July 3, 2023 10:49
Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
We can use leaseManager to keep the content blob cache. LeaseManager will
create lease of eache content blob in fetch and push.We will update the
time of each blob used time in lease. Save in labels.

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
GC will delete content blobs until local cache size less than
threshold. GC prioritizes the removal of recently unused blob.

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
@Desiki-high Desiki-high changed the title [WIP]feat: use leases to manage local cache for gc feat: use lease to manage local cache for gc Jul 4, 2023
@Desiki-high Desiki-high closed this Jul 5, 2023
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.

1 participant