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)
committerKarolin Seeger <kseeger@samba.org>
Thu, 23 Aug 2018 08:38:27 +0000 (10:38 +0200)
commit7cebb4897550e2dd8109c4dcc5c9f885dcbefb83
treeaf2758ead3ed119e74b33f42eec4082aa29c5094
parentc245fdce393c9c11b52576335802a5fdceeeaf96
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>
(cherry picked from commit ce289e89e5c469cf2c5626dc7f2666b945dba3bd)
ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c