ctdb_mutex_ceph_rados_helper: fix deadlock via lock renewals
authorDavid Disseldorp <ddiss@samba.org>
Thu, 19 Jul 2018 09:55:23 +0000 (11:55 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 9 Aug 2018 11:29:15 +0000 (13:29 +0200)
commitce289e89e5c469cf2c5626dc7f2666b945dba3bd
treed5e2a7f6c499df8ef5be1247ed05f284e211b07f
parent91a89c146453ca203a83dc2ba555bb93276c4d7f
ctdb_mutex_ceph_rados_helper: fix deadlock via lock renewals

RADOS locks without expiry persist indefinitely. This results in CTDB
deadlock during failover if the recovery master dies unexpectedly, as
subsequently elected recovery master nodes can't obtain the recovery
lock.
Avoid deadlock by using a lock expiration time (10s by default), and
renewing it periodically.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13540

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c