1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

5239 Commits

Author SHA1 Message Date
Martin Schwenke
61b1fdec2f ctdb-scripts: Support NFS on RHEL7 with systemd
Need to be able to recognise a RHEL system.  Still use "system" to
start and stop service, since that still works and yields the smallest
change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-07 10:59:56 +02:00
Amitay Isaacs
331fb7fc64 ctdb-recoverd: No need to set ctdbd_pid again
This is unnecessary since ctdbd_pid is set very early in the code before
creating any other processes including recovery daemon.

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Jul  5 09:20:27 CEST 2014 on sn-devel-104
2014-07-05 09:20:27 +02:00
Martin Schwenke
1677dd499c ctdb-daemon: Remove ctdbd_pid global variable
This duplicates ctdb->ctdbd_pid.

Thanks to Sumit Bose <sbose@redhat.com> for the suggestion.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-05 06:51:13 +02:00
Martin Schwenke
e454e5ac9c ctdb-daemon: Check PID in ctdb_remove_pidfile(), not unreliable flag
If something unexpectedly uses fork() then an exiting child will
remove the PID file while the main daemon is still running.  The real
test is whether the current process has the PID of the main CTDB
daemon, which is the process that calls setsid().

This could be done using getpgrp() instead.  At the moment the
eventscript handler harmlessly calls setpgid() - harmless because the
atexit() handlers are cleared upon exec().  However, it is possible
that process groups will be used more in future so it is probably
better to rely on the session ID.

Thanks to Sumit Bose <sbose@redhat.com> for the idea.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-05 06:51:13 +02:00
Martin Schwenke
c7b3be97d9 ctdb-daemon: Exit if setting the session ID fails
Currently ctdbd_wrapper depends on the session ID.  Very soon PID file
removal will too.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-05 06:51:13 +02:00
Martin Schwenke
a7c5500765 ctdb-tests: Fix racy test for debugging hung scripts
Debugging can still be running when a monitor event times out and
scriptstatus output changes.

When debugging a hung script to a log file, write to a temporary file
and move the temporary file over the log file when done.  The test
then waits for the log file to appear.

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  3 08:19:23 CEST 2014 on sn-devel-104
2014-07-03 08:19:22 +02:00
Martin Schwenke
b0c191e5de ctdb-scripts: Always print footer when debugging hung script
There shouldn't be an early exit for the "init" event.  Just make the
"ctdb scriptstatus" call conditional.

While here, move the comment about only running a single instance to
be near locking code.  The comment is more useful there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-03 05:55:13 +02:00
Amitay Isaacs
b2a74726ee ctdb-packaging: Update configure.rpm with minimum library versions
This makes configure command consistent with spec file.

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): Mon Jun 30 11:23:18 CEST 2014 on sn-devel-104
2014-06-30 11:23:18 +02:00
Amitay Isaacs
fefb3a718f ctdb-packaging: Minimum required tevent library is 0.9.16
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-30 09:06:12 +02:00
Amitay Isaacs
d097898020 ctdb-build: Instead of default test_wrap, install fixed test_wrap
tests/scripts/test_wrap script is updated based on the configured paths.
This should be installed instead of the stock version in the source.

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 Jun 24 09:37:39 CEST 2014 on sn-devel-104
2014-06-24 09:37:39 +02:00
Amitay Isaacs
e9006db3eb ctdb-build: Fix sed expression to protect '\'
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Amitay Isaacs
a0d207001a ctdb-build: Use correct path variables for ctdb_run_tests.sh
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Amitay Isaacs
4f6d668cfa ctdb-build: Use CTDB_ETCDIR instead of ETCDIR/ctdb
This avoids hardcoding path components in source.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Amitay Isaacs
7793aa5617 ctdb-build: Use CTDB_RUNDIR instead of VARDIR/run/ctdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Amitay Isaacs
8cd48c6b1c ctdb-build: Add special target to get build version
This avoids the need to build a tarball to get version information.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Amitay Isaacs
113c5799d4 ctdb-build: Allow waf to build rpms without configure first
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-06-24 07:23:13 +02:00
Michael Adam
43d9670605 ctdb: update configure.rpm with builtin and bundled library arguments
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-20 23:38:10 +02:00
Michael Adam
fd4bf96378 ctdb:includes: add #ifdef guard for ZERO_STRUCT
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-20 23:38:10 +02:00
Michael Adam
89dafd1bcd ctdb:includes: add #ifdef guards for _PUBLIC_, _NORETURN_, and _PURE_
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-20 23:38:10 +02:00
Andrew Bartlett
b93a1e85ff ctdb: Remove duplicate README.Coding
Change-Id: I42e7c6938467a982bc799b00ddd4c5dff93ca3d1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
46924f68c1 autobuild: Remove unsupported --enable-socket-wrapper option from the "ctdb" target.
Socket wrapper now works with LD_PRELOAD.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
c3dc1f1b98 ctdb-packaging: Remove unused files
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
a39a5f4c06 ctdb-build: Add target to build RPMs
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
6e078c90a8 ctdb-packaging: Modify spec file to use waf build instead of autoconf
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
ae32b297c2 ctdb-packaging: Fix date/days in changelog
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
fb56e72e94 ctdb-build: Add build files (configure/Makefile) to use waf
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
fc71606480 ctdb-tests: Fix the tests for waf build
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
43c10db3a2 ctdb-build: Add waf build for CTDB
Note that in contrast to the original autoconf build,
the ctdb.spec file which is created from packaging/RPM/ctdb.spec,
is put into the top level directory, where it will be picked
up by rpmbuild -ta <tarball>".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:09 +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
cd7f401744 ctdb-mkversion: Support external VERSION specification
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
0a4fc92c77 ctdb-header: Protect against multiple includes
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
b72abf493a ctdb-build: Remove duplicate socket_wrapper library
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
400cb4d031 ctdb-build: Remove duplicate tdb library
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
7f14db48ac ctdb-build: Remove duplicate tevent library
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
893e6dba02 ctdb-build: Remove duplicate talloc library
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
91274d97a6 ctdb-build: Remove duplicate replace library
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
1e927a9322 ctdb-build: Remove duplicate popt library
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:09 +02:00
Martin Schwenke
aac607d727 ctdb-eventscripts: Ensure $GANRECDIR points to configured subdirectory
Check that the $GANRECDIR symlink points to the location specified by
$CTDB_GANESHA_REC_SUBDIR and replace it if incorrect.  This handles
reconfiguration and filesystem changes.

While touching this code:

* Create the $GANRECDIR link as a separate step if it doesn't exist.
  This means there is only 1 place where the link is created.

* Change some variables names to the style used for local function
  variables.

* Remove some "ln failed" error messages.  ln failures will be logged
  anyway.

* Add -v to various mkdir/rm/ln commands so that these actions are
  logged when they actually do something.

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): Fri Jun 20 05:40:16 CEST 2014 on sn-devel-104
2014-06-20 05:40:16 +02:00
Martin Schwenke
6f43896e12 ctdb-daemon: Debugging for tickle updates
This was useful for debugging the race fixed by commit
4f79fa6c7c.  It might be useful again.

Also fix a nearby comment typo.

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): Fri Jun 20 02:07:48 CEST 2014 on sn-devel-104
2014-06-20 02:07:48 +02:00
Martin Schwenke
6a552f1a12 ctdb-tests: Try harder to avoid failures due to repeated recoveries
About a year ago a check was added to _cluster_is_healthy() to make
sure that node 0 isn't in recovery.  This was to avoid unexpected
recoveries causing tests to fail.  However, it was misguided because
each test initially calls cluster_is_healthy() and will now fail if an
unexpected recovery occurs.

Instead, have cluster_is_healthy() warn if the cluster is in recovery.

Also:

* Rename wait_until_healthy() to wait_until_ready() because it waits
  until both healthy and out of recovery.

* Change the post-recovery sleep in restart_ctdb() to 2 seconds and
  add a loop to wait (for 2 seconds at a time) if the cluster is back
  in recovery.  The logic here is that the re-recovery timeout has
  been set to 1 second, so sleeping for just 1 second might race
  against the next recovery.

* Use reverse logic in node_has_status() so that it works for "all".

* Tweak wait_until() so that it can handle timeouts with a
  recheck-interval specified.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-19 23:41:13 +02:00
Michael Adam
5334881afa ctdb:vacuum: always run freelist_size again
and not only if repack_limit != 0. This partially reverts
commit 48f2d11588.

With the new tdb code this defragments the
free list by merging adjacent records.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
026d79cb00 ctdb:vacuum: add missing return to ctdb_vacuum_traverse_db() error path.
This got lost in commit 1994870299
("ctdb-vacuum: make ctdb_vacuum_traverse_db() void.")

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
b8658b3959 ctdb:vacuum: remove now unused talloc ctx argument from ctdb_vacuum_db()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
c3cb8c277a ctdb:vacuum: move init of vdata into init_vdata funcion
This is a small code cleanup.
vdata is only used in ctdb_vacuum_db() and not in
ctdb_vacuum_and_repack_db() where it is currently initialized.

This patch moves creation and all previously scattered
initialization of vacuum_data into ctdb_vacuum_init_vacuum_data
which is called from ctdb_vacuum_db.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
3cf018935e ctdb:vacuum: remove vacuum limit from vdata - not used
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
a99035a4c5 ctdb:vacuum: remove a superfluous comment.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
385e2236fb ctdb:vacuum: untangle assignmend and check for return of tdb_repack()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
e0a11369cf ctdb:vacuum: remove a superfluous and misleading comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
413f99f86e ctdb:vacuum: remove now unused ctdb_repack_tdb().
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
368683d7af ctdb:vacuum: use plain tdb_repack() instead of ctdb_repack_tdb()
Since we usually have 0 records left for repack-deletion,
repacking is essentially used for the purpose of defragmenting
the freelist, we can use the vanilla tdb_repack function.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00