ddiss/ctdb.git
7 years agoOne of the entry points to release an ip reset the pnn field before invoking the... master
Ronnie Sahlberg [Thu, 22 Sep 2011 05:13:26 +0000 (15:13 +1000)]
One of the entry points to release an ip reset the pnn field before invoking the eventscript.
this triggered a check for "only run the eventscript if we host the address" to trigger and shortcir=cuit calling the eventscript.

An effect of this would be that 'ctdb delip' would remove the ip from ctdb, but fail to delete it from the interface.

S1028798

7 years agoChange the 'This Node' column of the machinereadable output for 'ctdb status -Y'...
Ronnie Sahlberg [Wed, 21 Sep 2011 05:41:28 +0000 (15:41 +1000)]
Change the 'This Node' column of the machinereadable output for 'ctdb status -Y' to Y/N instead of 1/0

1/0 is unsuitable since it can be useful to check 'if a column is "1" there is something wrong with that node'

7 years agowhen checking that the interfaces exist in ctdb_add_public_address()
Ronnie Sahlberg [Wed, 21 Sep 2011 01:42:19 +0000 (11:42 +1000)]
when checking that the interfaces exist in ctdb_add_public_address()
cant talloc off vnn since it is not yet initialized and might not always be NULL

7 years agoReadOnly: revokechild_active is a list, not a context.
Ronnie Sahlberg [Tue, 13 Sep 2011 08:47:18 +0000 (18:47 +1000)]
ReadOnly: revokechild_active is a list, not a context.

Dont reset the pointer to NULL after deleting the first entry, loop deleting one entry
at a time until they are all gone or we will leak some memory and possibly a process.

7 years agoDocument 'cattdb' more clearly that it dumps the content of the local TDB and not...
Ronnie Sahlberg [Tue, 13 Sep 2011 08:44:13 +0000 (18:44 +1000)]
Document 'cattdb' more clearly that it dumps the content of the local TDB and not the CTDB database

7 years agofix some compiler warnings for the test tools
Ronnie Sahlberg [Tue, 13 Sep 2011 08:41:34 +0000 (18:41 +1000)]
fix some compiler warnings for the test tools

7 years agoReadOnly: Rename the function ctdb_ltdb_fetch_readonly() to ctdb_ltdb_fetch_with_head...
Ronnie Sahlberg [Tue, 13 Sep 2011 08:38:20 +0000 (18:38 +1000)]
ReadOnly: Rename the function ctdb_ltdb_fetch_readonly() to ctdb_ltdb_fetch_with_header() since this is what it actually does.

7 years agoFix a typo in a message in ctdb backupdb.
Michael Adam [Mon, 12 Sep 2011 13:04:46 +0000 (15:04 +0200)]
Fix a typo in a message in ctdb backupdb.

7 years agoFix additional breakage from the merge for change in signature for ctdb_cmdline_clien...
Ronnie Sahlberg [Sun, 11 Sep 2011 23:44:06 +0000 (09:44 +1000)]
Fix additional breakage from the merge for change in signature for ctdb_cmdline_client() and ctdb_attach()

7 years agoMerge branch 'master-readonly-records' into foo
Ronnie Sahlberg [Sun, 11 Sep 2011 23:34:34 +0000 (09:34 +1000)]
Merge branch 'master-readonly-records' into foo

Conflicts:

Makefile.in
tools/ctdb.c

7 years agoDrop loglevel for a tevent message from FATAL to ERROR
Ronnie Sahlberg [Wed, 7 Sep 2011 23:28:33 +0000 (09:28 +1000)]
Drop loglevel for a tevent message from FATAL to ERROR

CQ S1028400

7 years agoMerge remote branch 'ddiss/master_pmda_and_client_timeouts'
Ronnie Sahlberg [Thu, 8 Sep 2011 01:22:53 +0000 (11:22 +1000)]
Merge remote branch 'ddiss/master_pmda_and_client_timeouts'

7 years agopmda: handle struct latency_counter and add num_recoveries
David Disseldorp [Fri, 2 Sep 2011 15:34:19 +0000 (17:34 +0200)]
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

7 years agopmda: document in README how to add a new metric
David Disseldorp [Fri, 2 Sep 2011 15:43:13 +0000 (17:43 +0200)]
pmda: document in README how to add a new metric

7 years agopmda: Use CTDB_PATH macro for default socket path
David Disseldorp [Fri, 2 Sep 2011 11:26:04 +0000 (13:26 +0200)]
pmda: Use CTDB_PATH macro for default socket path

Also includes some code cleanup changes.

7 years agopmda: Pull ctdb statistics once per fetch
David Disseldorp [Mon, 8 Aug 2011 09:15:06 +0000 (11:15 +0200)]
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.

7 years agopmda: Attempt reconnects while ctdbd is unavailable
David Disseldorp [Wed, 3 Aug 2011 08:38:27 +0000 (10:38 +0200)]
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.

7 years agopmda: Initial ctdb pmda check-in
David Disseldorp [Wed, 13 Jul 2011 16:11:23 +0000 (18:11 +0200)]
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.

7 years agoclient: flag local node in ctdb -Y status output
David Disseldorp [Wed, 24 Aug 2011 09:34:56 +0000 (11:34 +0200)]
client: flag local node in ctdb -Y status output

Regular "ctdb status" output flags which node is the local node, do the
same for machine readable output.

7 years agoclient: add timeout argument to ctdb_attach
David Disseldorp [Mon, 8 Aug 2011 14:35:56 +0000 (16:35 +0200)]
client: add timeout argument to ctdb_attach

Rather than using a fixed 2 second CTDB_CONTROL_GETDBPATH timeout.

7 years agoclient: add req timeout argument to ctdb_cmdline_client
David Disseldorp [Mon, 8 Aug 2011 12:09:46 +0000 (14:09 +0200)]
client: add req timeout argument to ctdb_cmdline_client

Following connection to the local ctdbd, ctdb_cmdline_client() currently
issues a CTDB_CONTROL_GET_PNN request with a fixed 3 second timeout.

The ctdb cmd line client accepts a --timelimit argument for specifying
a per request timeout, pass this value through to ctdb_cmdline_client()
for use as a CTDB_CONTROL_GET_PNN request timeout.

7 years agoMerge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master
Ronnie Sahlberg [Tue, 6 Sep 2011 07:29:30 +0000 (17:29 +1000)]
Merge branch 'master' of 10.1.1.27:/shared/ctdb/ctdb-master

7 years agoInterface monitoring: add a event to trigger every 30 seconds to check that all inter...
Ronnie Sahlberg [Tue, 6 Sep 2011 07:02:19 +0000 (17:02 +1000)]
Interface monitoring: add a event to trigger every 30 seconds to check that all interfaces referenced by the public address list actually exists.

This will make it much easier to root-cause problems such as
S1029023
when an external application deleted the interface while it is still is in use by ctdbd.

7 years agoCheck interfaces: when reading the public addresses file to create the vnn list
Ronnie Sahlberg [Tue, 6 Sep 2011 06:11:00 +0000 (16:11 +1000)]
Check interfaces:  when reading the public addresses file to create the vnn list
check that the actual interface exist, print error and fail startup if the interface does not exist.

7 years agoMerge branch 'master' of ssh://git.samba.org/data/git/ctdb
Ronnie Sahlberg [Mon, 5 Sep 2011 06:42:49 +0000 (16:42 +1000)]
Merge branch 'master' of ssh://git.samba.org/data/git/ctdb

7 years agoAdd a tunable "AllowClientDBAttach" with default value 1.
Michael Adam [Fri, 2 Sep 2011 14:42:10 +0000 (16:42 +0200)]
Add a tunable "AllowClientDBAttach" with default value 1.

When set to 0, clients will not be able to attach to databases
via the db_attach control. This might can be useful for maintenance
where ctdb should be kept running but clients should not be able
to modify databases.

7 years agotools/ctdb: fix a typo in a debug message
Michael Adam [Fri, 2 Sep 2011 14:23:22 +0000 (16:23 +0200)]
tools/ctdb: fix a typo in a debug message

7 years agotests:ctdb_fetch_lock_once we must link with @POPT_OBJ@ in case -lpopt is not available
Ronnie Sahlberg [Fri, 2 Sep 2011 03:31:41 +0000 (13:31 +1000)]
tests:ctdb_fetch_lock_once   we must link with @POPT_OBJ@ in case -lpopt is not available

7 years agotests: Link ctdb_fetch_lock_once with @TDB_OBJ@ not -ltdb so we dont create an unneed...
Ronnie Sahlberg [Fri, 2 Sep 2011 03:21:33 +0000 (13:21 +1000)]
tests: Link ctdb_fetch_lock_once with @TDB_OBJ@ not -ltdb so we dont create an unneeded dependency on having a standalone tdb library installed

7 years agoNew version 1.11 ctdb-1.11
Ronnie Sahlberg [Thu, 1 Sep 2011 02:30:00 +0000 (12:30 +1000)]
New version 1.11

7 years agoReadOnly: update the documentation about readonly locks
Ronnie Sahlberg [Thu, 1 Sep 2011 01:40:51 +0000 (11:40 +1000)]
ReadOnly: update the documentation about readonly locks

7 years agoReadOnly: add a new control to activate readonly lock capability for a database.
Ronnie Sahlberg [Thu, 1 Sep 2011 01:08:18 +0000 (11:08 +1000)]
ReadOnly: add a new control to activate readonly lock capability for a database.
let all databases default to not support this  until enabled through this control

7 years agoReadOnly: add a readonly flag to the getdbmap control and show the readonly setting...
Ronnie Sahlberg [Thu, 1 Sep 2011 00:28:15 +0000 (10:28 +1000)]
ReadOnly: add a readonly flag to the getdbmap control and show the readonly setting in ctdb getdbmap output

7 years agoReadOnly: Change the ctdb_db structure to keep a uint8_t for flags instead of a boole...
Ronnie Sahlberg [Thu, 1 Sep 2011 00:21:55 +0000 (10:21 +1000)]
ReadOnly: Change the ctdb_db structure to keep a uint8_t for flags instead of a boolean for
the persistent flag.
This is the same size as the original boolean but allows ut to add additional flags for the database

7 years agoMerge remote branch 'martins/tests'
Ronnie Sahlberg [Wed, 31 Aug 2011 22:55:23 +0000 (08:55 +1000)]
Merge remote branch 'martins/tests'

7 years agoMerge remote branch 'martins/eventscripts'
Ronnie Sahlberg [Wed, 31 Aug 2011 22:52:48 +0000 (08:52 +1000)]
Merge remote branch 'martins/eventscripts'

7 years agoTests - eventscripts - add some multievent tests
Martin Schwenke [Wed, 31 Aug 2011 07:29:14 +0000 (17:29 +1000)]
Tests - eventscripts - add some multievent tests

Running "./run_tests -s simple/* multievent/*" results in a stupid
summary.  Will need to work on that...

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - allow "ctdb scriptstatus" output to be primed
Martin Schwenke [Wed, 31 Aug 2011 07:27:05 +0000 (17:27 +1000)]
Tests - eventscripts - allow "ctdb scriptstatus" output to be primed

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoMerge branch 'eventscripts' into tests
Martin Schwenke [Wed, 31 Aug 2011 05:38:55 +0000 (15:38 +1000)]
Merge branch 'eventscripts' into tests

7 years agoEventscripts - enhance ctdb_replay_monitor_status()
Martin Schwenke [Wed, 31 Aug 2011 05:34:43 +0000 (15:34 +1000)]
Eventscripts - enhance ctdb_replay_monitor_status()

Print useful output and return a suitable exit code.

The DISABLED and TIMEDOUT statuses use fake negative return codes, and
these can't be faked from the shell.  So we map DISABLED to OK and
TIMEDOUT to ERROR - this should avoid nearly all surprises.  When we
do this we add a note to the beginning of the output.  The alternative
is to "fix" ctdbd to use only codes that can actually be returned by
shell scripts.  However, the reason for using negative codes is
probably to distinguish them from real ones...

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - ctdb stub - implement scriptstatus, tweaks
Martin Schwenke [Tue, 30 Aug 2011 06:27:04 +0000 (16:27 +1000)]
Tests - eventscripts - ctdb stub - implement scriptstatus, tweaks

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - formatting tweak in simple_test()
Martin Schwenke [Tue, 30 Aug 2011 06:25:13 +0000 (16:25 +1000)]
Tests - eventscripts - formatting tweak in simple_test()

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - new function simple_test_event()
Martin Schwenke [Tue, 30 Aug 2011 04:21:02 +0000 (14:21 +1000)]
Tests - eventscripts - new function simple_test_event()

Just like simple_test() but 1st arg is the event name.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - output format tweaks
Martin Schwenke [Tue, 30 Aug 2011 04:20:38 +0000 (14:20 +1000)]
Tests - eventscripts - output format tweaks

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add extra filename format for multi-event tests
Martin Schwenke [Tue, 30 Aug 2011 04:19:09 +0000 (14:19 +1000)]
Tests - eventscripts - add extra filename format for multi-event tests

$event may not be set so we need to test for it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add die() function and use it
Martin Schwenke [Tue, 30 Aug 2011 04:16:28 +0000 (14:16 +1000)]
Tests - eventscripts - add die() function and use it

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - remove undefined argument in some simple_test calls
Martin Schwenke [Tue, 30 Aug 2011 03:35:43 +0000 (13:35 +1000)]
Tests - eventscripts - remove undefined argument in some simple_test calls

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - evenscripts - add symlink to ctdb.sysconfig
Martin Schwenke [Tue, 23 Aug 2011 03:53:39 +0000 (13:53 +1000)]
Tests - evenscripts - add symlink to ctdb.sysconfig

Some of the tests expect the default to be

  CTDB_SERVICE_AUTOSTARTSTOP=yes

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - Samba TCP port checking fixes
Martin Schwenke [Tue, 23 Aug 2011 03:52:42 +0000 (13:52 +1000)]
Tests - eventscripts - Samba TCP port checking fixes

Expect "ctdb checktcpport" to exit with 1 if not implemented.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - TCP port checking, no working checkers
Martin Schwenke [Mon, 22 Aug 2011 06:41:01 +0000 (16:41 +1000)]
Tests - eventscripts - TCP port checking, no working checkers

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - new Samba TCP port checking test - no nmap
Martin Schwenke [Mon, 22 Aug 2011 06:37:22 +0000 (16:37 +1000)]
Tests - eventscripts - new Samba TCP port checking test - no nmap

This one should fall back to netstat.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - nmap and netstat stubs can pretend they weren't found
Martin Schwenke [Mon, 22 Aug 2011 06:14:55 +0000 (16:14 +1000)]
Tests - eventscripts - nmap and netstat stubs can pretend they weren't found

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - new Samba tests to test TCP port checking
Martin Schwenke [Mon, 22 Aug 2011 06:10:44 +0000 (16:10 +1000)]
Tests - eventscripts - new Samba tests to test TCP port checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add a new ctdb_not_implemented() function
Martin Schwenke [Mon, 22 Aug 2011 06:06:16 +0000 (16:06 +1000)]
Tests - eventscripts - add a new ctdb_not_implemented() function

This allowed a single ctdb command to be defined as not-implemented
and provided the associated output from the ctdb stub in
$ctdb_not_implemented.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - new function setup_nmap_output_filter()
Martin Schwenke [Mon, 22 Aug 2011 06:00:52 +0000 (16:00 +1000)]
Tests - eventscripts - new function setup_nmap_output_filter()

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add some output filtering
Martin Schwenke [Mon, 22 Aug 2011 06:07:36 +0000 (16:07 +1000)]
Tests - eventscripts - add some output filtering

This allows $OUT_FILTER to be set to one or more sed commands to
filter eventscript output.  This allows expected output to be
generalised.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - ctdb default default level is 0.
Martin Schwenke [Mon, 22 Aug 2011 05:59:20 +0000 (15:59 +1000)]
Tests - eventscripts - ctdb default default level is 0.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add output for "not implemented" in ctdb stub
Martin Schwenke [Mon, 22 Aug 2011 05:58:23 +0000 (15:58 +1000)]
Tests - eventscripts - add output for "not implemented" in ctdb stub

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - add an nmap stub
Martin Schwenke [Mon, 22 Aug 2011 05:56:57 +0000 (15:56 +1000)]
Tests - eventscripts - add an nmap stub

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts - stop timeouts waiting for backgrounded testparm
Martin Schwenke [Fri, 19 Aug 2011 06:51:08 +0000 (16:51 +1000)]
Tests - eventscripts - stop timeouts waiting for backgrounded testparm

Not sleeping at all speeds up the tests.  However, it can also cause
timeouts.  Therefore, every time sleep is run we force the stub to do
a short 0.1s sleep instead of whatever is specified.  This should be
enough to avoid races.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - add getdebug and checktcpport to ctdb eventscripts stub
Martin Schwenke [Fri, 19 Aug 2011 03:54:49 +0000 (13:54 +1000)]
Tests - add getdebug and checktcpport to ctdb eventscripts stub

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - add hooks to simulate ctdb commands that aren't implemented
Martin Schwenke [Fri, 19 Aug 2011 03:54:20 +0000 (13:54 +1000)]
Tests - add hooks to simulate ctdb commands that aren't implemented

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - add eventscripts testing stub for sleep command.
Martin Schwenke [Fri, 19 Aug 2011 03:53:05 +0000 (13:53 +1000)]
Tests - add eventscripts testing stub for sleep command.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - Change variable used to fake listening TCP ports.
Martin Schwenke [Fri, 19 Aug 2011 01:35:38 +0000 (11:35 +1000)]
Tests - Change variable used to fake listening TCP ports.

Change from $FAKE_NETSTAT_TCP_LISTEN to $FAKE_TCP_LISTEN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - new NFS share checking tests
Martin Schwenke [Fri, 19 Aug 2011 01:24:56 +0000 (11:24 +1000)]
Tests - new NFS share checking tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - eventscripts exportfs stub should splits lines
Martin Schwenke [Fri, 19 Aug 2011 01:22:51 +0000 (11:22 +1000)]
Tests - eventscripts exportfs stub should splits lines

The real exportfs splits lines longer than 15 characters.  The stub
should do that too...

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTests - add -T (trace) option to eventscripts run_test.sh
Martin Schwenke [Fri, 19 Aug 2011 01:21:33 +0000 (11:21 +1000)]
Tests - add -T (trace) option to eventscripts run_test.sh

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoTools - fix "ctdb scriptstatus -Y" output
Martin Schwenke [Tue, 30 Aug 2011 06:37:04 +0000 (16:37 +1000)]
Tools - fix "ctdb scriptstatus -Y" output

Lines in machine readable output always start with a colon (':').

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - use ctdb scriptstatus -Y when replaying status
Martin Schwenke [Tue, 30 Aug 2011 06:31:17 +0000 (16:31 +1000)]
Eventscripts - use ctdb scriptstatus -Y when replaying status

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts: add a synchronous synthetic reconfigure event.
Martin Schwenke [Mon, 16 May 2011 04:23:28 +0000 (14:23 +1000)]
Eventscripts: add a synchronous synthetic reconfigure event.

In the current code services can only be reconfigured asynchronously.
This means that configuration file changes can be made, an asychronous
reconfigure event can be triggered, and it always succeeds.  Some time
later when a service is actually reconfigured then a failure may be
seen

This adds a synthetic reconfigure event that reconfigures a service
synchronously so that any failure is reported on exit.

ctdb_service_check_reconfigure() is essentially reimplemented.

If a reconfigure event is in flight and an ipreallocated or monitor
event occurs then any scheduled asynchronous reconfigure is deferred
until the next monitor cycle.  This is to avoid reconfigures trampling
on each other.  In this case a monitor event will also replay the
previous status to try to avoid exposing any temporary instability.

If a reconfigure event collides with another reconfigure event it will
exit with status 2, indicating that the reconfigure should be retried.

The reconfigure event is implemented using a subprocess to control the
exit from the synthetic event.

As before, if a monitor event causes a scheduled synchronous
reconfigure to occure then it will replay the previous status for the
service, given that a reconfigure can cause temporary instability.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - call ctdb_check_args() in 00.ctdb
Martin Schwenke [Tue, 23 Aug 2011 06:43:53 +0000 (16:43 +1000)]
Eventscripts - call ctdb_check_args() in 00.ctdb

This is the first eventscript.  Sanity check as early as possible and
everyone benefits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - call ctdb_check_args() instead of doing hand checking
Martin Schwenke [Tue, 23 Aug 2011 06:36:19 +0000 (16:36 +1000)]
Eventscripts - call ctdb_check_args() instead of doing hand checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - new function ctdb_check_args()
Martin Schwenke [Tue, 23 Aug 2011 06:32:34 +0000 (16:32 +1000)]
Eventscripts - new function ctdb_check_args()

Pass this "$@" to do common eventscript argument checking.

For regular use putting this in 00.ctdb would be enough.  However, for
developer testing it can be useful to call this in other eventscripts.
For example, 10.interfaces and 13.per_ip_routing currently check these
by hand.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - ctdb_check_tcp_ports() bug fix.
Martin Schwenke [Fri, 19 Aug 2011 04:20:58 +0000 (14:20 +1000)]
Eventscripts - ctdb_check_tcp_ports() bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - fix debugging buglet in ctdb_check_tcp_ports_ctdb()
Martin Schwenke [Fri, 19 Aug 2011 03:55:55 +0000 (13:55 +1000)]
Eventscripts - fix debugging buglet in ctdb_check_tcp_ports_ctdb()

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.
Martin Schwenke [Mon, 8 Aug 2011 03:13:59 +0000 (13:13 +1000)]
Eventscripts: New configuration variable CTDB_SERVICE_AUTOSTARTSTOP.

Some of the current auto-start/stop logic is broken, particularly for
Samba.  Fixing it is non-trivial.

If $CTDB_SERVICE_AUTOSTARTSTOP is "yes" then auto-start/stop services
when told to newly manage or no longer manage them.  This defaults to
"yes".

However, if using a canned configuration file that doesn't set
$CTDB_SERVICE_AUTOSTARTSTOP then this stops the auto-start-stop logic
from working.  Therefore, this works around CQ S1026685 - on the
system in question another daemon controls service auto-start/stop and
CTDB just gets in the way.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoEventscripts - in 60.nfs uniquify the share check directory list
Martin Schwenke [Wed, 17 Aug 2011 07:42:07 +0000 (17:42 +1000)]
Eventscripts - in 60.nfs uniquify the share check directory list

There are sites that have multiple entries for the same export.  This
optimises the share check in this case.

Signed-off-by: Martin Schwenke <martin@meltin.net>
7 years agoLogging: when we log stdout/stderr messages from eventscripts to the system log...
Ronnie Sahlberg [Thu, 25 Aug 2011 23:39:25 +0000 (09:39 +1000)]
Logging:  when we log stdout/stderr messages from eventscripts to the system log, prefix every line of output with the name of the eventscript.

CQ S1028412

7 years agoLibCTDB : update the ctdb tool to use libctdb to read the recovery mode
Ronnie Sahlberg [Tue, 23 Aug 2011 06:35:08 +0000 (16:35 +1000)]
LibCTDB : update the ctdb tool to use libctdb to read the recovery mode

7 years agoLibCTDB : uptade the ctdb tool to use libctdb to query for the recmaster
Ronnie Sahlberg [Tue, 23 Aug 2011 06:32:38 +0000 (16:32 +1000)]
LibCTDB : uptade the ctdb tool to use libctdb to query for the recmaster

7 years agoLibCTDB : initialize ctdb->pnn to -1 when we create a new context
Ronnie Sahlberg [Tue, 23 Aug 2011 06:15:34 +0000 (16:15 +1000)]
LibCTDB : initialize ctdb->pnn to -1 when we create a new context
but before we learn the pnn of the local node

7 years agoLibCTDB : initialize ctdb->pnn to -1 when we create a new context
Ronnie Sahlberg [Tue, 23 Aug 2011 06:15:34 +0000 (16:15 +1000)]
LibCTDB : initialize ctdb->pnn to -1 when we create a new context
but before we learn the pnn of the local node

7 years agoLibCTDB : change the ctdb_fetch_lock_once test tool to use libctdb instead of the...
Ronnie Sahlberg [Tue, 23 Aug 2011 05:13:40 +0000 (15:13 +1000)]
LibCTDB : change the ctdb_fetch_lock_once test tool to use libctdb instead of the old client

7 years agoLibCTDB : add support for getrecmode
Ronnie Sahlberg [Tue, 23 Aug 2011 05:00:27 +0000 (15:00 +1000)]
LibCTDB : add support for getrecmode

7 years agoLibCTDB : change the ctdb_fetch_lock_once test tool to use libctdb instead of the...
Ronnie Sahlberg [Tue, 23 Aug 2011 05:13:40 +0000 (15:13 +1000)]
LibCTDB : change the ctdb_fetch_lock_once test tool to use libctdb instead of the old client

7 years agoLibCTDB : add support for getrecmode
Ronnie Sahlberg [Tue, 23 Aug 2011 05:00:27 +0000 (15:00 +1000)]
LibCTDB : add support for getrecmode

