-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sparsefiles Copy in blockfile snapshotter #10197
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Zhao Jizhuang <571130360@qq.com>
Hi @zhaojizhuang. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Can we stat each file after the copy to see if the block usage differs? The expectation right now is blockfile snapshotter is not very efficient when copy file range is not used. Are the sparse file properties preserved when it doesn't go through a full read/write copy of the file? |
@dmcgowan We use the command "fallocate -d copy.img" to make the snapshot blockfile sparse. here is the test demo,using nginxt,which has 7 layers
AfterAfter 7 snapshots (18~24) were sparsified, the results are as follows: du -h
du -h --apparent-size
stat
beforebefore 7 snapshots (18~24) were sparsified, the results are as follows: du -h
du -h --apparent-size
stat
|
gently ping ... @dmcgowan |
Adds the ability to copy sparse files and can be configured in the config.
In the Go language,
io.Copy
is equivalent tocp --sparse=never xxx
, so even if the initial scratch file is a sparse file, it is still a non-sparse file after go io.copy. Each snapshot block file will occupy the full block file size by default.