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

158 Commits

Author SHA1 Message Date
David Disseldorp
8aba284fc4 ctdb/doc: man page for Ceph RADOS cluster mutex helper
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
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
cbc81dd78e ctdb-build: configure time switch for etcd support
Disable generation/installation of the etcd cluster mutex helper by
default. Support can be explicitly enabled at configure time with
--enable-etcd-reclock.

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
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
Amitay Isaacs
c7c2f15883 ctdb-build: Generate pre-built documentation in wscript itself
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-12-09 04:10:20 +01:00
Amitay Isaacs
27bd4c9eeb ctdb-build: Avoid duplicate list of man pages
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-12-09 04:10:20 +01:00
Jose A. Rivera
4e32944b78 ctdb: Add new helper ctdb_etcd_lock
This introduces a mutex helper called ctdb_etcd_lock, which allows CTDB to
use an existing etcd cluster to provide the functionality of a recovery lock
using the API outlined in ctdb/doc/cluster_mutex_helper.txt.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Mon Dec  5 19:39:10 CET 2016 on sn-devel-144
2016-12-05 19:39:10 +01:00
Amitay Isaacs
02aa65cede ctdb-logging: Remove duplicate logging code
ctdb_logging_init() now uses logging_init().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-05 08:09:22 +01:00
Amitay Isaacs
c9124a001f ctdb-logging: Refactor logging code
This extracts the code from following files:
  - server/ctdb_logging.c
  - server/ctdb_logging_file.c
  - server/ctdb_logging_syslog.c

This is in preparation for each daemon (and some processes) doing
their own loging instead of relying on CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-05 08:09:22 +01:00
Martin Schwenke
bdc049dfce ctdb-common: Drop CTDB's copy of sys_read() and sys_write()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Nov 29 11:22:40 CET 2016 on sn-devel-144
2016-11-29 11:22:40 +01:00
Amitay Isaacs
2a9584dc0a ctdb-daemon: Remove unused code cmdline.[ch]
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-11-25 04:19:23 +01:00
Martin Schwenke
fd8e562069 ctdb-packaging: Move CTDB tests to /usr/local/share/ctdb/tests/
In time, other things will end up in /use/local/share/ctdb/.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-10-14 08:07:11 +02:00
Amitay Isaacs
97b6ac7f66 ctdb-common: Add routines to manage PID file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-09-22 08:34:20 +02:00
Andreas Schneider
f9c85d04e9 ctdb-waf: Move ctdb tests to libexec directory
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12104

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-08-04 18:26:07 +02:00
Amitay Isaacs
70f2573f2a ctdb-tool: Add replacement ctdb tool using new client API
New tool breaks some of the tool unit tests due to improved error
messages.  Those changes are in the following patch.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-28 05:00:17 +02:00
Amitay Isaacs
199293f4a1 ctdb-tool: Remove old ctdb tool
Removing and adding replacement code makes the commits cleaner.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-28 05:00:17 +02:00
Martin Schwenke
337fc6e2e7 ctdb-doc: Integrate ctdb_diagnostics man page into build
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-28 05:00:15 +02:00
Amitay Isaacs
f79be2ee4c ctdb-common: Refactor tunable related functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-25 21:29:46 +02:00
Amitay Isaacs
fbce266c23 ctdb-build: Add missing dependency on samba-util
reqid.c uses idr, which requires samba-util.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-25 21:29:43 +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
3619a76144 ctdb-tests: Add torture test for fetch functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
b8b6829e2a ctdb-tests: Remove unused tests code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
6ad8f4630b ctdb-tests: Rename ctdb_porting_tests to porting_tests
and create unit test for it.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
7ab560527c ctdb-tests: Rename ctdb_lock_tdb to lock_tdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
e98f7c264b ctdb-tests: Convert rb_test into a unit test
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
a76fa36c2a ctdb-tests: Replace ctdb_update_record_persistent with update_record_persistent
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
f6d4f4d9f9 ctdb-tests: Replace ctdb_update_record with update_record using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
8cc069bd06 ctdb-tests: Replace ctdb_transaction with transaction_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
c2e406c7fe ctdb-tests: Replace ctdb_fetch_readonly_loop with fetch_readonly_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:22 +02:00
Amitay Isaacs
5a510ecbea ctdb-tests: Replace ctdb_fetch_readonly_once with fetch_readonly using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
bc157dc3d4 ctdb-tests: Replace ctdb_fetch_one with fetch_loop using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
2c27f3002f ctdb-tests: Replace ctdb_fetch with fetch_ring using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
388fa2c9b8 ctdb-tests: Replace ctdb_bench with message_ring using new client API
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
5fe216aa3e ctdb-tests: Add torture test for g_lock functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
f0395deb17 ctdb-tests: Common code to process commandline options
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Amitay Isaacs
47d95d2a0b ctdb-tests: Common code to wait for synchronization across cluster
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-22 06:50:21 +02:00
Martin Schwenke
e0aae9f0d3 ctdb-tests: Add shellcheck test suite
CTDB has a lot of scripts and shellcheck can be useful to find dubious
scripting practices.

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jul 21 06:06:49 CEST 2016 on sn-devel-144
2016-07-21 06:06:49 +02:00
Martin Schwenke
b51f604f75 ctdb-tests: Add new test support script for script install paths
This helps unit tests locate CTDB's scripts.  It is being created to
support some new shellcheck unit tests.

