Skip to content

erofs-differ: implement fast differ with DiffDirChanges()#11603

Merged
fuweid merged 1 commit into
containerd:mainfrom
erofs:erofs-snapshotter
Apr 19, 2025
Merged

erofs-differ: implement fast differ with DiffDirChanges()#11603
fuweid merged 1 commit into
containerd:mainfrom
erofs:erofs-snapshotter

Conversation

@hsiangkao
Copy link
Copy Markdown
Member

@hsiangkao hsiangkao commented Mar 25, 2025

Unlike the walking differ, which implements a generic method to accommodate all kinds of snapshotters, the EROFS differ is just implemented for EROFS and EROFS snapshotter so it can utilize the recent DiffDirChanges() to avoid traversing the entire rootfs directory in order to improve nerdctl commit performance.

Additionally, I think baseDir is unnecessary too (in principle, only upperdir is useful for OCI format convention). However, addressing this requires more work, so left as is for now.

It's also useful to implement a customized Compare() method for EROFS differ so that we can dump the native EROFS-formatted blob to the content store later.

@hsiangkao
Copy link
Copy Markdown
Member Author

Comment thread plugins/diff/erofs/differ_linux.go
Comment thread plugins/diff/erofs/differ_linux.go Outdated
Comment thread plugins/diff/erofs/differ_linux.go Outdated
Comment thread plugins/diff/erofs/differ_linux.go
Copy link
Copy Markdown
Member

@djdongjin djdongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsiangkao
Copy link
Copy Markdown
Member Author

ping... could folks take a look of this? @dmcgowan @fuweid @AkihiroSuda
many thanks!

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Apr 18, 2025
@AkihiroSuda AkihiroSuda added this pull request to the merge queue Apr 18, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 18, 2025
Comment thread plugins/diff/erofs/differ_linux.go Outdated
return emptyDesc, fmt.Errorf("erofsDiff does not implement Compare method: %w", errdefs.ErrNotImplemented)
layer, err := erofsutils.MountsToLayer(upper)
if err != nil {
return emptyDesc, fmt.Errorf("unsupported layer for erofsDiff Compare method: %w", errdefs.ErrNotImplemented)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MountsToLayer already returns a wrapped ErrNotImplemented with a more specific message

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks derek. let me fix it now since it doesn't merge for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@dmcgowan dmcgowan added this pull request to the merge queue Apr 18, 2025
@dmcgowan dmcgowan added this to the 2.1 milestone Apr 18, 2025
@dmcgowan dmcgowan moved this from Review In Progress to Merge on Green in Pull Request Review Apr 18, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 19, 2025
Unlike the walking differ, which implements a generic method to
accommodate all kinds of snapshotters, the EROFS differ is just
implemented for EROFS and EROFS snapshotter so it can utilize the
recent DiffDirChanges() [1] to avoid traversing the entire rootfs
directory in order to improve `nerdctl commit` performance.

Additionally, I think `baseDir` is unnecessary too (in principle,
only `upperdir` is useful for OCI format convention).  However,
addressing this requires more work, so left as is for now.

It's also useful to implement a customized Compare() method for
EROFS differ so that we can dump the native EROFS-formatted blob
to the content store later.

[1] containerd/continuity#145
Signed-off-by: Gao Xiang <xiang@kernel.org>
@github-project-automation github-project-automation Bot moved this from Merge on Green to Review In Progress in Pull Request Review Apr 19, 2025
@fuweid fuweid added this pull request to the merge queue Apr 19, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 19, 2025
@fuweid fuweid added this pull request to the merge queue Apr 19, 2025
Merged via the queue into containerd:main with commit 4a51d8c Apr 19, 2025
58 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Apr 19, 2025
@hsiangkao hsiangkao deleted the erofs-snapshotter branch April 22, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants