vlendec/samba-autobuild/.git
11 years agoTest suite: Make "ctdb ip" test backward compatible with older ctdb versions.
Martin Schwenke [Wed, 10 Feb 2010 09:27:53 +0000 (20:27 +1100)]
Test suite: Make "ctdb ip" test backward compatible with older ctdb versions.

Recent updates to the test meant that it only worked with the latest
ctdb versions.  This changes things so that we never bother matching
the machine readable header, just the actual data in the output.  It
also takes a slightly more liberal approach in massaging the human
readable output to ensure it matches the machine readable output.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8a1cb5dc1ddf82f3b9cbb23e40b3914b3d5c2783)

11 years agoMerge commit 'origin/master'
Martin Schwenke [Wed, 10 Feb 2010 09:24:28 +0000 (20:24 +1100)]
Merge commit 'origin/master'

(This used to be ctdb commit 19523fbb12db1ec1e5ee38de1b2d3b99a74c6ca4)

11 years agocommands that relate to manual failover of ip addresses (moveip)
Ronnie Sahlberg [Tue, 9 Feb 2010 07:34:47 +0000 (18:34 +1100)]
commands that relate to manual failover of ip addresses (moveip)
can sometimes take long so allow for a longer timeout for the controls used.

(This used to be ctdb commit 144c69b633eeb17e120f962162feed6de3dc16a6)

11 years agodont just exit(0) upon successful completion of waiting for an ipreallocate to finish.
Ronnie Sahlberg [Tue, 9 Feb 2010 03:35:10 +0000 (14:35 +1100)]
dont just exit(0) upon successful completion of waiting for an ipreallocate to finish.
return success back to the caller instead.

otherwise things like 'ctdb enable -n all' will just finish after the first disabled node has become enabled.

(This used to be ctdb commit f4eb41cd3a1099da8265351818fba9bd4688a188)

11 years agoevent scripts: add logging for low memory conditions
Rusty Russell [Tue, 9 Feb 2010 02:16:35 +0000 (12:46 +1030)]
event scripts: add logging for low memory conditions

We should never enter swap; if we do, show the memory state of the machine and the process list.  This will help us diagnose what caused the condition before it's too late and the box starts OOM-killing processes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 627a6d67a0e9e61f8713e62695b3518c51909230)

11 years agoctdb: migrate to new dlinklist.h from Samba
Andrew Tridgell [Sun, 7 Feb 2010 08:02:06 +0000 (19:02 +1100)]
ctdb: migrate to new dlinklist.h from Samba

(This used to be ctdb commit f63c091f12f8d582e9518673365c7c52479c470c)

11 years agoonnode documentation - update documentation to reflect recent onnode changes.
Martin Schwenke [Fri, 5 Feb 2010 04:30:39 +0000 (15:30 +1100)]
onnode documentation - update documentation to reflect recent onnode changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 2fb2eb0fd7396de33474ce43fe95c66a5784d05b)

11 years agoMerge branch 'master' of git://git.samba.org/sahlberg/ctdb
Martin Schwenke [Fri, 5 Feb 2010 03:00:23 +0000 (14:00 +1100)]
Merge branch 'master' of git://git.samba.org/sahlberg/ctdb

(This used to be ctdb commit a442668923d4d8f8d624e00138fe37d76d593d21)

11 years agoctdb: when we fill the client packet queue we need to drop the client
Andrew Tridgell [Thu, 4 Feb 2010 03:36:14 +0000 (14:36 +1100)]
ctdb: when we fill the client packet queue we need to drop the client

We can't just drop packets to the list, as those packets could be part
of the core protocol the client is using. This happens (for example)
when Samba is doing a traverse. If we drop a traverse packet then
Samba hangs indefinately. We are better off dropping the ctdb socket
to Samba.

(This used to be ctdb commit a7a86dafa4d88a6bbc6a71b77ed79a178fd802a6)

11 years agoctdb: move ctdb_io.c to use TLIST_*() macros
Andrew Tridgell [Thu, 4 Feb 2010 03:14:18 +0000 (14:14 +1100)]
ctdb: move ctdb_io.c to use TLIST_*() macros

This will make large packet queues much more efficient

(This used to be ctdb commit e3f198056230073135ea6354bbef30c5bb022f8f)

11 years agoutil: added TLIST_*() macros
Andrew Tridgell [Thu, 4 Feb 2010 03:13:49 +0000 (14:13 +1100)]
util: added TLIST_*() macros

The TLIST_*() macros are like the DLIST_*() macros, but take both a
head and tail pointer for the list. This means that adding an element
to the end of the list is efficient (it doesn't need to walk the
list).

We should move all uses of the DLIST_*() macros which use
DLIST_ADD_END() to use the TLIST_*() macros instead.

(This used to be ctdb commit 2d05a71349e9ade869b62cf261c2a9a21818a474)

11 years agoWhen trying to enable/disable a node.
Ronnie Sahlberg [Wed, 3 Feb 2010 23:03:21 +0000 (10:03 +1100)]
When trying to enable/disable a node.
Check if the node is already enabled/disabled and log an information
message if so.

(This used to be ctdb commit c3eec8f10764a647106087099eeb47b7196f7aac)

11 years agoWe only queued up to 1000 packets per queue before we start dropping
Ronnie Sahlberg [Wed, 3 Feb 2010 22:54:06 +0000 (09:54 +1100)]
We only queued up to 1000 packets per queue before we start dropping
packets, to avoid the queue to grow excessively if smbd has blocked.

This could cause traverse packets to become discarded in case the main
smbd daemon does a traverse of a database while there is a recovery
(sending a erconfigured message to smbd, causing an avalanche of unlock
messages to be sent across the cluster.)

This avalance of messages could cause also the tranversal message to be
discarded  causing the main smbd process to hang indefinitely waiting
for the traversal message that will never arrive.

Bump the maximum queue length before starting to discard messages from
1000 to 1000000 and at the same time rework the queueing slightly so we
can append messages cheaply to the queue instead of walking the list
from head to tail every time.

(This used to be ctdb commit 59ba5d7f80e0465e5076533374fb9ee862ed7bb6)

11 years agoadd two new debug controls to send and receive messages
Ronnie Sahlberg [Wed, 3 Feb 2010 22:45:32 +0000 (09:45 +1100)]
add two new debug controls to send and receive messages

ctdb msglisten and msgsend

(This used to be ctdb commit 8c89aac20260dc7f3746e29fe99f17422a77cb88)

11 years agoDrop the debug level for logging fd creation to DEBUG_DEBUG
Ronnie Sahlberg [Wed, 3 Feb 2010 19:37:41 +0000 (06:37 +1100)]
Drop the debug level for logging fd creation to DEBUG_DEBUG

(This used to be ctdb commit eae1d4f9e52e73b4d8769868fffdafa590d03784)

11 years agotdb: fix an early release of the global lock that can cause data corruption
Volker Lendecke [Fri, 29 Jan 2010 17:21:09 +0000 (18:21 +0100)]
tdb: fix an early release of the global lock that can cause data corruption

There was a bug in tdb where the

                tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1);

(ending the transaction-"mutex") was done before the

                        /* remove the recovery marker */

This means that when a transaction is committed there is a window where another
opener of the file sees the transaction marker while the transaction committer
is still fully functional and working on it. This led to transaction being
rolled back by that second opener of the file while transaction_commit() gave
no error to the caller.

This patch moves the F_UNLCK to after the recovery marker was removed, closing
this window.

(This used to be ctdb commit 898b5edfe757cb145960b8f3631029bfd5592119)

11 years agoeventscripts: stop loadconfig function from loading ctdb config file twice.
Martin Schwenke [Fri, 22 Jan 2010 06:19:12 +0000 (17:19 +1100)]
eventscripts: stop loadconfig function from loading ctdb config file twice.

If "$1" was empty than loadconfig would load the ctdb config twice.
This stops that from happening.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 0406d406da70aaee7ad6aac236114905c5d03ed2)

11 years agoeventscript: Use of $NFS_TICKLE_SHARED_DIRECTORY must be after loadconfig.
Martin Schwenke [Fri, 22 Jan 2010 06:14:50 +0000 (17:14 +1100)]
eventscript: Use of $NFS_TICKLE_SHARED_DIRECTORY must be after loadconfig.

Proper fix for 085d1bea78fabf754ef6dd6d323f74a1d361e45c's workaround.
$NFS_TICKLE_SHARED_DIRECTORY was being used before it is set via
loadconfig.

Ronnie actually spotted this one.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ee8b2e298351d05197a2e1494f3331433644c1e6)

11 years agoinitscript: Remove bash-ism.
Martin Schwenke [Fri, 22 Jan 2010 06:13:17 +0000 (17:13 +1100)]
initscript: Remove bash-ism.

Also, change the order of the comparison so it is consistent with
others in the script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 44696e15cdb23e7656d3bb0ead54f509495738a7)

11 years agoMerge commit 'origin/master'
Martin Schwenke [Fri, 22 Jan 2010 06:05:11 +0000 (17:05 +1100)]
Merge commit 'origin/master'

(This used to be ctdb commit cb00f86752d276ef0ac4dad97f7b380439603286)

11 years agoinitscript: handle spaces in option values inserted into $CTDB_OPTIONS.
Martin Schwenke [Fri, 22 Jan 2010 02:19:00 +0000 (13:19 +1100)]
initscript: handle spaces in option values inserted into $CTDB_OPTIONS.

This puts single quotes around everything and uses eval on the
command-lines that actually start ctdbd.  The eval causes the single
quotes to be interpreted.

The "redhat" init style no longer uses the Red Hat daemon function.
It loses the quoting and re-splits on spaces.  Instead we add an extra
line that uses the success/failure functions to keep things pretty.
Note that this means that we don't respect daemon's
$DAEMON_COREFILE_LIMIT variable but we do our own core file handling
with $CTDB_SUPPRESS_COREFILE anyway.  daemon's core file handling was
probably overriding what we were doing anyway, so this can be regarded
as a bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 522fbb012524fe41a67dbe43589a282dda6bcbe2)

11 years agoinitscript: handle spaces in option values inserted into $CTDB_OPTIONS.
Martin Schwenke [Fri, 22 Jan 2010 02:19:00 +0000 (13:19 +1100)]
initscript: handle spaces in option values inserted into $CTDB_OPTIONS.

This puts single quotes around everything and uses eval on the
command-lines that actually start ctdbd.  The eval causes the single
quotes to be interpreted.

The "redhat" init style no longer uses the Red Hat daemon function.
It loses the quoting and re-splits on spaces.  Instead we add an extra
line that uses the success/failure functions to keep things pretty.
Note that this means that we don't respect daemon's
$DAEMON_COREFILE_LIMIT variable but we do our own core file handling
with $CTDB_SUPPRESS_COREFILE anyway.  daemon's core file handling was
probably overriding what we were doing anyway, so this can be regarded
as a bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9a9b36149042d4d8f455959582ec5c882162266a)

11 years agoonnode: update algorithm for finding nodes file.
Martin Schwenke [Thu, 21 Jan 2010 02:40:03 +0000 (13:40 +1100)]
onnode: update algorithm for finding nodes file.

2 changes:

* If a relative nodes file is specified via -f or $CTDB_NODES_FILE but
  this file does not exist then try looking for the file in /etc/ctdb
  (or $CTDB_BASE if set).

* If a nodes file is specified via -f or $CTDB_NODES_FILE but this
  file does not exist (even when checked as per above) then do not
  fall back to /etc/ctdb/nodes ((or $CTDB_BASE if set).  The old
  behaviour was surprising and hid errors.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 60aa570aaa77d293b963105b3f605f9625a4594b)

11 years agoonnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Martin Schwenke [Thu, 21 Jan 2010 02:16:18 +0000 (13:16 +1100)]
onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 503e4908b3028330bc25dc6de8561dbd53ee6a8d)

11 years agoonnode: update algorithm for finding nodes file.
Martin Schwenke [Thu, 21 Jan 2010 02:40:03 +0000 (13:40 +1100)]
onnode: update algorithm for finding nodes file.

2 changes:

* If a relative nodes file is specified via -f or $CTDB_NODES_FILE but
  this file does not exist then try looking for the file in /etc/ctdb
  (or $CTDB_BASE if set).

* If a nodes file is specified via -f or $CTDB_NODES_FILE but this
  file does not exist (even when checked as per above) then do not
  fall back to /etc/ctdb/nodes ((or $CTDB_BASE if set).  The old
  behaviour was surprising and hid errors.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6b5a5bb62369284585057caf09f05d2d5e3b9927)

11 years agoonnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Martin Schwenke [Thu, 21 Jan 2010 02:16:18 +0000 (13:16 +1100)]
onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a9aa2e06774e8cd59a86d3343d3da2a2769561b5)

11 years agoconfig: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path
Stefan Metzmacher [Mon, 18 Jan 2010 12:05:54 +0000 (13:05 +0100)]
config: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path

This is very useful for testing, I use such a script:

cat ~/bin/ethtool
 #!/bin/sh

 IFACE=$1

 case "$IFACE" in
        Neth2)
                ;;
        Neth3)
                ;;
        Neth4)
                ;;
        Neth5)
                ;;
        *)
                exec /usr/sbin/ethtool $@
                ;;
 esac

 ip link set down $IFACE

 exec /usr/sbin/ethtool $@

metze

(This used to be ctdb commit 3bab985cf615720eded4d47b4f9f37a9c28840aa)

11 years agoserver: reload the public addresses before doing a takeover run
Stefan Metzmacher [Tue, 19 Jan 2010 07:42:48 +0000 (08:42 +0100)]
server: reload the public addresses before doing a takeover run

metze

(This used to be ctdb commit 0e41a2204fa8a1e77dc83c0d4b253ab272b5c72d)

11 years agoserver: ban ourself if the ctdb and kernel knowledge of a public ip differs
Stefan Metzmacher [Mon, 18 Jan 2010 14:04:32 +0000 (15:04 +0100)]
server: ban ourself if the ctdb and kernel knowledge of a public ip differs

metze

(This used to be ctdb commit 48e0af91113d6cead6cae3f28d8d8f610cacaa71)

11 years agoserver: give an error if we're getting an takeover_ip event with a wrong pnn
Stefan Metzmacher [Mon, 18 Jan 2010 14:38:01 +0000 (15:38 +0100)]
server: give an error if we're getting an takeover_ip event with a wrong pnn

metze

(This used to be ctdb commit 2f44d6f3d290cc1b37b19ec34edfbad12cc0c0a7)

11 years agoserver: return an error if we get an takeover ip event and we cannot serve the ip
Stefan Metzmacher [Mon, 18 Jan 2010 14:08:15 +0000 (15:08 +0100)]
server: return an error if we get an takeover ip event and we cannot serve the ip

metze

(This used to be ctdb commit f5c221e6abc118aefa489aa7e07755af952fd2bb)

11 years agoserver: print node number as signed integer on release ip event
Stefan Metzmacher [Mon, 18 Jan 2010 14:12:46 +0000 (15:12 +0100)]
server: print node number as signed integer on release ip event

metze

(This used to be ctdb commit 6c456face30606641f6b8beaad3121c9b05ca763)

11 years agoserver: debug redundant takeover ip events with level INFO
Stefan Metzmacher [Mon, 18 Jan 2010 14:22:16 +0000 (15:22 +0100)]
server: debug redundant takeover ip events with level INFO

metze

(This used to be ctdb commit 7bc9969c4c28f2c4a4848bd730db3c63bb9204fe)

11 years agoserver: be less verbose on redundant release_ip events
Stefan Metzmacher [Mon, 18 Jan 2010 14:04:32 +0000 (15:04 +0100)]
server: be less verbose on redundant release_ip events

metze

(This used to be ctdb commit 72ef5f891f85ce51f5ca7e0c03d0c7cc955be110)

11 years agoserver: add a ctdb_do_updateip()
Stefan Metzmacher [Sat, 16 Jan 2010 14:01:17 +0000 (15:01 +0100)]
server: add a ctdb_do_updateip()

metze

(This used to be ctdb commit eded224368dded2264e53546c196b1b485cb2094)

11 years agoserver: split out a ctdb_do_takeover_ip() function
Stefan Metzmacher [Sat, 16 Jan 2010 12:30:58 +0000 (13:30 +0100)]
server: split out a ctdb_do_takeover_ip() function

metze

(This used to be ctdb commit 8fd6f4aab0c173b4c9c4c02c546e7d2ec1a98423)

11 years agoserver: split out a ctdb_announce_vnn_iface() function
Stefan Metzmacher [Sat, 16 Jan 2010 12:20:45 +0000 (13:20 +0100)]
server: split out a ctdb_announce_vnn_iface() function

metze

(This used to be ctdb commit ec87a51660cfa8a6851923f757fed31f7ffc7153)

11 years agoevents: add updateip event to 13.per_ip_routing
Stefan Metzmacher [Mon, 21 Dec 2009 07:45:19 +0000 (08:45 +0100)]
events: add updateip event to 13.per_ip_routing

metze

(This used to be ctdb commit 829150e814a5e6c85d0f21421f46f41e81d74c53)

11 years agoevents: 10.interface handle updateip event
Stefan Metzmacher [Mon, 21 Dec 2009 07:40:50 +0000 (08:40 +0100)]
events: 10.interface handle updateip event

metze

(This used to be ctdb commit a5cdf1277387f8c6292153c37fa9ceb64707d04f)

11 years agoserver: add updateip event
Stefan Metzmacher [Mon, 21 Dec 2009 07:33:55 +0000 (08:33 +0100)]
server: add updateip event

metze

(This used to be ctdb commit 712ed0c4c0bff1be9e96a54b62512787a4aa6259)

11 years agoconfig: add CTDB_PARTIALLY_ONLINE_INTERFACES to ctdb.sysconfig
Stefan Metzmacher [Mon, 21 Dec 2009 13:02:03 +0000 (14:02 +0100)]
config: add CTDB_PARTIALLY_ONLINE_INTERFACES to ctdb.sysconfig

With this option set to "yes", we don't become unhealthy
as long as at least one interface is still available.

metze

(This used to be ctdb commit d054eb33c6ae92560cddb40732e5dcf622591a3c)

11 years agoserver: start with disabled interfaces and let the event scripts enable the interface...
Stefan Metzmacher [Mon, 21 Dec 2009 18:18:10 +0000 (19:18 +0100)]
server: start with disabled interfaces and let the event scripts enable the interfaces explicit

This makes sure that we don't get public addresses assigned during the
initial recovery and remove them again in the startup event.

metze

(This used to be ctdb commit f872e8c63a2f8979e6a0d088630575bdd4d7b4f1)

11 years agoconfig: 10.interfaces call monitor_interfaces on startup
Stefan Metzmacher [Tue, 22 Dec 2009 14:25:30 +0000 (15:25 +0100)]
config: 10.interfaces call monitor_interfaces on startup

metze

(This used to be ctdb commit 615dec051c26aac628f120e96bf12fb39fc6d28a)

11 years agoconfig: 10.interfaces call ctdb ifaces and ctdb setifacelink for monitoring
Stefan Metzmacher [Tue, 22 Dec 2009 14:25:30 +0000 (15:25 +0100)]
config: 10.interfaces call ctdb ifaces and ctdb setifacelink for monitoring

metze

(This used to be ctdb commit c465f63585c419ba59a6b04cbbf78ae615a7259d)

11 years agoevents: splitout a monitor_interfaces function in 10.interface
Stefan Metzmacher [Mon, 14 Dec 2009 10:59:45 +0000 (11:59 +0100)]
events: splitout a monitor_interfaces function in 10.interface

metze

(This used to be ctdb commit b5ba56dea57db97d6c6ba3e7582e74fe0e3041fc)

11 years agoserver: monitor interfaces in verify_ip_allocation()
Stefan Metzmacher [Tue, 22 Dec 2009 14:21:08 +0000 (15:21 +0100)]
server: monitor interfaces in verify_ip_allocation()

metze

(This used to be ctdb commit 965a65520693e3731b5b0250127b04c777087808)

11 years agoserver: only trigger one takeover run in verify_ip_allocation()
Stefan Metzmacher [Tue, 22 Dec 2009 14:21:08 +0000 (15:21 +0100)]
server: only trigger one takeover run in verify_ip_allocation()

metze

(This used to be ctdb commit 10bc087d0280057962177721bdd6d4f28743b311)

11 years agotools/ctdb: add PartiallyOnline state for "ctdb status" and "ctdb status -Y"
Stefan Metzmacher [Mon, 21 Dec 2009 12:30:45 +0000 (13:30 +0100)]
tools/ctdb: add PartiallyOnline state for "ctdb status" and "ctdb status -Y"

This is based on the GET_IFACES control against each node.

metze

(This used to be ctdb commit 38cb972382a09f830673277d0a9bd5d20deafff2)

11 years agotools/ctdb: display interfaces in "ctdb ip" and "ctdb ip -Y" outputs
Stefan Metzmacher [Sat, 16 Jan 2010 09:36:35 +0000 (10:36 +0100)]
tools/ctdb: display interfaces in "ctdb ip" and "ctdb ip -Y" outputs

metze

(This used to be ctdb commit dffa2b05acce8b73c2fdd085311732bf57f01b7f)

11 years agotests: add a all_ips_on_node() helper function that wraps ctdb ip -Y
Stefan Metzmacher [Sat, 16 Jan 2010 09:35:41 +0000 (10:35 +0100)]
tests: add a all_ips_on_node() helper function that wraps ctdb ip -Y

metze

(This used to be ctdb commit c24fbea156dfdc9154e94eace725526e44cbcdac)

11 years agotests/simple/11_ctdb_ip.sh: be more strict in checking ctdb ip -Y output
Stefan Metzmacher [Fri, 15 Jan 2010 09:53:14 +0000 (10:53 +0100)]
tests/simple/11_ctdb_ip.sh: be more strict in checking ctdb ip -Y output

metze

(This used to be ctdb commit 27bde04966e22975777b4034dbaccfe158369110)

11 years agotools/ctdb: add "ctdb ipinfo <ip>"
Stefan Metzmacher [Thu, 17 Dec 2009 10:23:59 +0000 (11:23 +0100)]
tools/ctdb: add "ctdb ipinfo <ip>"

metze

(This used to be ctdb commit e05e236fc019bfd3b316609a7c190e0e028a4bbc)

11 years agotools/ctdb: add "ctdb setifacelink <iface> <status>"
Stefan Metzmacher [Wed, 16 Dec 2009 16:02:23 +0000 (17:02 +0100)]
tools/ctdb: add "ctdb setifacelink <iface> <status>"

metze

(This used to be ctdb commit 8d0c00b60db69bd10f12da4c676e1142dc37af7a)

11 years agotools/ctdb: add "ctdb ifaces"
Stefan Metzmacher [Wed, 16 Dec 2009 15:50:23 +0000 (16:50 +0100)]
tools/ctdb: add "ctdb ifaces"

metze

(This used to be ctdb commit 80053d09eed967fb76898f4a53437bed2b43a02f)

11 years agoserver: implement ctdb_control_set_iface_link()
Stefan Metzmacher [Thu, 17 Dec 2009 09:30:36 +0000 (10:30 +0100)]
server: implement ctdb_control_set_iface_link()

This only marks the interface status and doesn't
generate any directly triggered action.

The actions is later taken by the recovery process
in verify_ip_allocation.

metze

(This used to be ctdb commit cff58b27c970e9252d131125941c372019fd6660)

11 years agoserver: implement ctdb_control_get_ifaces()
Stefan Metzmacher [Wed, 16 Dec 2009 10:14:44 +0000 (11:14 +0100)]
server: implement ctdb_control_get_ifaces()

metze

(This used to be ctdb commit 0e982a416a126d9856145c19baef320cd0e71d66)

11 years agoserver: implement ctdb_control_get_public_ip_info()
Stefan Metzmacher [Wed, 16 Dec 2009 10:20:28 +0000 (11:20 +0100)]
server: implement ctdb_control_get_public_ip_info()

metze

(This used to be ctdb commit 486fbd15f4cc4f45a4c110b2ddbba48bade22c9f)

11 years agoclient: implement ctdb_ctrl_set_iface_link()
Stefan Metzmacher [Wed, 16 Dec 2009 15:18:36 +0000 (16:18 +0100)]
client: implement ctdb_ctrl_set_iface_link()

metze

(This used to be ctdb commit e2d6582001be28c1800e4da8b0f2dc541538c314)

11 years agoclient: implement ctdb_ctrl_get_ifaces()
Stefan Metzmacher [Wed, 16 Dec 2009 14:30:07 +0000 (15:30 +0100)]
client: implement ctdb_ctrl_get_ifaces()

metze

(This used to be ctdb commit a21e3765dd83e837d93111f387448bf0a5dd4652)

11 years agoclient: implement ctdb_ctrl_get_public_ip_info()
Stefan Metzmacher [Wed, 16 Dec 2009 15:23:08 +0000 (16:23 +0100)]
client: implement ctdb_ctrl_get_public_ip_info()

metze

(This used to be ctdb commit 4efab41dfa61d5c7951c583d584df3455ee9c704)

11 years agocontrols: add stups for GET_PUBLIC_IP_INFO, GET_IFACES and SET_IFACE_LINK_STATE
Stefan Metzmacher [Wed, 16 Dec 2009 13:40:21 +0000 (14:40 +0100)]
controls: add stups for GET_PUBLIC_IP_INFO, GET_IFACES and SET_IFACE_LINK_STATE

metze

(This used to be ctdb commit a2c9e4578e149eccb2c6183f64a6b657eb95c5e1)

11 years agoserver: use CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE during a takeover run
Stefan Metzmacher [Wed, 16 Dec 2009 15:09:40 +0000 (16:09 +0100)]
server: use CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE during a takeover run

We know ask for the known and available interfaces.
This means a node gets a RELEASE_IP event for all interfaces
it "knows", but doesn't serve and a node only gets a TAKE_IP event
for "available" interfaces.

metze

(This used to be ctdb commit a695a38e49e7c3e15a9706392dc920eeab1f11ba)

11 years agoserver: implement CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE behavior
Stefan Metzmacher [Wed, 16 Dec 2009 15:08:45 +0000 (16:08 +0100)]
server: implement CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE behavior

metze

(This used to be ctdb commit 09a5c59bc8d1301edf60d7ae77504dc6d11a7da2)

11 years agoclient: add CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE ctdb_ctrl_get_public_ips_flags()
Stefan Metzmacher [Wed, 16 Dec 2009 14:50:06 +0000 (15:50 +0100)]
client: add CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE ctdb_ctrl_get_public_ips_flags()

metze

(This used to be ctdb commit 6bd780510058e5589f2f7c3722d37acbba4935ab)

11 years agoreserve upper bits in ctdb_control->flags for opcode specific flags
Stefan Metzmacher [Mon, 21 Dec 2009 11:10:18 +0000 (12:10 +0100)]
reserve upper bits in ctdb_control->flags for opcode specific flags

metze

(This used to be ctdb commit 91122c322fbec08138b92c528d9a946f6727b4fd)

11 years agoserver: keep the interface information in a list of ctdb_iface structures
Stefan Metzmacher [Wed, 16 Dec 2009 09:39:40 +0000 (10:39 +0100)]
server: keep the interface information in a list of ctdb_iface structures

metze

(This used to be ctdb commit ff5291778f0752e176539397e9530dcf0e546bea)

11 years agoserver: we don't need to copy strings we pass as talloc_asprintf() arguments
Stefan Metzmacher [Wed, 16 Dec 2009 08:48:21 +0000 (09:48 +0100)]
server: we don't need to copy strings we pass as talloc_asprintf() arguments

metze

(This used to be ctdb commit 080ba5ac2195fb73ef6f18740abdde57a7b97151)

11 years agoevents: 10.interfaces allow multiple interfaces per public address
Stefan Metzmacher [Mon, 21 Dec 2009 07:39:21 +0000 (08:39 +0100)]
events: 10.interfaces allow multiple interfaces per public address

metze

(This used to be ctdb commit f9837f8b6f887d28f29aeb3eeffe8cfb423b40b4)

11 years agoserver: allow multiple interfaces comma separated in public_addresses
Stefan Metzmacher [Mon, 14 Dec 2009 17:52:06 +0000 (18:52 +0100)]
server: allow multiple interfaces comma separated in public_addresses

metze

(This used to be ctdb commit 33a00ef7233051acdbc66410130ec5d876a8422f)

11 years agoserver: add a ctdb_vnn_iface_string() helper function to access vnn->iface
Stefan Metzmacher [Wed, 16 Dec 2009 07:54:02 +0000 (08:54 +0100)]
server: add a ctdb_vnn_iface_string() helper function to access vnn->iface

metze

(This used to be ctdb commit 9e5532e215892b2e0aadd9b106a730727f92c62e)

11 years agoserver: add a ctdb_set_single_public_ip() helper function
Stefan Metzmacher [Mon, 14 Dec 2009 18:33:35 +0000 (19:33 +0100)]
server: add a ctdb_set_single_public_ip() helper function

metze

(This used to be ctdb commit 400b4806c4a9686a2ee6398b5d7c3e0ca0793fd1)

11 years agoconfig: add 13.per_ip_routing event script
Stefan Metzmacher [Sat, 19 Dec 2009 17:26:01 +0000 (18:26 +0100)]
config: add 13.per_ip_routing event script

With this script it's possible to generate routing tables
per public ip address.

metze

(This used to be ctdb commit ff5678fbec2daef461143acf00cef3f94d7655fc)

11 years agoconfig: add some ipv4 helper shell functions
Stefan Metzmacher [Fri, 11 Dec 2009 18:56:36 +0000 (19:56 +0100)]
config: add some ipv4 helper shell functions

Many thanks to Michael Adam <obnox@samba.org>
for the basic work.

metze

(This used to be ctdb commit ff9c641763702ae99632bbf4d0825d578440c074)

11 years agoconfig: add interface_modify.sh and call it under flock to make modification on inter...
Stefan Metzmacher [Wed, 20 Jan 2010 10:10:48 +0000 (11:10 +0100)]
config: add interface_modify.sh and call it under flock to make modification on interfaces atomic

When two releaseip events run in parallel it's possible that the 2nd script
readds a secondary ip that was removed by the 1st script.

metze

