You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❌ Patch coverage is 88.88889% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.34%. Comparing base (821a512) to head (374d66d).
Hi @rohanphadnis-thunder, can we directly use the underlying_files field from GET /api/v1/daemon? The blob reference counting should be handled by the upper-level manager, such as the nydus-snapshotter, which can call APIs of all managed nydusds to calculate the blob reference counts.
Hi, Thanks for the PR.
The ref_count exposed by this API is inaccurate for non-singleton modes.
Currently, BlobCacheMgr is shared across all bootstraps only in singleton mode (fscache). In this mode, the ref_count correctly reflects how many bootstraps reference a data blob within that single nydusd process.
However, in fusedev/virtiofs mode, each container/image gets its own nydusd process, and each process has its own isolated BlobCacheMgr. The API returns ref_count from DAEMON_CONTROLLER.get_blob_cache_mgr(), which only sees bootstraps managed by that specific daemon process.
This means:
Singleton mode: ref_count = all references within this nydusd ✓
Fusedev mode: ref_count = only references from this container's bootstrap ✗
For accurate GC at the system level, the upper layer (e.g., nydus-snapshotter) would need to aggregate ref_counts across all nydusd instances, which this API doesn't support.
So. I agree with Imeoer. Using the underlying_files field from GET /api/v1/daemon is a good idea.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the
GET /api/v2/blobs?domain_id=X&blob_id=YAPI call innydusd.The goal of this PR is to access the ref counters, allowing for safe garbage collection in the blobcache.
Related Issues
No related issues but this method was marked as a
todo!().Change Details
We define
BlobCacheInfoEntryandBlobCacheInfoListstructs. We implement a method handler and expose it to thenyduysdapi.Test Results
N/A
Change Type
Self-Checklist