[pull] main from containerd:main - #444
Merged
Merged
Conversation
The cache used to serve a hit by committing the layer during Prepare and returning ErrAlreadyExists, which is incompatible with parallel unpacking: the "rebase" capability defers the parent to Commit time, so a commit-at-Prepare layer ends up parentless. The erofs snapshotter therefore had to disable rebase whenever the cache was enabled, making every cache *miss* fall back to a fully sequential (slower-than-cold) pull. Introduce snapshots.ErrAlreadyStaged, returned from Prepare to mean "the active snapshot's content is staged; skip the layer download and apply, but still Commit it" (where the parent is applied). Unlike ErrAlreadyExists it does not end the layer's lifecycle. The unpacker handles it by emitting a status whose bottom half runs the normal serialized commit (rebasing the parent in), and the metadata snapshotter threads it through Prepare like a normal active snapshot. The erofs cache hit now stages the blob and returns ErrAlreadyStaged instead of committing, so it can advertise "rebase" unconditionally: hits skip download+conversion and misses stay parallel. Also promote the "rebase" capability string to snapshots.RebaseCap (shared by the unpacker, erofs, and overlay). Follow up: fetch is range-based, so only a fully cached contiguous prefix skips downloads; a miss in a lower layer still pulls everything above it. Per-layer fetch-skip is left as a follow-up. Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Replace the snapshots.ErrAlreadyStaged sentinel error with a read-only-mounts signal: a snapshotter (e.g. erofs serving a layer content cache hit) now returns Prepare mounts normally, with no error, when the layer content is already staged into the active snapshot. The unpacker's isStaged helper checks the last mount's ReadOnly() to decide whether to skip fetch+apply and just commit. Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
erofs: enable parallel unpack with content cache
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )