LINBIT / linstor-server

High Performance Software-Defined Block Storage for container, cloud and virtualisation. Fully integrated with Docker, Kubernetes, Openstack, Proxmox etc.
https://docs.linbit.com/docs/linstor-guide/
GNU General Public License v3.0
984 stars 76 forks source link

Automatically fix symlinks for devices #370

Closed kvaps closed 1 year ago

kvaps commented 1 year ago

Overview

This change is workaround for specific set of issues, often related to udev,
which lead to the disappearance of symlinks for LVM devices on a working system.
These issues commonly occur during device resizing and deactivation,
causing LINSTOR expceptions diring accessing DRBD super-block of volume.

Changes Made

Introduce an additional handler that checks for the device path before each such modification.
If the device is not found, it attempts to fix the symlink using dmsetup output.

Related Issue

fixes: https://github.com/LINBIT/linstor-server/issues/326

ghernadi commented 1 year ago

We have talked about this internally and I'm afraid we have to reject this PR simply because this seems to be completely out of LINSTOR's scope. It is fine that LINSTOR waits some time to give other software like UDEV / LVM time to create symlinks and the like, but we certainly do not want to interfere with those very same systems by also starting to create symlinks in their /dev/<wherever> "namespace" possibly causing races with those systems. This is especially true since this issue apparently only occurs during resizing and not at ordinary volume creations.

Feel free to build yourself a LINSTOR version that includes this hack if it helps you. Another approach for a hack would be to write a wrapper script around lvresize that rechecks the correct symlinks after the delegated call to the actual lvresize but before it returns to LINSTOR.