Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add back gc protect callback#94

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Frando wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromFrando/gc-protect
Draft

Conversation

Frando
Copy link
Member

@FrandoFrando commentedJul 2, 2025
edited
Loading

Description

This adds back a way to externally protect blobs from garbage collection. It works like it did in blobs1: Users can provide an (async) callback to which a&mut HashSet<Hash> is passed. The callback is invoked before each gc run, and all hashes added to the set will be protected from gc during this run.

Used inn0-computer/iroh-docs#47

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following thestyle guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJul 2, 2025
edited
Loading

Documentation for this PR has been generated and is available at:https://n0-computer.github.io/iroh-blobs/pr/94/docs/iroh_blobs/

Last updated: 2025-07-14T11:48:38Z

@n0botn0botbot added this toirohJul 2, 2025
@github-project-automationgithub-project-automationbot moved this to🏗 In progress inirohJul 2, 2025
@FrandoFrandoforce-pushed theFrando/gc-protect branch 2 times, most recently from45a02c9 to87cb4f6CompareJuly 3, 2025 08:58
@FrandoFrando changed the base branch frommain toFrando/fix-deletionJuly 3, 2025 08:58
@FrandoFrandoforce-pushed theFrando/gc-protect branch 2 times, most recently fromfc473f5 toefa928eCompareJuly 3, 2025 10:59
@rklaehn
Copy link
Collaborator

I don't really like add_protected, but I also don't have a better solution right now. Maybe we add it and then strongly discourage using it or mark it as unstable somehow?

Base automatically changed fromFrando/fix-deletion tomainJuly 8, 2025 07:18
@rklaehn
Copy link
Collaborator

After thinking about this a bit, the best thing to do in the long term would be for docs to store small blobs inline and just bypass blobs entirely, then just use blobs forlarge blobs. The downside is of course that the small blobs stored in docs won't be available via the blobs API, but I think that is quite reasonable.

For large blobs, docs would then use the normal mechanisms (tags and temp tags) to keep the blobs alive, and the overhead would be acceptable because this would be only for a small subset of blobs.

@Frando
Copy link
MemberAuthor

Frando commentedJul 14, 2025
edited
Loading

Can you explain a bit why you don't like the idea of externally protecting blobs from gc long-term? To me it still looks appealing - it solves the iroh-docs usecase in a rather straightforward way, and I can see other crates building on blobs having use for this as well. If you have external datastructures that maintain their own garbage collection (like docs) it seems elegant to not have to maintain tags as well.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
Status: 🏗 In progress
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Frando@rklaehn

[8]ページ先頭

©2009-2025 Movatter.jp