-
Notifications
You must be signed in to change notification settings - Fork 934
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
Inconsistent container behavior with shiftfs
#8490
Comments
I'm unable to reproduce your issue, all containers behave like your second one here regardless of name. |
So how to debug what's going on? |
I compared |
I run Restarting daemon didn't help. Only after I disabled shiftfs and restared lxd daemon, the error is gone.
Most likely filesystem driver remembered that I attached |
When I reenable The command I use for testing:
That doesn't make sense. Unless there is some state preserved in filesystem driver related to this container. |
It is pretty insane, but the bug with enabled These work ok:
These fail:
But these again work ok:
That's repeatable. |
shiftfs
It also seems that with enabled |
If you change the filesystem directly from the host than shiftfs can't guarantee in all scenarios that the updates are picked up immediately; it'll basically have to keep two caches in sync. If things don't go terribly wrong after this merge window then shiftfs will slowly be faded out in favor of an upstream solution we wrote that has been merged. |
@brauner thanks for the clarification. It is unfortunate the |
Well, 9pfs in VMs is also terrible for performance, that's why the world is switching to virtiofs instead which is significantly faster but also even more tied to how VMs work. @brauner I still owe you a review on the liblxc side for the shifted mounts but were you planning on also adding direct LXD support or are we going to have to wait for a new LXC release that brings in that support before we can use it? |
Direct LXD support as in LXD setting up idmapped mounts for hotplugging into containers? |
@brauner direct LXD support as in detecting availability of the new kernel feature on startup and using it everywhere we use shiftfs today. |
Oh, yeah. I think that should be mostly doable it would need to be in the generic part of the storage code with a test whether the filesystem supports that feature. |
There is still no explanations of bug with container name. |
Closing as this looks like a shiftfs issue and shiftfs isn't seeing development at this point. We're pushing for as many filesystems to move over to idmapped mounts as possible with currently ext4, xfs, vfat, f2fs and btrfs all supporting it. ZFS is tracked at openzfs/zfs#12923 and we have an experimental patchset for cephfs as well as ongoing work on overlayfs. |
Ubuntu 22.04 ships with both shiftfs and idmapped mounts with LXD preferring the latter whenever available and shiftfs still requiring direct enablement through snap config at which point it takes care of the few filesystems without the native idmap support. |
Required information
driver: lxc | qemu
driver_version: 4.0.6 | 5.2.0
firewall: nftables
kernel_features:
netnsid_getifaddrs: "true"
seccomp_listener: "true"
seccomp_listener_continue: "true"
shiftfs: "true"
uevent_injection: "true"
unpriv_fscaps: "true"
kernel_version: 5.8.0-43-generic
lxc_features:
cgroup2: "true"
devpts_fd: "true"
mount_injection_file: "true"
network_gateway_device_route: "true"
network_ipvlan: "true"
network_l2proxy: "true"
network_phys_macvlan_mtu: "true"
network_veth_router: "true"
pidfd: "true"
seccomp_allow_deny_syntax: "true"
seccomp_notify: "true"
seccomp_proxy_send_notify_fd: "true"
os_name: Ubuntu
os_version: "20.10"
project: default
server: lxd
server_clustered: false
server_version: "4.11"
storage: zfs
storage_version: 0.8.4-1ubuntu11.1
Issue description
There is an inconsistent behavior in LXD launching two containers -
repodraw
andu3
. I suppose operations below should be idempotent and depend on container name, but they don't. Graphviz in the first container fails, and works as expected in the second.I guess this was caused by setting
shift=true
at some point - https://discuss.linuxcontainers.org/t/secure-and-user-friendly-mounts-for-unprivileged/10284/3?u=techtonik - butlxc rm
should clean it up, right?Information to attach
dmesg
)lxc info NAME --show-log
)lxc config show NAME --expanded
)lxc monitor
while reproducing the issue)The text was updated successfully, but these errors were encountered: