implement btrfs.Usage#1836
Conversation
- For active snapshot, the `excl` value of L0 QGroup is used, and committed on Commit. - For view snapshot, always 0 is returned. - For committed snapshot, the committed value is returned. Signed-off-by: Akihiro Suda <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1836 +/- ##
==========================================
- Coverage 49.17% 49.07% -0.11%
==========================================
Files 86 86
Lines 8518 8568 +50
==========================================
+ Hits 4189 4205 +16
- Misses 3659 3687 +28
- Partials 670 676 +6
Continue to review full report at Codecov.
|
| if err != nil { | ||
| return snapshots.Usage{}, err | ||
| } | ||
| if err := btrfs.Sync(target); err != nil { |
There was a problem hiding this comment.
How confident are we that after this Sync is called the info is accurate?
There was a problem hiding this comment.
As accurate as btrfs qgroup show --sync: https://github.com/kdave/btrfs-progs/blob/9fe889ac02b9c49b885c8999f5dd4e192697fa83/cmds-qgroup.c#L377-L382
--sync
To retrieve information after updating the state of qgroups,
force sync of the filesystem identified by <path> before
getting information.
| return nil, err | ||
| } | ||
| } | ||
| if err = btrfs.QuotaCtl(target, true); err != nil { |
There was a problem hiding this comment.
What is the cost of setting the quota in terms of extra memory, cpu, or disk?
There was a problem hiding this comment.
PERFORMANCE IMPLICATIONS
When the quotas are turned on, they affect all extent processing, taking a performance hit. It is not recommended to turn on qgroups unless the user intends to actually use them.
Should we make this optional?
If so, what value should we return when quota is disabled?
We might be able to use "walking" method, but it's confusing to have two different definitions of disk usage. (So I suggest returning -1)
|
Now, I want to use btrfs file system instead of overlayfs ,Which version supports btrfs,or it is still not supportted? |
|
@czm4514 From README:
I'm using Ubuntu 17.10 kernel 4.13 |
exclvalue of L0 QGroup is used, andcommitted on Commit.
Signed-off-by: Akihiro Suda [email protected]
Close #1801
Depends on containerd/btrfs#14
Result after
ctr images pull docker.io/library/ubuntu:lateston btrfs:on overlayfs:
The results are slightly different but should not hurt.