-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Description
A fresh active snapshot is reported to take 4.0 KiB on ext4, 0.0 B on XFS.
Probably this is not a bug, though, but some downstreams may want the size information to be consistent regardless to the backing filesystem.
Steps to reproduce the issue
ext4:
$ sudo ctr snapshot prepare foo
$ sudo ctr snapshot usage
KEY SIZE INODES
foo 4.0 KiB 1XFS:
$ sudo ctr snapshot prepare foo
$ sudo ctr snapshot usage
KEY SIZE INODES
foo 0.0 B 1Describe the results you received and expected
Received: 4 KiB vs 0.0 B
Expected: consistent result
What version of containerd are you using?
containerd github.com/containerd/containerd v1.6.14 9ba4b25
Any other relevant information
On XFS distros TestContainerStats (cri-integration) fails during checking s.GetWritableLayer().GetUsedBytes().GetValue() != 0 because of this difference:
containerd/integration/container_stats_test.go
Lines 32 to 72 in 88c8480
| // Test to verify for a container ID | |
| func TestContainerStats(t *testing.T) { | |
| t.Logf("Create a pod config and run sandbox container") | |
| sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "stats") | |
| pauseImage := images.Get(images.Pause) | |
| EnsureImageExists(t, pauseImage) | |
| t.Logf("Create a container config and run container in a pod") | |
| containerConfig := ContainerConfig( | |
| "container1", | |
| pauseImage, | |
| WithTestLabels(), | |
| WithTestAnnotations(), | |
| ) | |
| cn, err := runtimeService.CreateContainer(sb, containerConfig, sbConfig) | |
| require.NoError(t, err) | |
| defer func() { | |
| assert.NoError(t, runtimeService.RemoveContainer(cn)) | |
| }() | |
| require.NoError(t, runtimeService.StartContainer(cn)) | |
| defer func() { | |
| assert.NoError(t, runtimeService.StopContainer(cn, 10)) | |
| }() | |
| t.Logf("Fetch stats for container") | |
| var s *runtime.ContainerStats | |
| require.NoError(t, Eventually(func() (bool, error) { | |
| s, err = runtimeService.ContainerStats(cn) | |
| if err != nil { | |
| return false, err | |
| } | |
| if s.GetWritableLayer().GetUsedBytes().GetValue() != 0 { | |
| return true, nil | |
| } | |
| return false, nil | |
| }, time.Second, 30*time.Second)) | |
| t.Logf("Verify stats received for container %q", cn) | |
| testStats(t, s, containerConfig) | |
| } |
Show configuration if it is related to CRI plugin.
No response