[SCM] CTDB repository - branch master updated - ctdb-1.0.113-64-g60aa570
Ronnie Sahlberg
sahlberg at samba.org
Thu Jan 21 00:53:15 MST 2010
The branch, master has been updated
via 60aa570aaa77d293b963105b3f605f9625a4594b (commit)
via 503e4908b3028330bc25dc6de8561dbd53ee6a8d (commit)
via 3bab985cf615720eded4d47b4f9f37a9c28840aa (commit)
via 0e41a2204fa8a1e77dc83c0d4b253ab272b5c72d (commit)
via 48e0af91113d6cead6cae3f28d8d8f610cacaa71 (commit)
via 2f44d6f3d290cc1b37b19ec34edfbad12cc0c0a7 (commit)
via f5c221e6abc118aefa489aa7e07755af952fd2bb (commit)
via 6c456face30606641f6b8beaad3121c9b05ca763 (commit)
via 7bc9969c4c28f2c4a4848bd730db3c63bb9204fe (commit)
via 72ef5f891f85ce51f5ca7e0c03d0c7cc955be110 (commit)
via eded224368dded2264e53546c196b1b485cb2094 (commit)
via 8fd6f4aab0c173b4c9c4c02c546e7d2ec1a98423 (commit)
via ec87a51660cfa8a6851923f757fed31f7ffc7153 (commit)
via 829150e814a5e6c85d0f21421f46f41e81d74c53 (commit)
via a5cdf1277387f8c6292153c37fa9ceb64707d04f (commit)
via 712ed0c4c0bff1be9e96a54b62512787a4aa6259 (commit)
via d054eb33c6ae92560cddb40732e5dcf622591a3c (commit)
via f872e8c63a2f8979e6a0d088630575bdd4d7b4f1 (commit)
via 615dec051c26aac628f120e96bf12fb39fc6d28a (commit)
via c465f63585c419ba59a6b04cbbf78ae615a7259d (commit)
via b5ba56dea57db97d6c6ba3e7582e74fe0e3041fc (commit)
via 965a65520693e3731b5b0250127b04c777087808 (commit)
via 10bc087d0280057962177721bdd6d4f28743b311 (commit)
via 38cb972382a09f830673277d0a9bd5d20deafff2 (commit)
via dffa2b05acce8b73c2fdd085311732bf57f01b7f (commit)
via c24fbea156dfdc9154e94eace725526e44cbcdac (commit)
via 27bde04966e22975777b4034dbaccfe158369110 (commit)
via e05e236fc019bfd3b316609a7c190e0e028a4bbc (commit)
via 8d0c00b60db69bd10f12da4c676e1142dc37af7a (commit)
via 80053d09eed967fb76898f4a53437bed2b43a02f (commit)
via cff58b27c970e9252d131125941c372019fd6660 (commit)
via 0e982a416a126d9856145c19baef320cd0e71d66 (commit)
via 486fbd15f4cc4f45a4c110b2ddbba48bade22c9f (commit)
via e2d6582001be28c1800e4da8b0f2dc541538c314 (commit)
via a21e3765dd83e837d93111f387448bf0a5dd4652 (commit)
via 4efab41dfa61d5c7951c583d584df3455ee9c704 (commit)
via a2c9e4578e149eccb2c6183f64a6b657eb95c5e1 (commit)
via a695a38e49e7c3e15a9706392dc920eeab1f11ba (commit)
via 09a5c59bc8d1301edf60d7ae77504dc6d11a7da2 (commit)
via 6bd780510058e5589f2f7c3722d37acbba4935ab (commit)
via 91122c322fbec08138b92c528d9a946f6727b4fd (commit)
via ff5291778f0752e176539397e9530dcf0e546bea (commit)
via 080ba5ac2195fb73ef6f18740abdde57a7b97151 (commit)
via f9837f8b6f887d28f29aeb3eeffe8cfb423b40b4 (commit)
via 33a00ef7233051acdbc66410130ec5d876a8422f (commit)
via 9e5532e215892b2e0aadd9b106a730727f92c62e (commit)
via 400b4806c4a9686a2ee6398b5d7c3e0ca0793fd1 (commit)
via ff5678fbec2daef461143acf00cef3f94d7655fc (commit)
via ff9c641763702ae99632bbf4d0825d578440c074 (commit)
via e02417b2a55c45ac2c125b1b3463c9c39e7bc07a (commit)
via 24cd42769d8f32b90a8876a6a08a36ab23076cd1 (commit)
via 2397f13d7b5ca3847ef148187c6b179d06f6a47a (commit)
via e953808449c102258abb6cba6f4abf486dda3b82 (commit)
via 37d11895e96ba8bc8c9ba159083970c45f76d9bb (commit)
via e366e77ba170d2c27110c56004ae1adf97abef9e (commit)
via 8171d66f0061fe23ed6dfef87ffe63bfc19596eb (commit)
via 9d39ada437b02d84b70a5fea78b61bbb32f16d81 (commit)
via 4b4dd5d7f81bf226e05c7f3d40087043da1517a2 (commit)
via 18af37e99ef8ff5623161495be432abfe5e3407f (commit)
via 898894d3acbcc0add2ab0706a3172a446622f687 (commit)
via 49f0488a5e60c74b6b8361dffcd09ebb2db740f0 (commit)
from 085d1bea78fabf754ef6dd6d323f74a1d361e45c (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 60aa570aaa77d293b963105b3f605f9625a4594b
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Jan 21 13:40:03 2010 +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 at meltin.net>
commit 503e4908b3028330bc25dc6de8561dbd53ee6a8d
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Jan 21 13:16:18 2010 +1100
onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 3bab985cf615720eded4d47b4f9f37a9c28840aa
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 13:05:54 2010 +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
commit 0e41a2204fa8a1e77dc83c0d4b253ab272b5c72d
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jan 19 08:42:48 2010 +0100
server: reload the public addresses before doing a takeover run
metze
commit 48e0af91113d6cead6cae3f28d8d8f610cacaa71
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:04:32 2010 +0100
server: ban ourself if the ctdb and kernel knowledge of a public ip differs
metze
commit 2f44d6f3d290cc1b37b19ec34edfbad12cc0c0a7
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:38:01 2010 +0100
server: give an error if we're getting an takeover_ip event with a wrong pnn
metze
commit f5c221e6abc118aefa489aa7e07755af952fd2bb
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:08:15 2010 +0100
server: return an error if we get an takeover ip event and we cannot serve the ip
metze
commit 6c456face30606641f6b8beaad3121c9b05ca763
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:12:46 2010 +0100
server: print node number as signed integer on release ip event
metze
commit 7bc9969c4c28f2c4a4848bd730db3c63bb9204fe
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:22:16 2010 +0100
server: debug redundant takeover ip events with level INFO
metze
commit 72ef5f891f85ce51f5ca7e0c03d0c7cc955be110
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 15:04:32 2010 +0100
server: be less verbose on redundant release_ip events
metze
commit eded224368dded2264e53546c196b1b485cb2094
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Jan 16 15:01:17 2010 +0100
server: add a ctdb_do_updateip()
metze
commit 8fd6f4aab0c173b4c9c4c02c546e7d2ec1a98423
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Jan 16 13:30:58 2010 +0100
server: split out a ctdb_do_takeover_ip() function
metze
commit ec87a51660cfa8a6851923f757fed31f7ffc7153
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Jan 16 13:20:45 2010 +0100
server: split out a ctdb_announce_vnn_iface() function
metze
commit 829150e814a5e6c85d0f21421f46f41e81d74c53
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 08:45:19 2009 +0100
events: add updateip event to 13.per_ip_routing
metze
commit a5cdf1277387f8c6292153c37fa9ceb64707d04f
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 08:40:50 2009 +0100
events: 10.interface handle updateip event
metze
commit 712ed0c4c0bff1be9e96a54b62512787a4aa6259
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 08:33:55 2009 +0100
server: add updateip event
metze
commit d054eb33c6ae92560cddb40732e5dcf622591a3c
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 14:02:03 2009 +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
commit f872e8c63a2f8979e6a0d088630575bdd4d7b4f1
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 19:18:10 2009 +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
commit 615dec051c26aac628f120e96bf12fb39fc6d28a
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 22 15:25:30 2009 +0100
config: 10.interfaces call monitor_interfaces on startup
metze
commit c465f63585c419ba59a6b04cbbf78ae615a7259d
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 22 15:25:30 2009 +0100
config: 10.interfaces call ctdb ifaces and ctdb setifacelink for monitoring
metze
commit b5ba56dea57db97d6c6ba3e7582e74fe0e3041fc
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 14 11:59:45 2009 +0100
events: splitout a monitor_interfaces function in 10.interface
metze
commit 965a65520693e3731b5b0250127b04c777087808
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 22 15:21:08 2009 +0100
server: monitor interfaces in verify_ip_allocation()
metze
commit 10bc087d0280057962177721bdd6d4f28743b311
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 22 15:21:08 2009 +0100
server: only trigger one takeover run in verify_ip_allocation()
metze
commit 38cb972382a09f830673277d0a9bd5d20deafff2
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 13:30:45 2009 +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
commit dffa2b05acce8b73c2fdd085311732bf57f01b7f
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Jan 16 10:36:35 2010 +0100
tools/ctdb: display interfaces in "ctdb ip" and "ctdb ip -Y" outputs
metze
commit c24fbea156dfdc9154e94eace725526e44cbcdac
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Jan 16 10:35:41 2010 +0100
tests: add a all_ips_on_node() helper function that wraps ctdb ip -Y
metze
commit 27bde04966e22975777b4034dbaccfe158369110
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jan 15 10:53:14 2010 +0100
tests/simple/11_ctdb_ip.sh: be more strict in checking ctdb ip -Y output
metze
commit e05e236fc019bfd3b316609a7c190e0e028a4bbc
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Dec 17 11:23:59 2009 +0100
tools/ctdb: add "ctdb ipinfo <ip>"
metze
commit 8d0c00b60db69bd10f12da4c676e1142dc37af7a
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 17:02:23 2009 +0100
tools/ctdb: add "ctdb setifacelink <iface> <status>"
metze
commit 80053d09eed967fb76898f4a53437bed2b43a02f
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 16:50:23 2009 +0100
tools/ctdb: add "ctdb ifaces"
metze
commit cff58b27c970e9252d131125941c372019fd6660
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Dec 17 10:30:36 2009 +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
commit 0e982a416a126d9856145c19baef320cd0e71d66
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 11:14:44 2009 +0100
server: implement ctdb_control_get_ifaces()
metze
commit 486fbd15f4cc4f45a4c110b2ddbba48bade22c9f
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 11:20:28 2009 +0100
server: implement ctdb_control_get_public_ip_info()
metze
commit e2d6582001be28c1800e4da8b0f2dc541538c314
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 16:18:36 2009 +0100
client: implement ctdb_ctrl_set_iface_link()
metze
commit a21e3765dd83e837d93111f387448bf0a5dd4652
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 15:30:07 2009 +0100
client: implement ctdb_ctrl_get_ifaces()
metze
commit 4efab41dfa61d5c7951c583d584df3455ee9c704
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 16:23:08 2009 +0100
client: implement ctdb_ctrl_get_public_ip_info()
metze
commit a2c9e4578e149eccb2c6183f64a6b657eb95c5e1
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 14:40:21 2009 +0100
controls: add stups for GET_PUBLIC_IP_INFO, GET_IFACES and SET_IFACE_LINK_STATE
metze
commit a695a38e49e7c3e15a9706392dc920eeab1f11ba
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 16:09:40 2009 +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
commit 09a5c59bc8d1301edf60d7ae77504dc6d11a7da2
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 16:08:45 2009 +0100
server: implement CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE behavior
metze
commit 6bd780510058e5589f2f7c3722d37acbba4935ab
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 15:50:06 2009 +0100
client: add CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE ctdb_ctrl_get_public_ips_flags()
metze
commit 91122c322fbec08138b92c528d9a946f6727b4fd
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 12:10:18 2009 +0100
reserve upper bits in ctdb_control->flags for opcode specific flags
metze
commit ff5291778f0752e176539397e9530dcf0e546bea
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 10:39:40 2009 +0100
server: keep the interface information in a list of ctdb_iface structures
metze
commit 080ba5ac2195fb73ef6f18740abdde57a7b97151
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 09:48:21 2009 +0100
server: we don't need to copy strings we pass as talloc_asprintf() arguments
metze
commit f9837f8b6f887d28f29aeb3eeffe8cfb423b40b4
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 08:39:21 2009 +0100
events: 10.interfaces allow multiple interfaces per public address
metze
commit 33a00ef7233051acdbc66410130ec5d876a8422f
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 14 18:52:06 2009 +0100
server: allow multiple interfaces comma separated in public_addresses
metze
commit 9e5532e215892b2e0aadd9b106a730727f92c62e
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 16 08:54:02 2009 +0100
server: add a ctdb_vnn_iface_string() helper function to access vnn->iface
metze
commit 400b4806c4a9686a2ee6398b5d7c3e0ca0793fd1
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 14 19:33:35 2009 +0100
server: add a ctdb_set_single_public_ip() helper function
metze
commit ff5678fbec2daef461143acf00cef3f94d7655fc
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Dec 19 18:26:01 2009 +0100
config: add 13.per_ip_routing event script
With this script it's possible to generate routing tables
per public ip address.
metze
commit ff9c641763702ae99632bbf4d0825d578440c074
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 11 19:56:36 2009 +0100
config: add some ipv4 helper shell functions
Many thanks to Michael Adam <obnox at samba.org>
for the basic work.
metze
commit e02417b2a55c45ac2c125b1b3463c9c39e7bc07a
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jan 20 11:10:48 2010 +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
commit 24cd42769d8f32b90a8876a6a08a36ab23076cd1
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 18 11:08:22 2009 +0100
events/10.interfaces: move some parts to helper functions
metze
commit 2397f13d7b5ca3847ef148187c6b179d06f6a47a
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 18 09:43:20 2009 +0100
config/functions: add tickle_tcp_connections()
metze
commit e953808449c102258abb6cba6f4abf486dda3b82
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jan 19 10:07:14 2010 +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
commit 37d11895e96ba8bc8c9ba159083970c45f76d9bb
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jan 7 09:21:56 2010 +0100
server: setup fault handler to get the build-in backtrace support
The panic action feature will be added later.
metze
commit e366e77ba170d2c27110c56004ae1adf97abef9e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jan 12 12:17:00 2010 +0100
lib/util: add pre and post panic action hooks
metze
commit 8171d66f0061fe23ed6dfef87ffe63bfc19596eb
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 18 12:32:38 2009 +0100
lib/util: import fault/backtrace handling from samba.
metze
commit 9d39ada437b02d84b70a5fea78b61bbb32f16d81
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 18 12:14:28 2009 +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
commit 4b4dd5d7f81bf226e05c7f3d40087043da1517a2
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Dec 19 11:40:06 2009 +0100
move DEBUG* macros to one place
metze
commit 18af37e99ef8ff5623161495be432abfe5e3407f
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 21 13:34:21 2009 +0100
tools/ctdb: display INACTIVE status in "ctdb status" and "ctdb status -Y"
metze
commit 898894d3acbcc0add2ab0706a3172a446622f687
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jan 19 08:38:53 2010 +0100
server: add missing goto again after do_recovery()
metze
commit 49f0488a5e60c74b6b8361dffcd09ebb2db740f0
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Jan 18 13:19:29 2010 +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
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 5 +-
client/ctdb_client.c | 176 ++++++-
common/ctdb_util.c | 24 +-
config/ctdb.sysconfig | 59 ++
config/events.d/00.ctdb | 2 +-
config/events.d/01.reclock | 2 +-
config/events.d/10.interface | 259 +++++++---
config/events.d/13.per_ip_routing | 444 +++++++++++++++
config/events.d/README | 23 +-
config/functions | 128 +++++-
config/gdb_backtrace | 87 +++
config/interface_modify.sh | 73 +++
config/notify.sh | 7 +-
configure.ac | 10 +-
include/ctdb.h | 4 +-
include/ctdb_private.h | 77 +++-
include/includes.h | 7 +-
lib/events/events_epoll.c | 10 -
lib/events/events_select.c | 6 -
lib/events/events_standard.c | 19 +-
lib/util/debug.c | 4 -
lib/util/debug.h | 2 +
lib/util/fault.c | 239 +++++++++
lib/util/fault.m4 | 15 +
lib/util/signal.c | 144 +++++
lib/util/signal.m4 | 1 +
lib/util/substitute.c | 167 ++++++
lib/util/util.h | 658 +++++++++++++++++++++++
packaging/RPM/ctdb.spec.in | 2 +
server/ctdb_control.c | 12 +
server/ctdb_daemon.c | 6 +
server/ctdb_monitor.c | 2 +-
server/ctdb_recoverd.c | 212 ++++++--
server/ctdb_takeover.c | 861 ++++++++++++++++++++++++++----
server/ctdbd.c | 17 +-
server/eventscript.c | 11 +-
tests/events.d/00.test | 11 +-
tests/scripts/ctdb_test_functions.bash | 13 +-
tests/simple/11_ctdb_ip.sh | 22 +-
tests/simple/16_ctdb_config_add_ip.sh | 2 +-
tests/simple/17_ctdb_config_delete_ip.sh | 4 +-
tests/simple/23_ctdb_moveip.sh | 2 +-
tools/ctdb.c | 259 +++++++++-
tools/onnode | 23 +-
44 files changed, 3775 insertions(+), 336 deletions(-)
create mode 100755 config/events.d/13.per_ip_routing
create mode 100755 config/gdb_backtrace
create mode 100755 config/interface_modify.sh
create mode 100644 lib/util/fault.c
create mode 100644 lib/util/fault.m4
create mode 100644 lib/util/signal.c
create mode 100644 lib/util/signal.m4
create mode 100644 lib/util/substitute.c
create mode 100644 lib/util/util.h
Changeset truncated at 500 lines:
diff --git a/Makefile.in b/Makefile.in
index 0684df3..ad34f68 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,7 +35,8 @@ CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o \
- lib/util/util_time.o lib/util/util_file.o
+ lib/util/util_time.o lib/util/util_file.o lib/util/fault.o lib/util/substitute.o \
+ lib/util/signal.o
CTDB_COMMON_OBJ = common/ctdb_io.o common/ctdb_util.o \
common/ctdb_ltdb.o common/ctdb_message.o common/cmdline.o \
@@ -210,6 +211,7 @@ install: all
${INSTALLCMD} -m 644 include/ctdb_private.h $(DESTDIR)$(includedir) # for samba3
${INSTALLCMD} -m 644 config/functions $(DESTDIR)$(etcdir)/ctdb
${INSTALLCMD} -m 755 config/statd-callout $(DESTDIR)$(etcdir)/ctdb
+ ${INSTALLCMD} -m 755 config/interface_modify.sh $(DESTDIR)$(etcdir)/ctdb
${INSTALLCMD} -m 644 config/events.d/README $(DESTDIR)$(docdir)/ctdb/README.eventscripts
${INSTALLCMD} -m 644 doc/recovery-process.txt $(DESTDIR)$(docdir)/ctdb/recovery-process.txt
${INSTALLCMD} -m 755 config/events.d/00.ctdb $(DESTDIR)$(etcdir)/ctdb/events.d
@@ -217,6 +219,7 @@ install: all
${INSTALLCMD} -m 755 config/events.d/10.interface $(DESTDIR)$(etcdir)/ctdb/events.d
${INSTALLCMD} -m 755 config/events.d/11.natgw $(DESTDIR)$(etcdir)/ctdb/events.d
${INSTALLCMD} -m 755 config/events.d/11.routing $(DESTDIR)$(etcdir)/ctdb/events.d
+ ${INSTALLCMD} -m 755 config/events.d/13.per_ip_routing $(DESTDIR)$(etcdir)/ctdb/events.d
${INSTALLCMD} -m 644 config/events.d/20.multipathd $(DESTDIR)$(etcdir)/ctdb/events.d
${INSTALLCMD} -m 644 config/events.d/31.clamd $(DESTDIR)$(etcdir)/ctdb/events.d
${INSTALLCMD} -m 755 config/events.d/40.vsftpd $(DESTDIR)$(etcdir)/ctdb/events.d
diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 4aad400..9a89176 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -2318,16 +2318,18 @@ int ctdb_ctrl_list_tunables(struct ctdb_context *ctdb,
}
-int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb,
- struct timeval timeout, uint32_t destnode,
- TALLOC_CTX *mem_ctx, struct ctdb_all_public_ips **ips)
+int ctdb_ctrl_get_public_ips_flags(struct ctdb_context *ctdb,
+ struct timeval timeout, uint32_t destnode,
+ TALLOC_CTX *mem_ctx,
+ uint32_t flags,
+ struct ctdb_all_public_ips **ips)
{
int ret;
TDB_DATA outdata;
int32_t res;
ret = ctdb_control(ctdb, destnode, 0,
- CTDB_CONTROL_GET_PUBLIC_IPS, 0, tdb_null,
+ CTDB_CONTROL_GET_PUBLIC_IPS, flags, tdb_null,
mem_ctx, &outdata, &res, &timeout, NULL);
if (ret == 0 && res == -1) {
DEBUG(DEBUG_ERR,(__location__ " ctdb_control to get public ips failed, falling back to ipv4-only version\n"));
@@ -2344,6 +2346,16 @@ int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb,
return 0;
}
+int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb,
+ struct timeval timeout, uint32_t destnode,
+ TALLOC_CTX *mem_ctx,
+ struct ctdb_all_public_ips **ips)
+{
+ return ctdb_ctrl_get_public_ips_flags(ctdb, timeout,
+ destnode, mem_ctx,
+ 0, ips);
+}
+
int ctdb_ctrl_get_public_ipsv4(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, struct ctdb_all_public_ips **ips)
@@ -2377,6 +2389,162 @@ int ctdb_ctrl_get_public_ipsv4(struct ctdb_context *ctdb,
return 0;
}
+int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb,
+ struct timeval timeout, uint32_t destnode,
+ TALLOC_CTX *mem_ctx,
+ const ctdb_sock_addr *addr,
+ struct ctdb_control_public_ip_info **_info)
+{
+ int ret;
+ TDB_DATA indata;
+ TDB_DATA outdata;
+ int32_t res;
+ struct ctdb_control_public_ip_info *info;
+ uint32_t len;
+ uint32_t i;
+
+ indata.dptr = discard_const_p(uint8_t, addr);
+ indata.dsize = sizeof(*addr);
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_GET_PUBLIC_IP_INFO, 0, indata,
+ mem_ctx, &outdata, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
+ "failed ret:%d res:%d\n",
+ ret, res));
+ return -1;
+ }
+
+ len = offsetof(struct ctdb_control_public_ip_info, ifaces);
+ if (len > outdata.dsize) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
+ "returned invalid data with size %u > %u\n",
+ (unsigned int)outdata.dsize,
+ (unsigned int)len));
+ dump_data(DEBUG_DEBUG, outdata.dptr, outdata.dsize);
+ return -1;
+ }
+
+ info = (struct ctdb_control_public_ip_info *)outdata.dptr;
+ len += info->num*sizeof(struct ctdb_control_iface_info);
+
+ if (len > outdata.dsize) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
+ "returned invalid data with size %u > %u\n",
+ (unsigned int)outdata.dsize,
+ (unsigned int)len));
+ dump_data(DEBUG_DEBUG, outdata.dptr, outdata.dsize);
+ return -1;
+ }
+
+ /* make sure we null terminate the returned strings */
+ for (i=0; i < info->num; i++) {
+ info->ifaces[i].name[CTDB_IFACE_SIZE] = '\0';
+ }
+
+ *_info = (struct ctdb_control_public_ip_info *)talloc_memdup(mem_ctx,
+ outdata.dptr,
+ outdata.dsize);
+ talloc_free(outdata.dptr);
+ if (*_info == NULL) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
+ "talloc_memdup size %u failed\n",
+ (unsigned int)outdata.dsize));
+ return -1;
+ }
+
+ return 0;
+}
+
+int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb,
+ struct timeval timeout, uint32_t destnode,
+ TALLOC_CTX *mem_ctx,
+ struct ctdb_control_get_ifaces **_ifaces)
+{
+ int ret;
+ TDB_DATA outdata;
+ int32_t res;
+ struct ctdb_control_get_ifaces *ifaces;
+ uint32_t len;
+ uint32_t i;
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_GET_IFACES, 0, tdb_null,
+ mem_ctx, &outdata, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
+ "failed ret:%d res:%d\n",
+ ret, res));
+ return -1;
+ }
+
+ len = offsetof(struct ctdb_control_get_ifaces, ifaces);
+ if (len > outdata.dsize) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
+ "returned invalid data with size %u > %u\n",
+ (unsigned int)outdata.dsize,
+ (unsigned int)len));
+ dump_data(DEBUG_DEBUG, outdata.dptr, outdata.dsize);
+ return -1;
+ }
+
+ ifaces = (struct ctdb_control_get_ifaces *)outdata.dptr;
+ len += ifaces->num*sizeof(struct ctdb_control_iface_info);
+
+ if (len > outdata.dsize) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
+ "returned invalid data with size %u > %u\n",
+ (unsigned int)outdata.dsize,
+ (unsigned int)len));
+ dump_data(DEBUG_DEBUG, outdata.dptr, outdata.dsize);
+ return -1;
+ }
+
+ /* make sure we null terminate the returned strings */
+ for (i=0; i < ifaces->num; i++) {
+ ifaces->ifaces[i].name[CTDB_IFACE_SIZE] = '\0';
+ }
+
+ *_ifaces = (struct ctdb_control_get_ifaces *)talloc_memdup(mem_ctx,
+ outdata.dptr,
+ outdata.dsize);
+ talloc_free(outdata.dptr);
+ if (*_ifaces == NULL) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
+ "talloc_memdup size %u failed\n",
+ (unsigned int)outdata.dsize));
+ return -1;
+ }
+
+ return 0;
+}
+
+int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb,
+ struct timeval timeout, uint32_t destnode,
+ TALLOC_CTX *mem_ctx,
+ const struct ctdb_control_iface_info *info)
+{
+ int ret;
+ TDB_DATA indata;
+ int32_t res;
+
+ indata.dptr = discard_const_p(uint8_t, info);
+ indata.dsize = sizeof(*info);
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_SET_IFACE_LINK_STATE, 0, indata,
+ mem_ctx, NULL, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ DEBUG(DEBUG_ERR,(__location__ " ctdb_control for set iface link "
+ "failed ret:%d res:%d\n",
+ ret, res));
+ return -1;
+ }
+
+ return 0;
+}
+
/*
set/clear the permanent disabled bit on a remote node
*/
diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 0b34f2a..5b31418 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -367,7 +367,7 @@ bool parse_ipv4(const char *s, unsigned port, struct sockaddr_in *sin)
return true;
}
-static bool parse_ipv6(const char *s, const char *iface, unsigned port, ctdb_sock_addr *saddr)
+static bool parse_ipv6(const char *s, const char *ifaces, unsigned port, ctdb_sock_addr *saddr)
{
saddr->ip6.sin6_family = AF_INET6;
saddr->ip6.sin6_port = htons(port);
@@ -379,8 +379,14 @@ static bool parse_ipv6(const char *s, const char *iface, unsigned port, ctdb_soc
return false;
}
- if (iface && IN6_IS_ADDR_LINKLOCAL(&saddr->ip6.sin6_addr)) {
- saddr->ip6.sin6_scope_id = if_nametoindex(iface);
+ if (ifaces && IN6_IS_ADDR_LINKLOCAL(&saddr->ip6.sin6_addr)) {
+ if (strchr(ifaces, ',')) {
+ DEBUG(DEBUG_ERR, (__location__ " Link local address %s "
+ "is specified for multiple ifaces %s\n",
+ s, ifaces));
+ return false;
+ }
+ saddr->ip6.sin6_scope_id = if_nametoindex(ifaces);
}
return true;
@@ -430,7 +436,7 @@ bool parse_ip_port(const char *addr, ctdb_sock_addr *saddr)
/*
parse an ip
*/
-bool parse_ip(const char *addr, const char *iface, unsigned port, ctdb_sock_addr *saddr)
+bool parse_ip(const char *addr, const char *ifaces, unsigned port, ctdb_sock_addr *saddr)
{
char *p;
bool ret;
@@ -440,7 +446,7 @@ bool parse_ip(const char *addr, const char *iface, unsigned port, ctdb_sock_addr
if (p == NULL) {
ret = parse_ipv4(addr, port, &saddr->ip);
} else {
- ret = parse_ipv6(addr, iface, port, saddr);
+ ret = parse_ipv6(addr, ifaces, port, saddr);
}
return ret;
@@ -449,7 +455,7 @@ bool parse_ip(const char *addr, const char *iface, unsigned port, ctdb_sock_addr
/*
parse a ip/mask pair
*/
-bool parse_ip_mask(const char *str, const char *iface, ctdb_sock_addr *addr, unsigned *mask)
+bool parse_ip_mask(const char *str, const char *ifaces, ctdb_sock_addr *addr, unsigned *mask)
{
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
char *s, *p;
@@ -482,7 +488,7 @@ bool parse_ip_mask(const char *str, const char *iface, ctdb_sock_addr *addr, uns
/* now is this a ipv4 or ipv6 address ?*/
- ret = parse_ip(s, iface, 0, addr);
+ ret = parse_ip(s, ifaces, 0, addr);
talloc_free(tmp_ctx);
return ret;
@@ -653,6 +659,7 @@ void ctdb_lockdown_memory(struct ctdb_context *ctdb)
}
const char *ctdb_eventscript_call_names[] = {
+ "init",
"startup",
"startrecovery",
"recovered",
@@ -662,5 +669,6 @@ const char *ctdb_eventscript_call_names[] = {
"monitor",
"status",
"shutdown",
- "reload"
+ "reload",
+ "updateip"
};
diff --git a/config/ctdb.sysconfig b/config/ctdb.sysconfig
index 68d0bf6..a19dd0e 100644
--- a/config/ctdb.sysconfig
+++ b/config/ctdb.sysconfig
@@ -179,6 +179,65 @@ CTDB_RECOVERY_LOCK="/some/place/on/shared/storage"
# CTDB_NATGW_PRIVATE_NETWORK=10.1.1.0/24
# CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes
+
+# PER_IP_ROUTING configuration
+#
+# Some setups have multiple network interfaces connected to the
+# same network. By default all traffic for a network is routed
+# through only one interface, while the others are idle.
+#
+# On Linux it possible to use policy based routing to spread the load
+# across all interfaces. The is implemented by using a separate
+# routing table per public ip address.
+#
+# The configuration file configured by CTDB_PER_IP_ROUTING_CONF
+# contains the list of additional routes. The routes are bound to the
+# interface that is holding the public ip address.
+#
+# The format of the config file looks like this:
+# <public_ip_address> <network> [<gateway>]
+# and it's possible to have multiple routes per public ip address.
+#
+# If the special value "__auto_link_local__" is used, the config
+# file autogenerated. Each public ip address gets a special route
+# for its own subnet bound to it's current interface.
+# E.g. 10.1.2.3/24 will result in a config file line
+# 10.1.2.3 10.1.2.0/24
+#
+# The CTDB_PER_IP_ROUTING_RULE_PREF option needs to be configured.
+# The value will be passed as "pref" argument of "ip rule".
+# The value should be between 1 and 32765. So that the rule
+# comes after the rule for "local" routing table and before
+# the rule for the "main" routing table. This way the specific
+# routing table just overloads the "main" routing table,
+# this is useful because with the "__auto_link_local__" setup
+# the default route still comes from the "main" routing table.
+#
+# The routing table ids are automaticly allocated. On
+# Linux the routing table ids must be in the range of 0 to 255.
+# But some are reserved values, see /etc/iproute2/rt_tables.
+# You need to configure a range (CTDB_PER_IP_ROUTING_TABLE_ID_LOW
+# and CTDB_PER_IP_ROUTING_TABLE_ID_HIGH) from which the table ids can be taken.
+#
+# The default value for CTDB_PER_IP_ROUTING_CONF is "",
+# which means the feature is disabled by default.
+#
+# CTDB_PER_IP_ROUTING_CONF="/etc/ctdb/per_ip_routing.conf"
+# CTDB_PER_IP_ROUTING_CONF="__auto_link_local__"
+# CTDB_PER_IP_ROUTING_TABLE_ID_LOW=10
+# CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=250
+# CTDB_PER_IP_ROUTING_RULE_PREF=10000
+
+# Make offline interfaces not a reason for being UNHEALTHY.
+# The CTDB_PARTIALLY_ONLINE_INTERFACES option changes
+# the behavior of the 10.interface monitor event.
+# In some setups it's desired that interfaces without
+# an active link don't change the node to unhealthy.
+# ctdbd is just informed about the interface status
+# and "ctdb status" dislays the node as "PARTIALLYONLINE".
+#
+# CTDB_PARTIALLY_ONLINE_INTERFACES="yes"
+
# where to log messages
# the default is /var/log/log.ctdb
# CTDB_LOGFILE=/var/log/log.ctdb
diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index 9e83d30..1d4c145 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -13,7 +13,7 @@
loadconfig
case "$1" in
- startup)
+ init)
# make sure we have a blank state directory for the scripts to work with
/bin/rm -rf $CTDB_BASE/state
/bin/mkdir -p $CTDB_BASE/state
diff --git a/config/events.d/01.reclock b/config/events.d/01.reclock
index 919d296..345a631 100755
--- a/config/events.d/01.reclock
+++ b/config/events.d/01.reclock
@@ -5,7 +5,7 @@
loadconfig
case "$1" in
- startup)
+ init)
ctdb_counter_init
;;
diff --git a/config/events.d/10.interface b/config/events.d/10.interface
index f881808..9365106 100755
--- a/config/events.d/10.interface
+++ b/config/events.d/10.interface
@@ -17,10 +17,114 @@ loadconfig
exit 0
}
+monitor_interfaces()
+{
+ local INTERFACES=`cat $CTDB_PUBLIC_ADDRESSES |
+ sed -e "s/^[^\t ]*[\t ]*//" -e "s/,/ /g" -e "s/[\t ]*$//"`
+
+ [ "$CTDB_PUBLIC_INTERFACE" ] && INTERFACES="$CTDB_PUBLIC_INTERFACE $INTERFACES"
+ [ "$CTDB_NATGW_PUBLIC_IFACE" ] && INTERFACES="$CTDB_NATGW_PUBLIC_IFACE $INTERFACES"
+
+ local IFACES=`ctdb ifaces -Y | grep -v '^:Name:LinkStatus:References:'`
+
+ local I
+ local IFACE
+
+ for I in $IFACES; do
+ IFACE=`echo -n "$I" | cut -d ':' -f2`
+ INTERFACES="$IFACE $INTERFACES"
+ done
+
+ INTERFACES=`for IFACE in $INTERFACES ; do echo $IFACE ; done | sort | uniq`
+
+ local fail=0
+ local force_fail=0
+ local ok=0
+ for IFACE in $INTERFACES ; do
+
+ local OLDLINK=`echo -n "$IFACES" | grep "^:$IFACE:" | cut -d ':' -f3 | xargs`
+ test -z "$OLDLINK" && {
+ force_fail=1
+ }
+
+ # These interfaces are sometimes bond devices
+ # When we use VLANs for bond interfaces, there will only
+ # be an entry in /proc for the underlying real interface
+ local REALIFACE=`echo $IFACE |sed -e 's/\..*$//'`
+ [ -f /proc/net/bonding/$REALIFACE ] && {
+ grep -q 'Currently Active Slave: None' /proc/net/bonding/$REALIFACE && {
+ echo "ERROR: No active slaves for bond device $REALIFACE"
+ fail=1
+ test -n "$OLDLINK" && {
+ ctdb setifacelink $IFACE down
+ }
+ continue;
+ }
+ grep -q '^MII Status: up' /proc/net/bonding/$REALIFACE || {
+ echo "ERROR: public network interface $REALIFACE is down"
+ fail=1
+ test -n "$OLDLINK" && {
+ ctdb setifacelink $IFACE down
+ }
+ continue;
+ }
+ test -n "$OLDLINK" && {
+ ok=1 # we only set ok for interfaces known to ctdbd
+ ctdb setifacelink $IFACE up
+ }
+ return 0;
+ }
+
+ case $IFACE in
+ ib*)
+ # we dont know how to test ib links
+ ;;
+ *)
+ [ -z "$IFACE" ] || {
+ ethtool $IFACE | grep -q 'Link detected: yes' || {
+ # On some systems, this is not successful when a
+ # cable is plugged but the interface has not been
+ # brought up previously. Bring the interface up and
+ # try again...
+ /sbin/ip link set $IFACE up
+ ethtool $IFACE | grep -q 'Link detected: yes' || {
+ echo "ERROR: No link on the public network interface $IFACE"
+ fail=1
+ test -n "$OLDLINK" && {
+ ctdb setifacelink $IFACE down
+ }
+ continue
--
CTDB repository
More information about the samba-cvs
mailing list