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
TopoLVM should not use the /dev/topolvm
devices but use lvm2 lv output as source of truth
#902
Comments
Note that previously it was discussed to add a limitation to not touch /proc/mounts. I believe this is moot since we should not assume /proc/mounts to be static if it can be touched by other host processes. |
Some questions about this issue:
|
This is correct, I believe this is a change that should target all devices managed by lvm2 in TopoLVM.
Thats also correct, Im referring to the path communicated via lvs lvs -o help
Logical Volume Fields
---------------------
lv_all - All fields in this section.
lv_uuid - Unique identifier.
lv_name - Name. LVs created for internal use are enclosed in brackets.
lv_full_name - Full name of LV including its VG, namely VG/LV.
lv_path - Full pathname for LV. Blank for internal LVs.
lv_dm_path - Internal device-mapper pathname for LV (in /dev/mapper directory).
...
that is correct again. We can also use /dev/mapper under the assumption we know everything about the underlying distro but I do not recommend it. |
Thank you for your reply. I'll discuss this issue with my colleagues next week (successive public holidays have started in Japan, so not all of us are working now). |
Sorry for the late reply. I've discussed this with my colleagues. We agree that the current
What do you think about these concerns? |
I agree, but we have to start somewhere if we want to move away from it eventually. I fully support the thought of maintaining backwards compatibility as long as possible.
I think this can be answered via the lvm documentation (man lvm, section "VALID NAMES"):
|
@jakobmoellerdev |
The motivation is to use the device paths that are controlled by lvm2 and reported in the lvs output. This is to have consistency with pretty much every lvm2 tooling around. It also allow simpler volume expansion since now the controller can rely purely on lvmd to do volume expansion without having to delegate to the node server (the only one knowing of the custom device paths at the moment). Even if the kernel uses /dev/mapper/ that is irrelevant because topolvm should not even be aware of this. There is no need to use /dev/mapper/ because /dev/VG/LV will always be linked (by lvm2) to the appropriate /dev/mapper device. This means that calling unmount and linking on /dev/VG/LV will work even without making use of the kernels /dev/mapper paths. I wonder which logic path you are concerned about that could break? |
If #879 hadn't been implemented, this change would have been a solution for the btrfs unmounting issue, and I wouldn't have any concerns. However, with #879 in place, this change serves only as an improvement. My worry is that it might lead to higher maintenance costs since we would need to keep both the new and the old code for compatibility reasons. I believe it would be wise to set a deadline for dropping the old code if we decide to go ahead with this. |
I think you make a very valid point, maybe in general we should introduce a policy to drop old maintained code paths after 1-2 minors? That being said, I am mostly afraid of any udev rules in our host os breaking TopoLVM and we cannot control our customers OS rules that much. For a self-contained setup where the infra teams own everything (including the nodes) that is an option, but for us it really isn't good to have a potential break so deep in the driver. |
I understood your point. Regarding maintenance costs, we may not need to sustain the old code. We can unmount or resize the volume using
So, I have no concern about this issue now. |
Describe the bug
TopoLVM currently uses
/dev/topolvm
as a base for all its created devices. This goes against the lvm2 usage recommendations:We currently do not use this recommendation and thus we have seen bugs occur that are caused by the mismatch of the devices in the Host and the devices in the topolvm-node and lvmd containers. (namely btrfs unmounting leading to a udev refresh)
What TopoLVM does currently is considered a userspace device rename and should be avoided at all costs if not synchronized via udev. We do not use or respect udev of the host system so we should not attempt to rename the devices naively.
This bug is problematic as we currently have live volumes in the wild that use /dev/topolvm so switching to the native lvm path is gonna be hard. However if we do not do this, we are at risk of getting broken everytime a udev rule is triggering a refresh of device mapper paths.
Additionally this bug leads to confusing behavior because we do not use the "path" variable that is returned by lvm2 when interacting with lvmd, causing the codebase to be unnecessarily complex. In addition in currently prohibits workflows like lvmd-based resizing of volume mounts as lvmd is not aware of the correct lvmd path.
Environments
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect TopoLVM as the defacto most popular lvm CSI driver to use default device conventions for interacting with lvm2 and not to create own devices.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: