1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

61 Commits

Author SHA1 Message Date
David Disseldorp
f5536ce1f6 ctdb: add test script for ctdb_mutex_ceph_rados_helper
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
2016-12-09 07:59:33 +01:00
David Disseldorp
d8b61863ec ctdb: cluster mutex helper using Ceph RADOS
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>
2016-12-09 04:10:20 +01:00
David Disseldorp
832711718e ctdb-build: move ctdb_etcd_lock to utils/etcd
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-09 04:10:20 +01:00
Volker Lendecke
30f084dfd0 ctdb: Add a required include
exit(3) is defined in stdlib.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-10-17 22:34:20 +02:00
Amitay Isaacs
499bfce3e9 ctdb-pmda: Use 1s timeout for fetching statistics
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12138

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-12 00:32:17 +02:00
Martin Schwenke
d46960f20e ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-03 05:29:23 +02:00
Amitay Isaacs
6bd0f1cf46 ctdb-pcp-pmda: Reimplement using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Jul 22 10:31:57 CEST 2016 on sn-devel-144
2016-07-22 10:31:56 +02:00
Amitay Isaacs
5a67bb4496 ctdb-pmda: CTDB client code does not require ctdb->methods
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-05 10:53:15 +02:00
Amitay Isaacs
a4ac97d6c0 ctdb-daemon: Use lib/util functions instead of redefinitions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-08 10:33:19 +02:00
Amitay Isaacs
9f94620a30 ctdb-common: Use documented names for protocol family in socket()
Instead of using PF_*, use AF_*.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-02 08:42:09 +01:00
Ralph Boehme
2f16675a22 ping_pong: add -l option
Add a new option -l to check whether POSIX byte range locks are
working. Usage:

node1$ touch /path/to/cluster-fs/FILE

node1$ ./bin/ping_pong -l /path/to/cluster-fs/FILE
Holding lock, press any key to continue...
You should run the same command on another node now.

node2$ ./bin/ping_pong -l /path/to/cluster-fs/FILE

Output can either be:

  Holding lock, press any key to continue...

This means POSIX byte range locks are *not* working.

If you see this instead:

  file already locked, calling check_lock to tell us who has it locked...:
  check_lock failed: lock held: pid='27375', type='1', start='0', len='0'
  Working POSIX byte range locks

Congrats, you have a cluster fs with functional byte range locks!

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec 10 08:48:38 CET 2015 on sn-devel-104
2015-12-10 08:48:38 +01:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Amitay Isaacs
409c92b6c6 ctdb-daemon: Remove explicit include of ctdb_protocol.h
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-11-04 00:47:16 +01:00
Amitay Isaacs
4647787773 ctdb-daemon: Separate prototypes for common client/server functions
This groups function prototypes for common client/server functions in
common/common.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
01c6c90e98 ctdb-daemon: Remove dependency on includes.h
Instead of includes.h, include the required header files explicitly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
2fdb332fad ctdb-daemon: Stop using tevent compatibility definitions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
b900adc55c ctdb-daemon: Separate prototypes for system specific functions
This groups function prototypes for system specific functions in
common/system.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
6538ba5243 ctdb-pmda: Add missing prototype declaration for non-static function
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11434

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-08-07 05:33:29 +02:00
Volker Lendecke
bfbaf51cd6 ping_pong: Fix CID 1273087 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-05-06 15:37:14 +02:00
Martin Schwenke
b41c1bdaa1 ctdb-utils: Update Nagios code to use ctdb -X
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05 21:02:40 +01:00
Amitay Isaacs
0d5ecaa2e3 ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKET
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-28 05:42:04 +01:00
Martin Schwenke
6674949317 ctdb-tests: Mark some functions as static
To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-10 01:36:14 +02:00
Amitay Isaacs
d646df170c ctdb-build: Remove autoconf build files
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:09 +02:00
Amitay Isaacs
a27e59e8ec ctdb-pmda: Do not hardcode include paths
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-05-29 03:35:54 +02:00
David Disseldorp
7fdb21cc32 ctdb/pmda: Fix metric identifiers
The commit "pmda: Use upstream assigned PCP domain id" updated the
Performance Metrics Namespace (pmns) file, without changing the
corresponding metric identifiers used by the agent.

This change fixes the agent metric identifier values to match the pmns
definitions.

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): Sat Mar 22 00:07:31 CET 2014 on sn-devel-104
2014-03-22 00:07:31 +01:00
Mathieu Parent
6a03128c56 Improved check_ctdb
- increase verbosity with "-v"
- concat error messages (if there are several)
- handle 255 return code as warning (as it is the return code when any of the node is missing)
- read /etc/ctdb/nodes remotely (ctdb_check can be run on a non-ctdb host)

(This used to be ctdb commit cea81bdd503f6ef8b5bbd3582a8e0085bb02bc9f)
2013-10-24 16:54:08 +11:00
Mathieu Parent
27c2c61c21 Update Nagios check to work with ctdb versions past 30 Aug 2011
Because of commit a779d83a6213e2ba

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a4afe7af9c9391048d6f80135bbd5e15367770c7)
2013-07-11 15:18:06 +10:00
Amitay Isaacs
cc6772c968 ping_pong: Validate num_locks argument > 0
This fixes the floating point error if num_locks = 0.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 16afe36de52561a62372c14b567683dc898369d5)
2013-07-04 20:43:52 +10:00
Martin Schwenke
4a1eed5043 build: Separate autoconf macros for pmda
The pmda stuff is no longer built by default even if the headers are
available.  To build, run "configure --enable-pmda".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 194f7a0dec26d693a5f3e6734b1c82f61f8e4d19)
2013-05-28 14:24:16 +10:00
David Disseldorp
50bae99ac6 pmda: handle new ctdb_statistics format
The ctdb_statistics structure was recently changed. Update the PMDA to
dereference the new structure member names.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit e5a5ab53173d9aa4190ddf68c4ae316d4473eb56)
2013-05-26 23:54:47 +02:00
Michael Adam
05cf7bce49 utils🏓 add a -c switch to check the lock before reading/writing
This is to verify that the fcntl F_GETLK call reports F_UNLCK if called
from a process already holding a lock. This is for example used by samba's
strict locking code in combination with "posix locking = true".

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 4f42d17b74ce891691eee1cead498959cc8e4837)
2012-11-20 00:48:52 +01:00
Amitay Isaacs
4392591555 Remove explicit include of lib/tevent/tevent.h.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
2012-04-13 17:28:14 +10:00
Martin Schwenke
6a74638748 Clean up warnings: remove unused variable alen from scsi_io
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79d31660c7e612f0290fd085203856ad9e70b26f)
2011-11-09 15:37:24 +11:00
Mathieu Parent
68d81587dc Nagios plugin for CTDB
This plugin is GPL2 or greater as generally found in Nagios.
(this is obviously compatible with GPL3 or greater).

(This used to be ctdb commit df1ac1cfd65f32743ca2588edfdad46ce5a4f03f)
2011-11-08 16:34:15 +11:00
David Disseldorp
a3357af926 pmda: Use upstream assigned PCP domain id
Also use saner PMIDs in the pmns file.

(This used to be ctdb commit dcf150f8165316fefd53f9eecb1437195e631da6)
2011-09-14 12:54:04 +02:00
David Disseldorp
66f92be635 pmda: handle struct latency_counter and add num_recoveries
Rebase the CTDB PMDA from 1.0.114 to master:
- Add tevent and ctdb_protocol includes
- Handle latency metrics now stored under struct latency_counter
- Add new metric for the num_recoveries counter

(This used to be ctdb commit 2165a6f5117a71f9f97f46be9708fa34c037e17c)
2011-09-06 14:01:18 +02:00
David Disseldorp
927abee4c1 pmda: document in README how to add a new metric
(This used to be ctdb commit b63333fb81aadc451df47c0c3c038e6165f0eac2)
2011-09-06 14:01:18 +02:00
David Disseldorp
88406169bd pmda: Use CTDB_PATH macro for default socket path
Also includes some code cleanup changes.

(This used to be ctdb commit 80ad2979804f5bba29020ace46e114a45fa6cb66)
2011-09-06 14:01:18 +02:00
David Disseldorp
11ffbf4a58 pmda: Pull ctdb statistics once per fetch
Currently ctdb statistics are pulled in the PMDA fetch callback, which
results in a CTDB_CONTROL_STATISTICS call for each metric.
Do this once per fetch instead, and have the per-metric callbacks pull
data from the last counter cache.

(This used to be ctdb commit 137b498c75c55c966999cd788f12ed9010cfed3a)
2011-09-06 14:01:18 +02:00
David Disseldorp
2f925f1e64 pmda: Attempt reconnects while ctdbd is unavailable
Attempt to reconnect to ctdbd on fetch while it is unreachable.

We must provide our own queue callback wrapper, as ctdb_client_read_cb()
exits on transport failure.

(This used to be ctdb commit 28df6fbf1273b8d095a2bc38dca6a6c35c5c31bd)
2011-09-06 14:01:18 +02:00
David Disseldorp
9699e5750d pmda: Initial ctdb pmda check-in
The CTDB Performance Metrics Domain Agent (PMDA) is compiled when
Performance Co-Pilot (PCP) header files are present.

The CTDB PMDA periodically requests runtime counters from ctdbd (similar
to ctdb statistics) and exports these values via PCP for capture and
charting etc.

(This used to be ctdb commit fe7f69d6fc37661c2f1caa11de4ed3a7940d0a2f)
2011-09-06 14:01:18 +02:00
Ronnie Sahlberg
6f80ff4109 From Elia Pinto <gitter.spiros@gmail.com>
We dont need to include getopt.h under AIX

(This used to be ctdb commit fcebbc3484ce56c57def745ea51c053dfb02a657)
2010-02-22 14:00:33 +11:00
Ronnie Sahlberg
85d67197fe From William Jojo <w.jojo[AT]hvcc.edu>
AIX dont have getopt.h by default.
Dont try including this file when building on AIX

(This used to be ctdb commit 06b33a826e71e1dd2f9e02ad614be55535d42045)
2009-06-04 09:41:05 +10:00
Ronnie Sahlberg
caf0e863a4 remove the obsolete ipmux component.
this is replaced by LVS since a long time

(This used to be ctdb commit dca41ec04788922ce5f4c52d346872b3e35f8cbb)
2009-05-25 12:33:52 +10:00
Sumit Bose
2fcedf6dac add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>

(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
2009-05-21 11:22:21 +10:00
Michael Adam
60bfafbf10 ping pong: fix logic for mmap reads vs. preads
Michael

(This used to be ctdb commit 0c88fa41bc3c629052bc137ed30c473ed10522fd)
2009-05-13 16:13:14 +10:00
Michael Adam
c544371776 ping_pong: add GPL comment header with Tridge's copyright
Michael

(This used to be ctdb commit a87ef6a9206820d5110a7117240f743af010ff19)
2009-05-06 10:41:18 +10:00
Michael Adam
08cfdf0d63 ping_pong: get pread/pwrite prototypes from unistd.h
by defining _XOPEN_SOURCE to be 500 before including headers

Michael

(This used to be ctdb commit 96c79bddf7895e57ccf90f0d250bd08b7c4daf40)
2009-05-06 10:40:48 +10:00
Michael Adam
d68654ba5e ping_pong: reduce a couple of prototype warnings
Michael

(This used to be ctdb commit fce851621fe2099c9692acfbfaade24c3d69727a)
2009-05-06 10:40:08 +10:00
Michael Adam
bc6c3d03e8 add tridge's ping_pong.c to the utils folder
Michael

(This used to be ctdb commit fe59ecb697fb4686ad8ea2fe4ec1cc7b4629e74f)
2009-05-06 10:39:19 +10:00