sanlock global lock creation fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
Fix Released
|
High
|
Heitor Alves de Siqueira | ||
Focal |
Won't Fix
|
High
|
Heitor Alves de Siqueira | ||
Groovy |
Won't Fix
|
High
|
Heitor Alves de Siqueira |
Bug Description
Hello,
Running Ubuntu server 20.04, I cannot create a shared VG using sanlock :
# vgcreate --shared foo /dev/mapper/vol
Enabling sanlock global lock
Skipping global lock: lockspace not found or started
Logical volume "lvmlock" created.
VG foo init failed: -28
Failed to initialize lock args for lock type sanlock
Volume group "foo" successfully removed
Messages in /var/log/syslog
lvmlockd[446807]: 1616089866 WARNING: mixed block sizes physical 4096 logical 512 (using 4096) for /dev/mapper/
lvmlockd[446807]: 1616089866 S lvm_foo init_vg_san write_resource gl error -28 /dev/mapper/
# lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
# dpkg -l | grep lvm
ii liblvm2cmd2.
ii lvm2 2.03.07-1ubuntu1 amd64 Linux Logical Volume Manager
ii lvm2-lockd 2.03.07-1ubuntu1 amd64 LVM locking daemon
A similar bug report from RHEL8 : https:/
Bug has been fixed upstream : https:/
It seems to be included in version 2.03.10 : https:/
How can we get this patch included in Ubuntu 20.04 ?
King Regards,
Charles
tags: | added: sts |
Changed in lvm2 (Ubuntu): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
importance: | Undecided → High |
status: | New → Fix Released |
Changed in lvm2 (Ubuntu Focal): | |
status: | New → Confirmed |
Changed in lvm2 (Ubuntu Groovy): | |
status: | New → Confirmed |
Changed in lvm2 (Ubuntu Focal): | |
importance: | Undecided → High |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
Changed in lvm2 (Ubuntu Groovy): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
importance: | Undecided → High |
We've determined this to be due to using disks with mixed sector sizes (i.e. different physical and logical sector sizes). The mentioned patch [0] enables lvmlockd to create shared leases in mixed sector sized disks, but additional support is needed in sanlock for these to work correctly.
The required sanlock patches are:
* d5e4def0d087 - sanlock: add flags to specify sector size [1]
* 445e86700fa3 - configurable sector size and align size [2]
If we don't have these additional sanlock patches, sanlock isn't able to find the written leases due to alignment issues and ultimately those are handled as invalid. Unfortunately, both sanlock patches are extensive and change a lot of low-level internal structures, so providing them as SRU updates would be prone to backporting errors and regressions.
Since both lvm2 and sanlock are working as expected with non-mixed sector sizes, and the current versions actively prevent leases to be written to mixed sector disks, we can consider that things are working correctly. Support for mixed sector sizes should be considered a "feature" instead, which is available starting with the versions below:
- lvm2: 2.03.10
- sanlock: 3.8.0
These versions are available in Ubuntu releases starting with Hirsute, and have been provided as backports in focal-backports and groovy-backports. Please refer to bug #1929432 and bug #1928708 for further details on the -backports versions.
[0] https:/ /sourceware. org/git/ ?p=lvm2. git;a=commitdif f;h=2d1fe38d84d 4 /pagure. io/sanlock/ c/d5e4def0d087 /pagure. io/sanlock/ c/445e86700fa3
[1] https:/
[2] https:/