Skip to contentSkip to conversation

Question: lvmlockd adopts orphan locks

DISCUSSION Leo Yan 2 participants 2 messages Jan 9, 2020 – Jan 13, 2020

lore
Share & tools
lore

Leo Yan

author
#0 lore raw

Hi all,

Since the commit 117160b27e51 ("Remove lvmetad") has been merged into lvm2 git repository, lvmetad is removed.

As side effect, in lvmlockd the function get_lockd_vgs() returns -1. Thus it's no chance for lvmlockd to adopt orphan locks after the
lvmlockd exits abnormal and relaunch. If we connect with the sanlock
lock manager, its daemon keeps running on the host and renew all locks, this would be safe for the in used LV on the host; but on the other hand, lvmlockd cannot adopt the locks, thus we have no chance to release related LVM locks anymore.

For this case, I understand we can release locks by directly use low level sanlock commands, just wander if we have more smooth approach for lvmlockd to adopt locks and release the locks gracefully after lvmlockd failure? Or do I miss anything?

Thanks,
Leo Yan

#1 lore raw
Quoted 13 lines · Leo Yan

Hi all,

Since the commit 117160b27e51 ("Remove lvmetad") has been merged into lvm2 git repository, lvmetad is removed.

As side effect, in lvmlockd the function get_lockd_vgs() returns -1. Thus it's no chance for lvmlockd to adopt orphan locks after the
lvmlockd exits abnormal and relaunch. If we connect with the sanlock
lock manager, its daemon keeps running on the host and renew all locks, this would be safe for the in used LV on the host; but on the other hand, lvmlockd cannot adopt the locks, thus we have no chance to release related LVM locks anymore.

Quoted 4 lines

For this case, I understand we can release locks by directly use low level sanlock commands, just wander if we have more smooth approach for lvmlockd to adopt locks and release the locks gracefully after lvmlockd failure? Or do I miss anything?

You are correct. I have not yet replaced the lock-adoption code in lvmlockd because it was not clear that anyone was using it. I'm happy to hear that it was useful for you, and sorry that it's been disabled. I hope to have it replaced in the coming year, and would be happy to help anyone interested in working on it.

Dave