7 years agoLibCTDB: add commands where an application can query how many commands are active
Ronnie Sahlberg [Tue, 23 Aug 2011 02:43:16 +0000 (12:43 +1000)]
LibCTDB: add commands where an application can query how many commands are active
and we have not yet received a reply to.
Applications may use this command to query if it is "safe" to stop the event system and sleep
or whether it should first wait for all activity to ctdb daemons to cease first.

7 years agoReadOnly: Check the readonly flag instead of whether the tdb pointer is NULL or not
Ronnie Sahlberg [Tue, 23 Aug 2011 00:41:52 +0000 (10:41 +1000)]
ReadOnly: Check the readonly flag instead of whether the tdb pointer is NULL or not

7 years agoReadOnly: add description of readonly records
Ronnie Sahlberg [Tue, 23 Aug 2011 00:37:20 +0000 (10:37 +1000)]
ReadOnly: add description of readonly records

7 years agoReadOnly: clear out the tracking record once a revoke is completed
Ronnie Sahlberg [Wed, 17 Aug 2011 06:14:57 +0000 (16:14 +1000)]
ReadOnly: clear out the tracking record once a revoke is completed

7 years agoReadOnly: When the client wants a readwrite lock but the local node is the dmaster...
Ronnie Sahlberg [Thu, 21 Jul 2011 05:59:37 +0000 (15:59 +1000)]
ReadOnly: When the client wants a readwrite lock but the local node is the dmaster and also have delegations active we must send a CALL to the local daemon to trigger it to revoke the delegations

7 years agoReadOnly: Change the update_record test tool to use the new fetchlock routine that...
Ronnie Sahlberg [Thu, 21 Jul 2011 05:58:56 +0000 (15:58 +1000)]
ReadOnly: Change the update_record test tool to use the new fetchlock routine that can do either normal or readonly fetchlock

7 years agoReadOnly: Add a test tool that requests a readonly delegation in a loop
Ronnie Sahlberg [Wed, 20 Jul 2011 05:47:15 +0000 (15:47 +1000)]
ReadOnly: Add a test tool that requests a readonly delegation in a loop

7 years agoReadOnly: Add a test tool to fetch a record, requesting a readonly delegation and...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:43:55 +0000 (15:43 +1000)]
ReadOnly: Add a test tool to fetch a record, requesting a readonly delegation and lock the record once

7 years agoReadOnly: Add clientside code to fetch readonly records
Ronnie Sahlberg [Wed, 20 Jul 2011 05:37:37 +0000 (15:37 +1000)]
ReadOnly: Add clientside code to fetch readonly records

7 years agoReadOnly: Add a ctdb_ltdb_fetch_readonly() helper function
Ronnie Sahlberg [Wed, 20 Jul 2011 05:31:44 +0000 (15:31 +1000)]
ReadOnly: Add a ctdb_ltdb_fetch_readonly() helper function

7 years agoReadOnly: Add handlign of readonly requests readwrite requests, delegations and revok...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:17:29 +0000 (15:17 +1000)]
ReadOnly: Add handlign of readonly requests readwrite requests, delegations and revoking of delegation to the processing loop for CALL requests coming in from a local client via domain socket

7 years agoReadOnly: Add processing for ReadOnly delegation requests and revoke requests to...
Ronnie Sahlberg [Wed, 20 Jul 2011 05:13:47 +0000 (15:13 +1000)]
ReadOnly: Add processing for ReadOnly delegation requests and revoke requests to the processing loop for CALL packets we receive from different nodes.

This implements the ReadOnly and ReadWrite request processing, delegation and revoking of delegations for all requests coming in across the network from a remote node.

7 years agoReadOnly: Once recovery has finished, make sure to free all revoke child processes...
Ronnie Sahlberg [Wed, 20 Jul 2011 04:25:29 +0000 (14:25 +1000)]
ReadOnly: Once recovery has finished, make sure to free all revoke child processes and trigger the destructors for all deferred calls to re-queue the original packets to the input packet processing function

7 years agoReadOnly: When releasing all deferred calls that blocked during revoke of all previou...
Ronnie Sahlberg [Wed, 20 Jul 2011 04:23:05 +0000 (14:23 +1000)]
ReadOnly: When releasing all deferred calls that blocked during revoke of all previous delegations, add a 1 second grace/delay for any new readonly delegation requests so that the read-write fetch-lock porcess has a chance to make progress