The branch, master has been updated via c8181476748395fe6ec5284c49e9d37b882d15ea (commit) via 1360c2f08a463f288b344d02025e84113743026d (commit) via c66e44d44f8d1142394ce5c6a68ac09fd67211fe (commit) via 56af7df33456bf10d19b97cb005257720ac0b610 (commit) via d32b16a4e5ecc31563c6f2767e7d483f3d980284 (commit) via f0b98a32be2043a465d4d0ab42e6c2407d9d60f2 (commit) via 9aa09aee618fa71787c5d0e7c885e83f4d82236c (commit) via 68029894f80804c9f31fc90ed0c1b58f75812c3d (commit) via 2c292039a0139dcf5bb2bd964eb6f8902d094c50 (commit) via f0169ac8166a19d65ce254496e21d095aed87c2f (commit) via 3038d0b74895b51af4f85f2f304508ed16d245f4 (commit) via d5fb4489f83f1f956b2c083cfad1861c5ddde283 (commit) via 406a2a1e364cf71eb15e5aeec3b87c62f825da92 (commit) via 93b98838824fae5f47e4ed6b95ae9e4e7597bec3 (commit) via 6131f4b4fc7b65f83f3d57927b23393c84bd2a2b (commit) via 7f4c7cf6355a88b1a02d3a4d1fa25427106953f9 (commit) via b712762a1b8a3028625085e32136df4458b292c0 (commit) from 788d38812d73729f11d12e9812b16092c0ae4123 (commit)
http://gitweb.samba.org/?p=tridge/ctdb.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit c8181476748395fe6ec5284c49e9d37b882d15ea Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 21 11:50:41 2008 +1000 lowe the loglevel for the warning that releaseip was called for a non-public address. the address might be a public address on a different node so no need to fiull up the logs with thoise messages commit 1360c2f08a463f288b344d02025e84113743026d Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 21 11:44:50 2008 +1000 lower the loglevel for when we have "tickles" for an ip address that is not a public address on the local node (it may be a public address on other nodes) commit c66e44d44f8d1142394ce5c6a68ac09fd67211fe Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 21 11:23:46 2008 +1000 dont emit the can not start transaction with locks held at all. it just pollutes the logs commit 56af7df33456bf10d19b97cb005257720ac0b610 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 21 11:15:14 2008 +1000 lower the debug level for the "can not start transaction" since we do expect this to happen a few times inside ctdb (since we cant really block and wait for all locks to dissapear before we can write the header, for example when doing a dmaster miration) in those cases we accept that we couldnt get a transaction and then just writes the data "unsafely" anyway. commit d32b16a4e5ecc31563c6f2767e7d483f3d980284 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Fri May 16 15:14:17 2008 +1000 When ctdb has just been installed on a node, there wont be any persistent databases stored yet. Fix a cosmetic and annoying warning message when running "service ctdb start" and supress printing out that "warning your ls command to find the persistent databases didnt find any" ... commit f0b98a32be2043a465d4d0ab42e6c2407d9d60f2 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Fri May 16 09:51:42 2008 +1000 new version .38 commit 9aa09aee618fa71787c5d0e7c885e83f4d82236c Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Fri May 16 09:21:44 2008 +1000 add "machinereadable output" support to "ctdb getmonmode" commit 68029894f80804c9f31fc90ed0c1b58f75812c3d Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Fri May 16 08:20:40 2008 +1000 dont disable/enable monitoring for each eventscript, instead just disable the monitoring during the "startrecovery" event and enable it again once recovery has completed commit 2c292039a0139dcf5bb2bd964eb6f8902d094c50 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Thu May 15 15:01:01 2008 +1000 dont check whether the "recovered" event was successful or not since this event wont run unless the recovery mode is normal but we can not know what the recovery mode will be in the future on a remote node so since we issue these commands that will execute in the future at some other node it is pointless to try to check if it worked or not in particular if "failure to successfully run the eventscript" would then trigger a full new recovery which is disruptive and expensive. commit f0169ac8166a19d65ce254496e21d095aed87c2f Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Thu May 15 13:28:19 2008 +1000 remove some unnessecary tests if ->vnn is null or not commit 3038d0b74895b51af4f85f2f304508ed16d245f4 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Thu May 15 12:28:52 2008 +1000 Update some debug statements. Dont say that recovery failed if the failed function was invoked from outside of recovery commit d5fb4489f83f1f956b2c083cfad1861c5ddde283 Merge: 406a2a1e364cf71eb15e5aeec3b87c62f825da92 788d38812d73729f11d12e9812b16092c0ae4123 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Thu May 15 08:02:51 2008 +1000 Merge git://git.samba.org/tridge/ctdb commit 406a2a1e364cf71eb15e5aeec3b87c62f825da92 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 14 15:47:47 2008 +1000 Start implementing support for ipv6. This enhances the framework for sending tcp tickles to be able to send ipv6 tickles as well. Since we can not use one single RAW socket to send both handcrafted ipv4 and ipv6 packets, instead of always opening TWO sockets, one ipv4 and one ipv6 we get rid of the helper ctdb_sys_open_sending_socket() and just open (and close) a raw socket of the appropriate type inside ctdb_sys_send_tcp(). We know which type of socket v4/v6 to use based on the sin_family of the destination address. Since ctdb_sys_send_tcp() opens its own socket we no longer nede to pass a socket descriptor as a parameter. Get rid of this redundant parameter and fixup all callers. commit 93b98838824fae5f47e4ed6b95ae9e4e7597bec3 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 14 15:40:44 2008 +1000 add a new container to hold a socketaddr for either ipv4 or ipv6 commit 6131f4b4fc7b65f83f3d57927b23393c84bd2a2b Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 14 15:37:20 2008 +1000 Add a missing include commit 7f4c7cf6355a88b1a02d3a4d1fa25427106953f9 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 14 15:33:01 2008 +1000 move the function to open a sending socket into the main executable since this function will dissapear soon... commit b712762a1b8a3028625085e32136df4458b292c0 Author: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Wed May 14 12:25:55 2008 +1000 add a checksum routine for tcp over ipv6 ----------------------------------------------------------------------- Summary of changes: common/ctdb_util.c | 70 ++++++++++++++- common/system_aix.c | 5 +- common/system_linux.c | 194 ++++++++++++++++++++++++++++------------- config/ctdb.init | 3 +- include/ctdb_private.h | 18 +++- lib/tdb/common/transaction.c | 2 +- packaging/RPM/ctdb.spec | 15 +++- server/ctdb_monitor.c | 2 +- server/ctdb_recover.c | 4 - server/ctdb_recoverd.c | 98 +++++++++++---------- server/ctdb_takeover.c | 66 +++++---------- tools/ctdb.c | 25 +++--- utils/ipmux/ipmux.c | 29 ++++++ 13 files changed, 343 insertions(+), 188 deletions(-) Changeset truncated at 500 lines: diff --git a/common/ctdb_util.c b/common/ctdb_util.c index 8ae4df7..cb53511 100644 --- a/common/ctdb_util.c +++ b/common/ctdb_util.c @@ -296,18 +296,78 @@ static bool parse_ip_num(const char *s, struct in_addr *addr, unsigned *num, con } +static bool parse_ipv4(const char *s, unsigned port, ctdb_sock_addr *saddr) +{ + saddr->ip.sin_family = AF_INET; + saddr->ip.sin_port = htons(port); + + if (inet_pton(AF_INET, s, &saddr->ip.sin_addr) != 1) { + DEBUG(DEBUG_ERR, (__location__ " Failed to translate %s into sin_addr\n", s)); + return false; + } + + return true; +} + +static bool parse_ipv6(const char *s, unsigned port, ctdb_sock_addr *saddr) +{ + saddr->ip6.sin6_family = AF_INET6; + saddr->ip6.sin6_port = htons(port); + saddr->ip6.sin6_flowinfo = 0; + saddr->ip6.sin6_scope_id = 0; + + if (inet_pton(AF_INET6, s, &saddr->ip6.sin6_addr) != 1) { + DEBUG(DEBUG_ERR, (__location__ " Failed to translate %s into sin6_addr\n", s)); + return false; + } + + return true; +} /* parse a ip:port pair */ -bool parse_ip_port(const char *s, struct sockaddr_in *ip) +bool parse_ip_port(const char *addr, ctdb_sock_addr *saddr) { + TALLOC_CTX *tmp_ctx = talloc_new(NULL); + char *s, *p; unsigned port; - if (!parse_ip_num(s, &ip->sin_addr, &port, ':')) { + char *endp = NULL; + bool ret; + + s = talloc_strdup(tmp_ctx, addr); + if (s == NULL) { + DEBUG(DEBUG_ERR, (__location__ " Failed strdup()\n")); + talloc_free(tmp_ctx); return false; } - ip->sin_family = AF_INET; - ip->sin_port = htons(port); - return true; + + p = rindex(s, ':'); + if (p == NULL) { + DEBUG(DEBUG_ERR, (__location__ " This addr: %s does not contain a port number\n", s)); + talloc_free(tmp_ctx); + return false; + } + + port = strtoul(p+1, &endp, 10); + if (endp == NULL || *endp != 0) { + /* trailing garbage */ + DEBUG(DEBUG_ERR, (__location__ " Trailing garbage after the port in %s\n", s)); + talloc_free(tmp_ctx); + return false; + } + *p = 0; + + + /* now is this a ipv4 or ipv6 address ?*/ + p = index(s, ':'); + if (p == NULL) { + ret = parse_ipv4(s, port, saddr); + } else { + ret = parse_ipv6(s, port, saddr); + } + + talloc_free(tmp_ctx); + return ret; } /* diff --git a/common/system_aix.c b/common/system_aix.c index 50f1418..d455ac7 100644 --- a/common/system_aix.c +++ b/common/system_aix.c @@ -31,6 +31,9 @@ +#if 0 +This function is no longer used and its code should be moved into +send tcp packet after that function has been enhanced to do ipv6 as well. /* This function is used to open a raw socket to send tickles from */ @@ -59,7 +62,7 @@ int ctdb_sys_open_sending_socket(void) return s; } - +#endif /* uint16 checksum for n bytes diff --git a/common/system_linux.c b/common/system_linux.c index 207387f..fb50c6b 100644 --- a/common/system_linux.c +++ b/common/system_linux.c @@ -25,6 +25,7 @@ #include "../include/ctdb_private.h" #include "lib/events/events.h" #include <netinet/if_ether.h> +#include <netinet/ip6.h> #include <net/if_arp.h> @@ -177,6 +178,29 @@ static uint16_t tcp_checksum(uint16_t *data, size_t n, struct iphdr *ip) } /* + calculate the tcp checksum for tcp over ipv6 +*/ +static uint16_t tcp_checksum6(uint16_t *data, size_t n, struct ip6_hdr *ip6) +{ + uint32_t sum = uint16_checksum(data, n); + uint16_t sum2; + + sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_src, 16); + sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_dst, 16); + sum += ip6->ip6_plen; + sum += ip6->ip6_nxt; + + sum = (sum & 0xFFFF) + (sum >> 16); + sum = (sum & 0xFFFF) + (sum >> 16); + sum2 = htons(sum); + sum2 = ~sum2; + if (sum2 == 0) { + return 0xFFFF; + } + return sum2; +} + +/* Send tcp segment from the specified IP/port to the specified destination IP/port. @@ -187,48 +211,122 @@ static uint16_t tcp_checksum(uint16_t *data, size_t n, struct iphdr *ip) This can also be used to send RST segments (if rst is true) and also if correct seq and ack numbers are provided. */ -int ctdb_sys_send_tcp(int s, - const struct sockaddr_in *dest, - const struct sockaddr_in *src, +int ctdb_sys_send_tcp(const ctdb_sock_addr *dest, + const ctdb_sock_addr *src, uint32_t seq, uint32_t ack, int rst) { + int s; int ret; + uint32_t one = 1; + uint16_t tmpport; + ctdb_sock_addr *tmpdest; struct { struct iphdr ip; struct tcphdr tcp; - } pkt; - - /* for now, we only handle AF_INET addresses */ - if (src->sin_family != AF_INET || dest->sin_family != AF_INET) { - DEBUG(DEBUG_CRIT,(__location__ " not an ipv4 address\n")); - return -1; - } + } ip4pkt; + struct { + struct ip6_hdr ip6; + struct tcphdr tcp; + } ip6pkt; + + switch (src->ip.sin_family) { + case AF_INET: + ZERO_STRUCT(ip4pkt); + ip4pkt.ip.version = 4; + ip4pkt.ip.ihl = sizeof(ip4pkt.ip)/4; + ip4pkt.ip.tot_len = htons(sizeof(ip4pkt)); + ip4pkt.ip.ttl = 255; + ip4pkt.ip.protocol = IPPROTO_TCP; + ip4pkt.ip.saddr = src->ip.sin_addr.s_addr; + ip4pkt.ip.daddr = dest->ip.sin_addr.s_addr; + ip4pkt.ip.check = 0; + + ip4pkt.tcp.source = src->ip.sin_port; + ip4pkt.tcp.dest = dest->ip.sin_port; + ip4pkt.tcp.seq = seq; + ip4pkt.tcp.ack_seq = ack; + ip4pkt.tcp.ack = 1; + if (rst) { + ip4pkt.tcp.rst = 1; + } + ip4pkt.tcp.doff = sizeof(ip4pkt.tcp)/4; + /* this makes it easier to spot in a sniffer */ + ip4pkt.tcp.window = htons(1234); + ip4pkt.tcp.check = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip); + + /* open a raw socket to send this segment from */ + s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW)); + if (s == -1) { + DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n", + strerror(errno))); + return -1; + } + + ret = setsockopt(s, SOL_IP, IP_HDRINCL, &one, sizeof(one)); + if (ret != 0) { + DEBUG(DEBUG_CRIT,(__location__ " failed to setup IP headers (%s)\n", + strerror(errno))); + close(s); + return -1; + } + + set_nonblocking(s); + set_close_on_exec(s); + + ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0, &dest->ip, sizeof(dest->ip)); + close(s); + if (ret != sizeof(ip4pkt)) { + DEBUG(DEBUG_CRIT,(__location__ " failed sendto (%s)\n", strerror(errno))); + return -1; + } + break; + case AF_INET6: + ZERO_STRUCT(ip6pkt); + ip6pkt.ip6.ip6_vfc = 0x60; + ip6pkt.ip6.ip6_plen = 20; + ip6pkt.ip6.ip6_nxt = IPPROTO_TCP; + ip6pkt.ip6.ip6_hlim = 64; + ip6pkt.ip6.ip6_src = src->ip6.sin6_addr; + ip6pkt.ip6.ip6_dst = dest->ip6.sin6_addr; + + ip6pkt.tcp.source = src->ip6.sin6_port; + ip6pkt.tcp.dest = dest->ip6.sin6_port; + ip6pkt.tcp.seq = seq; + ip6pkt.tcp.ack_seq = ack; + ip6pkt.tcp.ack = 1; + if (rst) { + ip6pkt.tcp.rst = 1; + } + ip6pkt.tcp.doff = sizeof(ip6pkt.tcp)/4; + /* this makes it easier to spot in a sniffer */ + ip6pkt.tcp.window = htons(1234); + ip6pkt.tcp.check = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6); + + s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW); + if (s == -1) { + DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n")); + return -1; + + } + /* sendto() dont like if the port is set and the socket is + in raw mode. + */ + tmpdest = discard_const(dest); + tmpport = tmpdest->ip6.sin6_port; + + tmpdest->ip6.sin6_port = 0; + ret = sendto(s, &ip6pkt, sizeof(ip6pkt), 0, &dest->ip6, sizeof(dest->ip6)); + tmpdest->ip6.sin6_port = tmpport; + close(s); - ZERO_STRUCT(pkt); - pkt.ip.version = 4; - pkt.ip.ihl = sizeof(pkt.ip)/4; - pkt.ip.tot_len = htons(sizeof(pkt)); - pkt.ip.ttl = 255; - pkt.ip.protocol = IPPROTO_TCP; - pkt.ip.saddr = src->sin_addr.s_addr; - pkt.ip.daddr = dest->sin_addr.s_addr; - pkt.ip.check = 0; - - pkt.tcp.source = src->sin_port; - pkt.tcp.dest = dest->sin_port; - pkt.tcp.seq = seq; - pkt.tcp.ack_seq = ack; - pkt.tcp.ack = 1; - if (rst) { - pkt.tcp.rst = 1; - } - pkt.tcp.doff = sizeof(pkt.tcp)/4; - pkt.tcp.window = htons(1234); /* this makes it easier to spot in a sniffer */ - pkt.tcp.check = tcp_checksum((uint16_t *)&pkt.tcp, sizeof(pkt.tcp), &pkt.ip); + if (ret != sizeof(ip6pkt)) { + DEBUG(DEBUG_CRIT,(__location__ " failed sendto (%s)\n", strerror(errno))); + return -1; + } + break; - ret = sendto(s, &pkt, sizeof(pkt), 0, dest, sizeof(*dest)); - if (ret != sizeof(pkt)) { - DEBUG(DEBUG_CRIT,(__location__ " failed sendto (%s)\n", strerror(errno))); + default: + DEBUG(DEBUG_CRIT,(__location__ " not an ipv4/v6 address\n")); return -1; } @@ -290,34 +388,6 @@ int ctdb_sys_close_capture_socket(void *private_data) return 0; } -/* - This function is used to open a raw socket to send tickles from - */ -int ctdb_sys_open_sending_socket(void) -{ - int s, ret; - uint32_t one = 1; - - s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW)); - if (s == -1) { - DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n", - strerror(errno))); - return -1; - } - - ret = setsockopt(s, SOL_IP, IP_HDRINCL, &one, sizeof(one)); - if (ret != 0) { - DEBUG(DEBUG_CRIT,(__location__ " failed to setup IP headers (%s)\n", - strerror(errno))); - close(s); - return -1; - } - - set_nonblocking(s); - set_close_on_exec(s); - - return s; -} /* called when the raw socket becomes readable diff --git a/config/ctdb.init b/config/ctdb.init index 95845d1..88ecc77 100755 --- a/config/ctdb.init +++ b/config/ctdb.init @@ -91,7 +91,8 @@ start() { [ -z "$CTDB_DBDIR" ] || { PERSISTENT_DB_DIR="$CTDB_DBDIR/persistent" } - for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9]`; do + mkdir -p $PERSISTENT_DB_DIR 2>/dev/null + for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do /usr/bin/tdbdump $PDBASE >/dev/null 2>/dev/null || { echo "Persistent database $PDBASE is corrupted! CTDB will not start." return 1 diff --git a/include/ctdb_private.h b/include/ctdb_private.h index bc8bde3..4eccc84 100644 --- a/include/ctdb_private.h +++ b/include/ctdb_private.h @@ -47,6 +47,16 @@ struct rd_memdump_reply { }; /* + definitions for different socket structures + */ +typedef struct sockaddr_in ctdb_addr_in; +typedef struct sockaddr_in6 ctdb_addr_in6; +typedef union { + ctdb_addr_in ip; + ctdb_addr_in6 ip6; +} ctdb_sock_addr; + +/* a tcp connection description */ struct ctdb_tcp_connection { @@ -1153,9 +1163,8 @@ int ctdb_ctrl_get_public_ips(struct ctdb_context *ctdb, /* from takeover/system.c */ int ctdb_sys_send_arp(const struct sockaddr_in *saddr, const char *iface); bool ctdb_sys_have_ip(struct sockaddr_in ip); -int ctdb_sys_send_tcp(int fd, - const struct sockaddr_in *dest, - const struct sockaddr_in *src, +int ctdb_sys_send_tcp(const ctdb_sock_addr *dest, + const ctdb_sock_addr *src, uint32_t seq, uint32_t ack, int rst); int ctdb_set_public_addresses(struct ctdb_context *ctdb, const char *alist); @@ -1210,11 +1219,10 @@ int ctdb_ctrl_get_all_tunables(struct ctdb_context *ctdb, void ctdb_start_freeze(struct ctdb_context *ctdb); -bool parse_ip_port(const char *s, struct sockaddr_in *ip); +bool parse_ip_port(const char *s, ctdb_sock_addr *saddr); int ctdb_sys_open_capture_socket(const char *iface, void **private_data); int ctdb_sys_close_capture_socket(void *private_data); -int ctdb_sys_open_sending_socket(void); int ctdb_sys_read_tcp_packet(int s, void *private_data, struct sockaddr_in *src, struct sockaddr_in *dst, uint32_t *ack_seq, uint32_t *seq); diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index 4e2127b..5e5260b 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -419,7 +419,7 @@ int tdb_transaction_start(struct tdb_context *tdb) /* the caller must not have any locks when starting a transaction as otherwise we'll be screwed by lack of nested locks in posix */ - TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot start a transaction with locks held\n")); +// TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: cannot start a transaction with locks held\n")); tdb->ecode = TDB_ERR_LOCK; return -1; } diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec index a62b91a..41fcc59 100644 --- a/packaging/RPM/ctdb.spec +++ b/packaging/RPM/ctdb.spec @@ -5,7 +5,7 @@ Vendor: Samba Team Packager: Samba Team <[EMAIL PROTECTED]> Name: ctdb Version: 1.0 -Release: 37 +Release: 38 Epoch: 0 License: GNU GPL version 3 Group: System Environment/Daemons @@ -120,6 +120,19 @@ fi %{_includedir}/ctdb_private.h %changelog +* Fri May 16 2008 : Version 1.0.38 + - Add machine readable output support to "ctdb getmonmode" + - Lots of tweaks and enhancements if the event scripts are "slow" + - Merge from tridge: an attempt to break the chicken-and-egg deadlock that + net conf introduces if used from an eventscript. + - Enhance tickles so we can tickle an ipv6 connection. + - Start adding ipv6 support : create a new container to replace sockaddr_in. + - Add a checksum routine for ipv6/tcp + - When starting up ctdb, let the init script do a tdbdump on all + persistent databases and verify that they are good (i.e. not corrupted). + - Try to use "safe transactions" when writing to a persistent database + that was opened with the TDB_NOSYNC flag. If we can get the transaction + thats great, if we cant we have to write anyway since we cant block here. * Mon May 12 2008 : Version 1.0.37 - When we shutdown ctdb we close the transport down before we run the "shutdown" eventscripts. If ctdb decides to send a packet to a remote node diff --git a/server/ctdb_monitor.c b/server/ctdb_monitor.c index 05e6643..6526397 100644 --- a/server/ctdb_monitor.c +++ b/server/ctdb_monitor.c @@ -161,7 +161,7 @@ void ctdb_disable_monitoring(struct ctdb_context *ctdb) void ctdb_enable_monitoring(struct ctdb_context *ctdb) { ctdb->monitor->monitoring_mode = CTDB_MONITORING_ACTIVE; - ctdb->monitor->next_interval = 1; + ctdb->monitor->next_interval = 2; DEBUG(DEBUG_INFO,("Monitoring has been enabled\n")); } diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c index 3da3b56..8ca3a8f 100644 --- a/server/ctdb_recover.c +++ b/server/ctdb_recover.c @@ -815,8 +815,6 @@ static void ctdb_start_recovery_callback(struct ctdb_context *ctdb, int status, { struct recovery_callback_state *state = talloc_get_type(p, struct recovery_callback_state); - ctdb_enable_monitoring(ctdb); - if (status != 0) { DEBUG(DEBUG_ERR,(__location__ " startrecovery event script failed (status %d)\n", status)); } @@ -851,8 +849,6 @@ int32_t ctdb_control_start_recovery(struct ctdb_context *ctdb, state, "startrecovery"); if (ret != 0) { - ctdb_enable_monitoring(ctdb); - DEBUG(DEBUG_ERR,(__location__ " Failed to start recovery\n")); talloc_free(state); return -1; diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c index 5f8eb83..9a33819 100644 --- a/server/ctdb_recoverd.c +++ b/server/ctdb_recoverd.c @@ -203,7 +203,7 @@ enum monitor_result { MONITOR_OK, MONITOR_RECOVERY_NEEDED, MONITOR_ELECTION_NEED /* run the "recovered" eventscript on all nodes */ -static int run_recovered_eventscript(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap) +static int run_recovered_eventscript(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, const char *caller) { TALLOC_CTX *tmp_ctx; @@ -213,7 +213,8 @@ static int run_recovered_eventscript(struct ctdb_context *ctdb, struct ctdb_node -- CTDB repository