sanlock global lock creation fail

Bug #1920047 reported by Charles KOPROWSKI
8
This bug affects 1 person
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/foo-lvmlock
lvmlockd[446807]: 1616089866 S lvm_foo init_vg_san write_resource gl error -28 /dev/mapper/foo-lvmlock

# lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04

# dpkg -l | grep lvm
ii liblvm2cmd2.03:amd64 2.03.07-1ubuntu1 amd64 LVM2 command library
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://bugzilla.redhat.com/show_bug.cgi?id=1833837

Bug has been fixed upstream : https://sourceware.org/git/?p=lvm2.git;a=commit;h=2d1fe38d84d499011d13ae1ea11535398528fc87

It seems to be included in version 2.03.10 : https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/tags/v2_03_10

How can we get this patch included in Ubuntu 20.04 ?

King Regards,

Charles

Tags: sts
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
Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

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=commitdiff;h=2d1fe38d84d4
[1] https://pagure.io/sanlock/c/d5e4def0d087
[2] https://pagure.io/sanlock/c/445e86700fa3

Changed in lvm2 (Ubuntu Focal):
status: Confirmed → Won't Fix
Changed in lvm2 (Ubuntu Groovy):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.