Skip to content

Metadata only copy up support for overlayfs snapshotter #6310

@artqzn

Description

@artqzn

What is the problem you're trying to solve

Overlayfs snapshotter use overlay filesystem in a way when in case of write access the full content of a file will be copied from lowerdir to upperdir. During container start the containerd performs GID/UID remapping using "chown" for whole content of container rootfs. This leads to copying of whole rootfs content from lowerdir to upperdir. As result container start can take significant amount of time especially in case of huge files in container image.

Describe the solution you'd like

The overlayfs filesystem has "metadata" mount option that should solve this issue.
In case of overlayfs mount will be created with -o metadata the only files metadata be copied to upperdir. Upperdir will contain empty files with necessary attributes, but files content will be copied up in a lazy manner, when somebody attempts to open file for write.

Additional context

Thanks Rodrigo aka @rata for mentioning this possibility here:
#5890

Overlayfs:
https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt

Initial discussion for metadata only copy up support:
#5890 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions