1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

4918 Commits

Author SHA1 Message Date
Martin Schwenke
01d879806b eventscripts: "setup" event doesn't need to wait for SETUP runstate
The "setup" event isn't called until ctdbd is in CTDB_RUNSTATE_SETUP
anyway...

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

(This used to be ctdb commit 9ea57af557028b1d2e5c560e7bcf4d014b9a8b1e)
2013-06-20 13:01:10 +10:00
Martin Schwenke
3b2f7330cc tests/eventscripts: New tests for 00.ctdb "init" event
These test dropping of IPs and TDB checking.

New stubs for date, tdbdump, tdbtool.

Enhance ip stub to handle "ip addr show to ..."

Tweak some infrastructure.

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

(This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
2013-06-20 13:01:10 +10:00
Martin Schwenke
4eed91b54a eventscripts: 13.per_ip_routing should not try hard to find public_addresses
This essentially reverts d4621277240721e6d130a930b0100506b64467ea.
This was added for testing but the test code was actually broken.
CTDB itself will only process public IPs if $CTDB_PUBLIC_ADDRESSES is
set, so no code should try to be more flexible than that!

The test code has been fixed instead.

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

(This used to be ctdb commit 3b11b27f3e22e99947bc2d6c49c4427bd7a0e332)
2013-06-20 13:01:10 +10:00
Martin Schwenke
2ceed3b0c8 tests/eventscripts: setup_ctdb() should always set $CTDB_PUBLIC_ADDRESSES
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c3e7a6e10d486ba0dbafdf110db540675b2317bc)
2013-06-20 13:01:10 +10:00
Martin Schwenke
58d499d3ae logging: Notify parent when logging daemon is up
Messages are lost until it is really up because syslogd_is_started is
set too early.  Adding a pipe to do the notification allows the parent
to wait and only set syslogd_is_started when the logging daemon is
actually ready.

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

(This used to be ctdb commit f3dd2eec200d6eeada2ea19cd7e76f1edfad6167)
2013-06-20 13:01:10 +10:00
Martin Schwenke
6317285c4f scripts: Move TDB checking from initscript to "init" event
It makes sense to do this in the "init" event and make the initscript
less complicated.

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

(This used to be ctdb commit 3bc93f312b8464fbfa2b2c44fffedc591fe5a3e0)
2013-06-20 13:01:10 +10:00
Martin Schwenke
961468146e scripts: Move dropping of all IPs from initscript to "init" event
It makes sense to do this in the "init" event and make the initscript
less complicated.

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

(This used to be ctdb commit 0b77cceb49a30a181063adc7868d42d2851318e8)
2013-06-20 13:01:09 +10:00
Martin Schwenke
bee02e06e6 scripts: drop_ip() should use delete_ip_from_iface()
Otherwise secondary addresses that aren't owned by CTDB could be
dropped.

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

(This used to be ctdb commit 5ffce65a1ad659b198ddf647622b899bdde45c72)
2013-06-20 13:01:09 +10:00
Martin Schwenke
a1eb516f0a scripts: drop_all_public_ips() now prints messages to stdout, not log
Change all callers to maintain current behaviour.

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

(This used to be ctdb commit 0b67397ef5419c781a35916575151da7b7e7cc27)
2013-06-20 13:01:09 +10:00
Martin Schwenke
26d0746b5d ctdbd: "init" event should run earlier in daemon initialisation
It should run before:

* the transport is started;
* databases are attached; and
* processing configuration files (e.g. nodes, public_addresses).

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

(This used to be ctdb commit 0a0c8543f167e11b75a622513367b083e42cbd3f)
2013-06-20 13:01:09 +10:00
Amitay Isaacs
a4f4e391f0 tools/ctdb: Do not exit prematurely on control timeout if retrying in a loop
This avoids premature exits from "ctdb stop" and "ctdb continue" due to
intermittent control (e.g. getpnn, getnodemap) timeouts.

This needs a proper fix to distinguish between timeout and failure
conditions and take appropriate action.

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

(This used to be ctdb commit c48583fd238496a81ddc46a21892f0b49559036a)
2013-06-20 12:52:00 +10:00
Amitay Isaacs
585a2715a6 packaging: Update the minimum required library versions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5f8547b1531bba4950b3d873a997585c3a16d31e)
2013-06-17 10:44:31 +10:00
Amitay Isaacs
4a9ed315c7 build: Enable VERBOSE option to display build command line
make V=1 or make VERBOSE=1 will display build commands.

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

(This used to be ctdb commit 02c63c591cc273122b3a547bb301b92f0e4bd217)
2013-06-14 16:45:27 +10:00
Mathieu Parent
d82b9ae410 build: Fix tdb.h path to enable building with system TDB library
(This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
2013-06-14 16:45:27 +10:00
Mathieu Parent
ecaf710193 libctdb: Include config.h in libctdb/ctdb.c
Bug-Debian: http://bugs.debian.org/703551

(This used to be ctdb commit 14a79c0f3967c88f8ffc8200d122f6c5ffdb63a8)
2013-06-14 16:45:27 +10:00
Amitay Isaacs
d0c858f211 ctdbd: Make sure we don't kill init process by mistake
If getpgrp() fails, it will return -1 and that will send KILL signal to init
process (PID 1).  This does not happen on RHEL, but does on AIX.

Reported-by: Chris Cowan <cc@us.ibm.com>

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

(This used to be ctdb commit edb2a3556d03e248b42f63dd2c62382b723bc98f)
2013-06-14 16:39:48 +10:00
Martin Schwenke
27ba5b44b6 tests/eventscripts: Unit tests for $CTDB_NFS_DUMP_STUCK_THREADS
Includes minor test infrastructure updates.

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

(This used to be ctdb commit cd4358b01c6c3d413b431f5760029d2b163b9c03)
2013-06-14 15:15:07 +10:00
Martin Schwenke
d82c0ef923 tests/eventscripts: Fix -X tracing in iterate_test()
... and delete a bogus comment.

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

(This used to be ctdb commit 0e2b5a8f89440a53f996482ac0c98b31a4f2cad3)
2013-06-14 15:15:07 +10:00
Martin Schwenke
02dd1bf00f tests/eventscripts: Add unit tests for $CTDB_MONITOR_NFS_THREAD_COUNT
Includes minor test infrastructure updates.

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

(This used to be ctdb commit ce2ef2be8aa22c0baf868daac8d4cf27246baa14)
2013-06-14 15:15:07 +10:00
Martin Schwenke
45878d4363 eventscripts: New configuration varable $CTDB_NFS_DUMP_STUCK_THREADS
If some nfsd threads are still alive after a shutdown during a restart
then this indicates the maximum number of threads for which a stack
trace should be dumped.  This can be useful for trying to determine
why nfsd is stuck.

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

(This used to be ctdb commit 2503245db10d567af708a04edd3a3b488c24f401)
2013-06-14 15:15:06 +10:00
Martin Schwenke
f408caea2a eventscripts: Add new option $CTDB_MONITOR_NFS_THREAD_COUNT
Consider the following example:

1. There are 256 nfsd threads configured.
2. 200 threads are "stuck" in system calls, perhaps waiting for the
   underlying filesystem when an attempt is made to restart NFS.
3. 56 threads exit when NFS is stopped.
4. 56 new threads are started when NFS is started.
5. 200 "stuck" threads exit leaving only 56 threads running.

Setting this option to "yes" makes the 60.nfs monitor event look for
this situation and try to correct it.

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

(This used to be ctdb commit 99b0d8b8ecc36dfc493775b9ebced54539c182d2)
2013-06-13 20:01:22 +10:00
Martin Schwenke
7513f0ba61 recoverd: Log node that causes takoever run to fail
Extend takeover_fail_callback() to just log (and not do any ban
processing) when the callback data is NULL.  Always call
ctdb_takeover_run() with the callback so that useful errors are always
logged.

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

(This used to be ctdb commit c429394afbabaee09f9216dc743419adddf523ea)
2013-06-13 15:55:48 +10:00
Martin Schwenke
896c5d5bf4 doc: Add release notes for 2.2
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ac0892d3a57adb0587a37de0f94fa686bed8970f)
2013-05-30 12:30:32 +10:00
Amitay Isaacs
8f2806fdbf build: Fix extra whitespaces
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 78cff9d54f241fb6a2943e50346f9c2ad9decc78)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
2afa275a68 tevent: Sync to tevent 0.9.18 from upstream
(This used to be ctdb commit 82d61f77c01df0fbb42743593937b175ce22a445)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
4c1dc871b9 replace: Sync to latest replace from upstream
The latest commits affecting lib/replace remove autoconf build from
Samba tree.  So using following commit as a sync point.

  commit 9ddfd7d878
  Author: Andrew Bartlett <abartlet@samba.org>
  Date:   Wed May 22 17:23:30 2013 +1000

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

