cgroup v2, and the memory limit that silently did not apply

20.10 in December supports cgroup v2, the distributions are switching to it by default, and a runtime that does not know which version is in use applies limits to nothing.

$ stat -fc %T /sys/fs/cgroup/
cgroup2fs                     # v2. on Ubuntu 21.10+ and Fedora 31+.

$ docker info | grep -i cgroup
 Cgroup Driver: systemd
 Cgroup Version: 2

# and the check that the limit is real
$ docker run --rm -m 128m alpine sh -c 
    'cat /sys/fs/cgroup/memory.max'
134217728

Under v1 the same file is memory.limit_in_bytes in a different directory, so any monitoring or health check reading it directly breaks on the transition — and reads a nonexistent path silently in a shell script. The memory accounting also differs: v2 counts page cache toward the limit differently, so a container that was comfortably inside its limit can start being killed after a host upgrade with no application change.