(This used to be ctdb commit e02417b2a55c45ac2c125b1b3463c9c39e7bc07a)

11 years agoevents/10.interfaces: move some parts to helper functions
Stefan Metzmacher [Fri, 18 Dec 2009 10:08:22 +0000 (11:08 +0100)]
events/10.interfaces: move some parts to helper functions

metze

(This used to be ctdb commit 24cd42769d8f32b90a8876a6a08a36ab23076cd1)

11 years agoconfig/functions: add tickle_tcp_connections()
Stefan Metzmacher [Fri, 18 Dec 2009 08:43:20 +0000 (09:43 +0100)]
config/functions: add tickle_tcp_connections()

metze

(This used to be ctdb commit 2397f13d7b5ca3847ef148187c6b179d06f6a47a)

11 years agoserver: add "init" event
Stefan Metzmacher [Tue, 19 Jan 2010 09:07:14 +0000 (10:07 +0100)]
server: add "init" event

This is needed because the "startup" event runs after the initial recovery,
but we need to do some actions before the initial recovery.

metze

(This used to be ctdb commit e953808449c102258abb6cba6f4abf486dda3b82)

11 years agoserver: setup fault handler to get the build-in backtrace support
Stefan Metzmacher [Thu, 7 Jan 2010 08:21:56 +0000 (09:21 +0100)]
server: setup fault handler to get the build-in backtrace support

The panic action feature will be added later.

metze

(This used to be ctdb commit 37d11895e96ba8bc8c9ba159083970c45f76d9bb)

11 years agolib/util: add pre and post panic action hooks
Stefan Metzmacher [Tue, 12 Jan 2010 11:17:00 +0000 (12:17 +0100)]
lib/util: add pre and post panic action hooks

metze

(This used to be ctdb commit e366e77ba170d2c27110c56004ae1adf97abef9e)

11 years agolib/util: import fault/backtrace handling from samba.
Stefan Metzmacher [Fri, 18 Dec 2009 11:32:38 +0000 (12:32 +0100)]
lib/util: import fault/backtrace handling from samba.

metze

(This used to be ctdb commit 8171d66f0061fe23ed6dfef87ffe63bfc19596eb)

11 years agoconfigure: don't overwrite AC_CHECK_FUNC_EXT and AC_CHECK_LIB_EXT
Stefan Metzmacher [Fri, 18 Dec 2009 11:14:28 +0000 (12:14 +0100)]
configure: don't overwrite AC_CHECK_FUNC_EXT and AC_CHECK_LIB_EXT

This has curently no affect on the generated configure and config.h.in files.

metze

(This used to be ctdb commit 9d39ada437b02d84b70a5fea78b61bbb32f16d81)

11 years agomove DEBUG* macros to one place
Stefan Metzmacher [Sat, 19 Dec 2009 10:40:06 +0000 (11:40 +0100)]
move DEBUG* macros to one place

metze

(This used to be ctdb commit 4b4dd5d7f81bf226e05c7f3d40087043da1517a2)

11 years agotools/ctdb: display INACTIVE status in "ctdb status" and "ctdb status -Y"
Stefan Metzmacher [Mon, 21 Dec 2009 12:34:21 +0000 (13:34 +0100)]
tools/ctdb: display INACTIVE status in "ctdb status" and "ctdb status -Y"

metze

(This used to be ctdb commit 18af37e99ef8ff5623161495be432abfe5e3407f)

11 years agoserver: add missing goto again after do_recovery()
Stefan Metzmacher [Tue, 19 Jan 2010 07:38:53 +0000 (08:38 +0100)]
server: add missing goto again after do_recovery()

metze

(This used to be ctdb commit 898894d3acbcc0add2ab0706a3172a446622f687)

11 years agolib/events: finish "Run only one event for each epoll_wait/select call"
Stefan Metzmacher [Mon, 18 Jan 2010 12:19:29 +0000 (13:19 +0100)]
lib/events: finish "Run only one event for each epoll_wait/select call"

This finished commit a78b8ea7168e5fdb2d62379ad3112008b2748576.