(This used to be ctdb commit 506b27c944b4031e8a325816bd12abddd442a0bb)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
fe1fc55c61 tdb: Sync to tdb 1.2.11 from upstream
(This used to be ctdb commit bb3a32ec055432afc7225c9fd7504fb187694bda)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
803416d978 talloc: Sync to talloc 2.0.8 from upstream
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 3bffca8c17e441364525df115ee2ac16b5969e24)
2013-05-29 17:47:16 +10:00
Amitay Isaacs
140336383b ctdbd: Log node state transitions at higher debug level
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit db31dc48bd3135e9242af08bb79b67a17a2b1668)
2013-05-29 17:47:15 +10:00
Amitay Isaacs
09679d441b git: Ignore generated ctdb.spec file
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ca7ba26362eabfbcc329c66919d9c4da79c3b799)
2013-05-29 16:24:04 +10:00
Amitay Isaacs
55d2772ec0 git: Ignore ctdb_version.h file
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 641f539ffc7dd9542e669a3ec20c004f8bbcbf1e)
2013-05-29 16:24:04 +10:00
Amitay Isaacs
7c5252e453 build: Use REPLACE_OBJ and CTDB_EXTERNAL_OBJ to simplify build rules
This fixes the build on AIX where libreplace is required to build
ctdb_lock_helper, ctdb_fetch_lock_once, ctdb_fetch_readonly_once.

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

(This used to be ctdb commit fa757b49374e44c2380d4457e9b0eb3582981fac)
2013-05-29 16:23:49 +10:00
Amitay Isaacs
93ac364e23 build: Support for building on AIX xlc compiler
xlc does not support -fPIC, -Wno-format-zero-length

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

(This used to be ctdb commit 2cf95741fdab2ee5f724950a0b1ef257d6aeade7)
2013-05-29 15:17:45 +10:00
Amitay Isaacs
0add37aca7 tests: Do not use err() to support AIX
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1734562a7b3512853b9e0232880c42d50c1c2e4c)
2013-05-29 15:17:45 +10:00
Amitay Isaacs
4069ccf22f tests: Include system/time.h to support building on AIX
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0320bb4f8ca8171812ec7f41556aed847c74bfb4)
2013-05-29 15:17:20 +10:00
Amitay Isaacs
6635092a76 libctdb: Do not include sys/time.h to support build on AIX
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2c19fa78ce0b25c3615b23664df32233bdbdea42)
2013-05-29 15:16:54 +10:00
Amitay Isaacs
e6208ea453 util: Do not stop build if backtracing is not supported
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit b091f09ea01482823bd850d1d4e2329e0a19c959)
2013-05-29 14:57:03 +10:00
Martin Schwenke
2e515f2306 eventscripts: Fix statd-callout update handling
60.nfs and 60.ganesha touch $statd_update_trigger every time they're
run.  This stops the statd-callout updates from ever being called.

Make this logic self-contained and move it to new function
nfs_statd_update() in the functions file.  Call this in 60.nfs and
60.ganesha with the appropriate update period as the only argument.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reported-by: Poornima Gupte <poornima.gupte@in.ibm.com>

(This used to be ctdb commit 1b5968f6be084590667f4f15ff3bef13ed9a2973)
2013-05-28 16:11:47 +10:00
Martin Schwenke
529db4d52c tests/integration: Improve debug output for unhealthy cluster after restart
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 25a6fd784cde96f3d20a79f70b5589b5c4aca675)
2013-05-28 14:24:16 +10:00
Martin Schwenke
7dca442057 tests/scripts: Delete unused $rows and $ww variables from run_tests
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 80b3cf2c652c6098390cdd0dbb3edc648f7df487)
2013-05-28 14:24:16 +10:00
Martin Schwenke
7adf52e6b3 packaging: Create separate package for pcp pmda
To build ctdb-pcp-pmda package, run packaging/RPM/makerpms.sh script with
"--with pmda" option.

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

(This used to be ctdb commit 85e11b9b13b3add88c1b8957be51793cc1db4f2d)
2013-05-28 14:24:16 +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
Martin Schwenke
982ea336db build: Fix install paths for pcp pmda
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 11af486754bb04899e3dc544157bf70530e66cd1)
2013-05-28 14:24:16 +10:00
Martin Schwenke
2d3d5c133e packaging: makerpms.sh can take multiple arguments for rpmbuild
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f2ef3510407fbad29908195c58e4160d5a81e8a4)
2013-05-27 15:15:25 +10:00
Martin Schwenke
1eab9c898c eventscripts: Stop NAT gateway's delete_all() from polluting the log
Every time a node that wasn't the NAT gateway master gets reconfigured
something like this appears in the log:

  ctdbd: 11.natgw: Failed to del 10.0.1.139 on dev eth1

Since this usually fails it is better to mute the error than to have
it pollute the log.

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

(This used to be ctdb commit 0ca7a98ffef50cbd06849cfbf65fb4a3d668b7bd)
2013-05-27 15:15:25 +10:00
Martin Schwenke
1ab2bbb349 recoverd: Backward compatibility for nodes without IPREALLOCATED control
Consider the case of upgrading a cluster node by node, where some
nodes are still running older versions of CTDB without the
IPREALLOCATED control.  If a "new" node takes over as recovery master
and a failover occurs, then it will attempt to send IPREALLOCATED
controls to all nodes.  The "old" nodes will fail in a fairly
nondescript way (result == -1).

To try to handle this situation, fall back to the EVENTSCRIPT control
to handle "ipreallocated".  Only do this on the failed nodes.
However, do not do this on nodes that timed out (they've probably
implemented the control and we should call the regular fail_callback
to get those nodes banned) or for stopped nodes (since they can't
actually run the "ipreallocated" event via the EVENTSCRIPT control).

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

(This used to be ctdb commit b2654853ce9b7c18c5874b080bc94d3118078a5d)
2013-05-27 15:15:25 +10:00
Martin Schwenke
66019e3287 scripts: Provide mktemp function for platforms without mktemp command
This is needed for AIX and possibly others.

Also provide a cheaper mktemp function is needed in the run_tests
script.

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

(This used to be ctdb commit b2b572e9049c7138bd223226475bef8fe3e01f10)
2013-05-27 15:14:33 +10:00
Martin Schwenke
17d7288440 tests: Fix integration tests to use real private IPs
192.0.2.x was a typo.

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

(This used to be ctdb commit c9e36f596c63c9af7f80d7cb8d7a5c6dcca4860a)
2013-05-27 12:23:43 +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
Martin Schwenke
2b971a2797 tests/takeover: New test with 900 IPs
(This used to be ctdb commit 75a620c516e384f042b5d675183b3a1b48fd6115)
2013-05-24 22:31:22 +10:00