Hopefully, it can also be used to simplify some of the symlink
complexity in some other unit tests suites, such as eventscripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:27 +02:00
Michael Adam
2f95ada149 ctdb: fix autotest with socket-wrapper installed in the system
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jul 11 15:53:30 CEST 2016 on sn-devel-144
2016-07-11 15:53:30 +02:00
Amitay Isaacs
c9d61dbbfb ctdb-build: Exit if requested feature cannot be built
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): Tue Jul  5 14:38:30 CEST 2016 on sn-devel-144
2016-07-05 14:38:28 +02:00
Martin Schwenke
5a0d1b7cc5 ctdb-tests: Link to ctdb-ipalloc instead of using ctdbd_test.c
Less code, quicker build time, smaller binary...

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jul  4 19:29:08 CEST 2016 on sn-devel-144
2016-07-04 19:29:08 +02:00
Michael Adam
1cc5f8f616 ctdb: set the path to 'ctdb' in 'functions' in CTDB
Allow this to be overridden from the caller.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-06-11 06:20:13 +02:00
Amitay Isaacs
e1e14420a6 ctdb-tests: Re-use set_blocking instead of re-definition
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
3031732504 ctdb-tests: Re-use async accept wrapper from async_req
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
2082c0c3b5 lib/util: Avoid splitting tevent-unix-util as public library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11946

Commit 670db6ac1d split tevent-util public
library to create tevent-unix-util public library for standalone ctdb
use.  This created a public library dependency between samba and ctdb
for packaging.

Bundle tevent_unix.c in public library tevent-util as before.  However,
to avoid the dependencies for packaging, standalone ctdb build will
build tevent-util as a private library with only tevent_unix.c

This simplifies any new subsystems (or libraries) which need tevent-util
and are linked in both samba and ctdb.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-06-06 12:26:19 +02:00
Amitay Isaacs
90f04c7fc3 ctdb-tests: Remove ctdb tool stub code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-05-10 22:51:23 +02:00
Amitay Isaacs
07119045f0 ctdb-tests: Add fake ctdb daemon implementation for testing
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-05-10 22:51:22 +02:00
Amitay Isaacs
63f7466490 ctdb-tests: Get rid of ctdb func tests
This tested parse_nodestring function from tools/ctdb.c.  However,
ctdb.c is soon going to be replaced with the code using new client API.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-05-10 22:51:22 +02:00
Martin Schwenke
df99d9e273 ctdb-cluster-mutex: Factor out cluster mutex code
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-04-28 09:39:17 +02:00
Martin Schwenke
5cf3b7a1e3 ctdb: Add new helper ctdb_mutex_fcntl_helper
This implements the type of fcntl locking that the recovery lock uses.
The intent is to use it for multiple locks and allow the choice of
helper to be configured.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-04-28 09:39:16 +02:00