The logic was missing in events_standard (the one that's used by default).

metze

(This used to be ctdb commit 49f0488a5e60c74b6b8361dffcd09ebb2db740f0)

11 years agosource the nfs sysconfig file from the 61.nfstickles script
Ronnie Sahlberg [Tue, 19 Jan 2010 23:35:02 +0000 (10:35 +1100)]
source the nfs sysconfig file from the 61.nfstickles script

(This used to be ctdb commit 085d1bea78fabf754ef6dd6d323f74a1d361e45c)

11 years agodocument the in-memory ringbuffer for logging and the commands
Ronnie Sahlberg [Fri, 15 Jan 2010 05:01:51 +0000 (16:01 +1100)]
document the in-memory ringbuffer for logging and the commands
used to set it up and manage it.

(This used to be ctdb commit 037e64e1900f09e699d5fce50df2850f26f47f91)

11 years agoMake the size of the in memory ringbuffer for keeping the recent log messages
Ronnie Sahlberg [Fri, 15 Jan 2010 04:38:56 +0000 (15:38 +1100)]
Make the size of the in memory ringbuffer for keeping the recent log messages
configureable using --log-ringbuf-size=<num-entries>.

Add an entry in the sysconfig file to set this persistently.

(This used to be ctdb commit c79c2da69bc352f509e7fca4b9172a4b7f23c0f8)

11 years agonew version 1.0.113
Ronnie Sahlberg [Tue, 12 Jan 2010 20:12:08 +0000 (07:12 +1100)]
new version 1.0.113

(This used to be ctdb commit 4bcb07c412260147cd926452287885d05b2344c1)

11 years agoMerge commit 'metze/master-for-ronnie'
Ronnie Sahlberg [Tue, 12 Jan 2010 20:01:40 +0000 (07:01 +1100)]
Merge commit 'metze/master-for-ronnie'

(This used to be ctdb commit 4cc9c79bfced9efa0d3817021512c86ed2fa3516)

11 years agoserver: call event_add_fd at the end of ctdb_set_child_logging()
Stefan Metzmacher [Thu, 7 Jan 2010 12:29:09 +0000 (13:29 +0100)]
server: call event_add_fd at the end of ctdb_set_child_logging()

metze

(This used to be ctdb commit 608e0765130aa9bca0aa77db5a888c413867a3fd)

11 years agoctdb_logging: simplify ctdb_fork_with_logging a lot and reduce the syscall usage
Stefan Metzmacher [Thu, 7 Jan 2010 12:47:46 +0000 (13:47 +0100)]
ctdb_logging: simplify ctdb_fork_with_logging a lot and reduce the syscall usage

metze

(This used to be ctdb commit acb98c36a3d56fa6b34747015b913ada3eaa133f)

11 years agoNew version 1.0.112.
Martin Schwenke [Tue, 12 Jan 2010 10:07:45 +0000 (21:07 +1100)]
New version 1.0.112.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 64ae8b0702cfdc44a778e0cc3705dd685f9f6ab0)

11 years agoRevert "Use wbinfo --ping-dc isntead of wbingo -p sicne this is a more reliable way...
Martin Schwenke [Tue, 12 Jan 2010 10:02:44 +0000 (21:02 +1100)]
Revert "Use wbinfo --ping-dc isntead of wbingo -p sicne this is a more reliable way to determine if winbindd is in a useful state."

This reverts commit 7c95e56ba871a4e0cb893a5cb5d821e7ff6e6dd6.

wbinfo --ping-dc is proving too unreliable.

(This used to be ctdb commit b70021856e76df1ba407c83cfc19bf332fbfc869)

11 years agoRevert "events/50.samba: only use wbinfo --ping-dc if available"
Martin Schwenke [Tue, 12 Jan 2010 10:02:11 +0000 (21:02 +1100)]
Revert "events/50.samba: only use wbinfo --ping-dc if available"

This reverts commit 7b73834ba3ac197cc8a3020c111f9bb2c567e70b.

wbinfo --ping-dc is proving too unreliable.

(This used to be ctdb commit 178f429a7b6d1008d35e857b6ca1df6adb60d255)

11 years agoMerge commit 'origin/master'
Martin Schwenke [Thu, 7 Jan 2010 01:46:26 +0000 (12:46 +1100)]
Merge commit 'origin/master'

(This used to be ctdb commit bb9fc8b4388848863fa2b8735bd77eb07b7b5849)

11 years agoNew version 1.0.111
Ronnie Sahlberg [Fri, 18 Dec 2009 04:16:04 +0000 (15:16 +1100)]
New version 1.0.111

(This used to be ctdb commit 484ae893f2179bebd0e2a2efe5f9619a39e48227)

11 years agoeventscript: fix bug when script is aborted
Rusty Russell [Fri, 18 Dec 2009 03:43:09 +0000 (14:13 +1030)]
eventscript: fix bug when script is aborted

Another corner case when we terminate running monitor scripts to run
something else: logging can flush the output and we write to a NULL
pointer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit eb22c34bccc8a04fcf63efa2bc48d9788709382e)

11 years agoeventscript: remove cb_status, fix uninitialized bug when monitoring aborted
Rusty Russell [Fri, 18 Dec 2009 03:24:40 +0000 (13:54 +1030)]
eventscript: remove cb_status, fix uninitialized bug when monitoring aborted

(Reapplied with merge after accidental revert)

Previously we updated cb_status a each script finished.  Since we're storing
the status anyway, we can calculate it by iterating the scripts array
itself, providing clear and uniform behavior on all code paths.

In particular, this fixes a longstanding bug when we abort monitor
scripts to run some other script: the cb_status was uninitialized.  In
this case, we need to hand *something* to the callback; 0 might make
us go healthy when we shouldn't.  So we use the last status (normally,
this will be the just-saved current status).

In addition, we make the case of failing the first fork for the script
and failing other script forks the same: the error is returned via the
callback and saved for viewing through 'ctdb scriptstatus'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 2c84fe393ff2b961abf77d58a371c24db5ecb93b)

11 years agoMerge commit 'origin/master'
Martin Schwenke [Fri, 18 Dec 2009 03:44:25 +0000 (14:44 +1100)]
Merge commit 'origin/master'

(This used to be ctdb commit 82e1c5231c389bea935328a08ecf9b0b3a3979ef)