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
Devicemapper: Default to xfs instead of ext4 #17903
Conversation
@@ -835,6 +843,18 @@ func getDeviceUUID(device string) (string, error) { | |||
return uuid, nil | |||
} | |||
|
|||
func getDeviceFS(device string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that a duplicate of ProbeFsType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Only difference seems to be that ProbeFsType() will return error if fs is anything other then ext4, xfs and btrfs. As we already use ProbeFsType(). So I can use ProbeFsType() too instead of using blkid.
… has fs If user wants to use a filesystem it can be specified using dm.fs=<filesystem> option. It is possible that docker already had base image and a filesystem on that. Later if user wants to change file system using dm.fs= option and restarts docker, that's not possible. Warn user about it. Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
If platform supports xfs filesystem then use xfs as default filesystem for container rootfs instead of ext4. Reason being that ext4 is pre-allcating lot of metadata (around 1.8GB on 100G thin volume) and that can take long enough on AWS storage that systemd times out and docker fails to start. If one disables pre-allocation of ext4 metadata, then it will be allocated when containers are mounted and we will have multiple copies of metadata per container. For a 100G thin device, it was around 1.5GB of metadata per container. ext4 has an optimization to skip zeroing if discards are issued and underlying device guarantees that zero will be returned when discarded blocks are read back. devicemapper thin devices don't offer that guarantee so ext4 optimization does not kick in. In fact given discards are optional and can be dropped on the floor if need be, it looks like it might not be possible to guarantee that all the blocks got discarded and if read back zero will be returned. Signed-off-by: Anusha Ragunathan <anusha@docker.com> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
fbc0616
to
07ff17f
Compare
@tiborvass Pushed V2 of patches. I think I have taken care of all review comments. PTAL. |
LGTM |
2 similar comments
LGTM |
LGTM |
Devicemapper: Default to xfs instead of ext4
I ran engine 1.9.0 + this change on aws for rhel 7.1 SELinux and centos ... looks good. No issues with starting the daemon after install. |
Default to xfs instead of ext4. Also give a warning if user specified a filesystem using dm.fs option and base device already has a file system which is not same as dm.fs