[lvm-devel] Question: lvmlockd adopts orphan locks

David Teigland teigland at redhat.com
Mon Jan 13 17:15:42 UTC 2020


On Thu, Jan 09, 2020 at 04:19:53PM +0800, Leo Yan wrote:
> 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?

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




More information about the lvm-devel mailing list