summaryrefslogtreecommitdiff
path: root/ctdb/utils/ceph
Commit message (Collapse)AuthorAgeFilesLines
* ctdb_mutex_ceph_rados_helper: revert strtoull_err() usageDavid Disseldorp2019-03-011-6/+2
| | | | | | | | | | | | Compilation currently fails, as ctdb_mutex_ceph_rados_helper doesn't include or link against the samba-util library. Revert back to the previous strtoull() behaviour, which works fine. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Mar 1 18:34:18 UTC 2019 on sn-devel-144
* ctdb-utils: Use wrapper for string to integer conversionSwen Schillig2019-03-011-2/+6
| | | | | | | | | | | | In order to detect an value overflow error during the string to integer conversion with strtoul/strtoull, the errno variable must be set to zero before the execution and checked after the conversion is performed. This is achieved by using the wrapper function strtoul_err and strtoull_err. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb: add expiry test for ctdb_mutex_ceph_rados_helperDavid Disseldorp2018-08-091-1/+56
| | | | | | | | | | | | Kill the ctdb_mutex_ceph_rados_helper with SIGKILL and then confirm that the lock is automatically released following expiry. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Aug 9 16:26:36 CEST 2018 on sn-devel-144
* ctdb_mutex_ceph_rados_helper: fix deadlock via lock renewalsDavid Disseldorp2018-08-091-9/+98
| | | | | | | | | | | | | | | 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_mutex_ceph_rados_helper: rename timer_ev to ppid_timer_evDavid Disseldorp2018-08-091-12/+13
| | | | | | | | In preparation for adding a lock refresh timer. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb_mutex_ceph_rados_helper: use talloc destructor for cleanupDavid Disseldorp2018-08-091-27/+24
| | | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb_mutex_ceph_rados_helper: Set SIGINT signal handlerSamuel Cabrero2018-08-091-4/+15
| | | | | | | | Set a handler for SIGINT to release the lock. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb: add test script for ctdb_mutex_ceph_rados_helperDavid Disseldorp2016-12-091-0/+151
| | | | | | | | | | | | | | | | | | | | This standalone test script performs the following: - using ctdb_mutex_ceph_rados_helper, take a lock on the Ceph RADOS object a CLUSTER/$POOL/$OBJECT using the Ceph keyring for $USER + confirm that lock is obtained, via ctdb_mutex_ceph_rados_helper "0" output - check RADOS object lock state, using the "rados lock info" command - attempt to obtain the lock again, using ctdb_mutex_ceph_rados_helper + confirm that the lock is not successfully taken - tell the first locker to drop the lock and exit, via SIGTERM - once the first locker has exited, attempt to get the lock again + confirm that this attempt succeeds Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Dec 9 07:59:33 CET 2016 on sn-devel-144
* ctdb: cluster mutex helper using Ceph RADOSDavid Disseldorp2016-12-091-0/+328
ctdb_mutex_ceph_rados_helper implements the cluster mutex helper API atop Ceph using the librados rados_lock_exclusive()/rados_unlock() functionality. Once configured, split brain avoidance during CTDB recovery will be handled using locks against an object located in a Ceph RADOS pool. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>