Skip to content

[snapshot] Add config option for volatile overlayfs#731

Merged
imeoer merged 1 commit intocontainerd:mainfrom
DataDog:fricounet/volatile-mount
Mar 30, 2026
Merged

[snapshot] Add config option for volatile overlayfs#731
imeoer merged 1 commit intocontainerd:mainfrom
DataDog:fricounet/volatile-mount

Conversation

@Fricounet
Copy link
Copy Markdown
Contributor

@Fricounet Fricounet commented Mar 27, 2026

Overview

Please briefly describe the changes your pull request makes.

The volatile option skips sync on the upper layer, improving write performance for ephemeral container filesystems. This is a safe trade-off for most workloads where the writable layer does not need to survive a crash.

Related Issues

Please link to the relevant issue. For example: Fix #123 or Related #456.

Fix #730

Change Details

Please describe your changes in detail:

Add enable_overlayfs_volatile to the snapshot config so operators can globally enable the volatile overlayfs mount option on all writable layers without needing to inject snapshot labels through the container runtime stack.

Test Results

If you have any relevant screenshots or videos that can help illustrate your changes, please add them here.

Ran a snapshotter locally with the config enabled. Logs show the volatile option being used:

INFO[2026-03-27T16:33:08.138128287+01:00] [Prepare] snapshot with key k8s.io/664/extract-133171389-mv-y sha256:0884a5af5eaa75aeac43834f038bdf6c95430a6ee93b16d0a9dd4386e9bc2284 parent sha256:017535d40dcc9bcc36c78ba40fc412702af059a36c797af5bcf93c21218e2fb6
DEBU[2026-03-27T16:33:08.142753509+01:00] [Prepare] snapshot with labels map[containerd.io/snapshot.ref:sha256:0884a5af5eaa75aeac43834f038bdf6c95430a6ee93b16d0a9dd4386e9bc2284 containerd.io/snapshot/cri.image-layers:sha256:0ef73f7db9025c936cd2d5cf5743e22a13635c744ee23a080b62af737aad1793 containerd.io/snapshot/cri.image-ref:localhost:5050/my-image:nydus containerd.io/snapshot/cri.layer-digest:sha256:0ef73f7db9025c936cd2d5cf5743e22a13635c744ee23a080b62af737aad1793 containerd.io/snapshot/cri.manifest-digest:sha256:3e44f63d8fb01e81fd81433146fef4eadb47b91d79587894bac78ef9ef1c8a78 containerd.io/snapshot/nydus-bootstrap:true containerd.io/snapshot/nydus-fs-version:6]  key="k8s.io/664/extract-133171389-mv-y sha256:0884a5af5eaa75aeac43834f038bdf6c95430a6ee93b16d0a9dd4386e9bc2284" parent="sha256:017535d40dcc9bcc36c78ba40fc412702af059a36c797af5bcf93c21218e2fb6"
DEBU[2026-03-27T16:33:08.142774523+01:00] found nydus meta layer                        key="k8s.io/664/extract-133171389-mv-y sha256:0884a5af5eaa75aeac43834f038bdf6c95430a6ee93b16d0a9dd4386e9bc2284" parent="sha256:017535d40dcc9bcc36c78ba40fc412702af059a36c797af5bcf93c21218e2fb6"
DEBU[2026-03-27T16:33:08.142794832+01:00] overlayfs mount options [workdir=/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/355/work upperdir=/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/355/fs volatile lowerdir=/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/354/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/353/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/352/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/351/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/350/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/349/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/348/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/347/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/346/fs:/containerd-local/io.containerd.snapshotter.v1.nydus/snapshots/345/fs]

Change Type

Please select the type of change your pull request relates to:

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

Before submitting a pull request, please ensure you have completed the following:

  • I have run a code style check and addressed any warnings/errors.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

Add `enable_overlayfs_volatile` to the snapshot config so operators
can globally enable the volatile overlayfs mount option on all
writable layers without needing to inject snapshot labels through
the container runtime stack.

The volatile option skips sync on the upper layer, improving write
performance for ephemeral container filesystems. This is a safe
trade-off for most workloads where the writable layer does not need
to survive a crash.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 7.69231% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.30%. Comparing base (fc330cc) to head (c9c4d81).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
snapshot/snapshot.go 7.69% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #731      +/-   ##
==========================================
+ Coverage   22.02%   24.30%   +2.27%     
==========================================
  Files         130      132       +2     
  Lines       11931    12234     +303     
==========================================
+ Hits         2628     2973     +345     
+ Misses       8960     8897      -63     
- Partials      343      364      +21     
Files with missing lines Coverage Δ
config/config.go 38.33% <ø> (ø)
snapshot/snapshot.go 5.47% <7.69%> (-0.03%) ⬇️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Fricounet Fricounet marked this pull request as ready for review March 27, 2026 15:37
Copy link
Copy Markdown
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@imeoer imeoer merged commit 03e051a into containerd:main Mar 30, 2026
17 checks passed
Fricounet added a commit to DataDog/nydus-snapshotter that referenced this pull request Apr 1, 2026
Add `enable_overlayfs_volatile` to the snapshot config so operators
can globally enable the volatile overlayfs mount option on all
writable layers without needing to inject snapshot labels through
the container runtime stack.

The volatile option skips sync on the upper layer, improving write
performance for ephemeral container filesystems. This is a safe
trade-off for most workloads where the writable layer does not need
to survive a crash.
Fricounet added a commit to DataDog/nydus-snapshotter that referenced this pull request Apr 1, 2026
…20)

Add `enable_overlayfs_volatile` to the snapshot config so operators
can globally enable the volatile overlayfs mount option on all
writable layers without needing to inject snapshot labels through
the container runtime stack.

The volatile option skips sync on the upper layer, improving write
performance for ephemeral container filesystems. This is a safe
trade-off for most workloads where the writable layer does not need
to survive a crash.
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.

[Feature] Support configuring volatile overlayfs option for all writable layers

2 participants