Hello community, here is the log from the commit of package ctdb for openSUSE:Factory checked in at 2012-10-25 10:59:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ctdb (Old) and /work/SRC/openSUSE:Factory/.ctdb.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ctdb", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/ctdb/ctdb.changes 2012-09-17 13:52:51.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ctdb.new/ctdb.changes 2012-10-25 10:59:19.000000000 +0200 @@ -1,0 +2,12 @@ +Fri Oct 19 09:33:59 UTC 2012 - [email protected] + +- Update to version 1.2.52 + + util: ctdb_fork() closes all sockets opened by the main daemon + + Logging: Map TEVENT_DEBUG_FATAL to DEBUG_CRIT + + Eventscripts: "recovered" event should not fail on NATGW failure + + common: Debug ctdb_addr_to_str() using new function ctdb_external_trace() + + Initscript: Kill any existing ctdbd processes if the ping succeeds + + Eventscripts: new functions set_proc() and get_proc(). + + Eventscripts: Add "reconfigure" pseudo-event for policy routing + +------------------------------------------------------------------- Old: ---- ctdb-1.2.46.tar.bz2 New: ---- ctdb-1.2.52.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ctdb.spec ++++++ --- /var/tmp/diff_new_pack.Wmyckh/_old 2012-10-25 10:59:26.000000000 +0200 +++ /var/tmp/diff_new_pack.Wmyckh/_new 2012-10-25 10:59:26.000000000 +0200 @@ -21,7 +21,7 @@ Group: System/Daemons Name: ctdb -Version: 1.2.46 +Version: 1.2.52 Release: 0 Url: http://ctdb.samba.org/ Source: ctdb-%{version}.tar.bz2 @@ -151,6 +151,7 @@ %attr(644,root,root) %verify(not mode) %{_sysconfdir}/ctdb/events.d/91.lvs %{_sysconfdir}/ctdb/interface_modify.sh %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh +%{_sysconfdir}/ctdb/gcore_trace.sh %{_sysconfdir}/ctdb/statd-callout %{_sbindir}/ctdbd %{_bindir}/ctdb ++++++ ctdb-1.2.46.tar.bz2 -> ctdb-1.2.52.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/Makefile.in new/ctdb-1.2.52/Makefile.in --- old/ctdb-1.2.46/Makefile.in 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/Makefile.in 2012-10-05 04:05:19.000000000 +0200 @@ -291,6 +291,7 @@ if [ -f doc/ltdbtool.1 ]; then ${INSTALLCMD} -m 644 doc/ltdbtool.1 $(DESTDIR)$(mandir)/man1; fi if [ ! -f $(DESTDIR)$(etcdir)/ctdb/notify.sh ];then ${INSTALLCMD} -m 755 config/notify.sh $(DESTDIR)$(etcdir)/ctdb; fi if [ ! -f $(DESTDIR)$(etcdir)/ctdb/ctdb-crash-cleanup.sh ];then ${INSTALLCMD} -m 755 config/ctdb-crash-cleanup.sh $(DESTDIR)$(etcdir)/ctdb; fi + if [ ! -f $(DESTDIR)$(etcdir)/ctdb/gcore_trace.sh ];then ${INSTALLCMD} -m 755 config/gcore_trace.sh $(DESTDIR)$(etcdir)/ctdb; fi test: all tests/run_tests.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/client/ctdb_client.c new/ctdb-1.2.52/client/ctdb_client.c --- old/ctdb-1.2.46/client/ctdb_client.c 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/client/ctdb_client.c 2012-10-05 04:05:19.000000000 +0200 @@ -4048,9 +4048,11 @@ return 0; } -/* when forking the main daemon and the child process needs to connect back - * to the daemon as a client process, this function can be used to change - * the ctdb context from daemon into client mode +/* When forking the main daemon and the child process needs to connect + * back to the daemon as a client process, this function can be used + * to change the ctdb context from daemon into client mode. The child + * process must be created using ctdb_fork() and not fork() - + * ctdb_fork() does some necessary housekeeping. */ int switch_from_server_to_client(struct ctdb_context *ctdb, const char *fmt, ...) { @@ -4062,25 +4064,11 @@ debug_extra = talloc_strdup_append(talloc_vasprintf(NULL, fmt, ap), ":"); va_end(ap); - /* shutdown the transport */ - if (ctdb->methods) { - ctdb->methods->shutdown(ctdb); - } - /* get a new event context */ - talloc_free(ctdb->ev); ctdb->ev = event_context_init(ctdb); tevent_loop_allow_nesting(ctdb->ev); - close(ctdb->daemon.sd); - ctdb->daemon.sd = -1; - - /* the client does not need to be realtime */ - if (ctdb->do_setsched) { - ctdb_restore_scheduler(ctdb); - } - - /* initialise ctdb */ + /* Connect to main CTDB daemon */ ret = ctdb_socket_connect(ctdb); if (ret != 0) { DEBUG(DEBUG_ALERT, (__location__ " Failed to init ctdb client\n")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/common/ctdb_util.c new/ctdb-1.2.52/common/ctdb_util.c --- old/ctdb-1.2.46/common/ctdb_util.c 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/common/ctdb_util.c 2012-10-05 04:05:19.000000000 +0200 @@ -60,6 +60,30 @@ abort(); } +/* Invoke an external program to do some sort of tracing on the CTDB + * process. This might block for a little while. The external + * program is specified by the environment variable + * CTDB_EXTERNAL_TRACE. This program should take one argument: the + * pid of the process to trace. Commonly, the program would be a + * wrapper script around gcore. + */ +void ctdb_external_trace(void) +{ + + const char * t = getenv("CTDB_EXTERNAL_TRACE"); + char * cmd; + + if (t == NULL) { + return; + } + + cmd = talloc_asprintf(NULL, "%s %lu", t, (unsigned long) getpid()); + DEBUG(DEBUG_WARNING,("begin external trace: %s\n", cmd)); + system(cmd); + DEBUG(DEBUG_WARNING,("end external trace: %s\n", cmd)); + talloc_free(cmd); +} + /* parse a IP:port pair */ @@ -343,6 +367,23 @@ pid = fork(); if (pid == 0) { + /* Close the Unix Domain socket and the TCP socket. + * This ensures that none of the child processes will + * look like the main daemon when it is not running. + * tevent needs to be stopped before closing sockets. + */ + if (ctdb->ev != NULL) { + talloc_free(ctdb->ev); + ctdb->ev = NULL; + } + if (ctdb->daemon.sd != -1) { + close(ctdb->daemon.sd); + ctdb->daemon.sd = -1; + } + if (ctdb->methods != NULL) { + ctdb->methods->shutdown(ctdb); + } + if (ctdb->do_setsched) { ctdb_restore_scheduler(ctdb); } @@ -574,6 +615,7 @@ break; default: DEBUG(DEBUG_ERR, (__location__ " ERROR, unknown family %u\n", addr->sa.sa_family)); + ctdb_external_trace(); } return cip; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/config/ctdb.init new/ctdb-1.2.52/config/ctdb.init --- old/ctdb-1.2.46/config/ctdb.init 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/config/ctdb.init 2012-10-05 04:05:19.000000000 +0200 @@ -237,6 +237,12 @@ return 0 } + # About to start new $ctdbd. The ping above has failed and any + # new $ctdbd will destroy the Unix domain socket, so any processes + # that aren't yet completely useless soon will be... so kill + # them. + pkill -9 -f "$ctdbd" + build_ctdb_options # make sure we drop any ips that might still be held if previous diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/config/events.d/11.natgw new/ctdb-1.2.52/config/events.d/11.natgw --- old/ctdb-1.2.46/config/events.d/11.natgw 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/config/events.d/11.natgw 2012-10-05 04:05:19.000000000 +0200 @@ -34,6 +34,24 @@ iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null } +ensure_natgwmaster () +{ + _event="$1" + + NATGWMASTER=`ctdb natgwlist | head -1 | sed -e "s/ .*//"` + + if [ "$NATGWMASTER" = "-1" ]; then + echo "There is no NATGW master node" + # The recovered event should never fail - we'll catch this + # failure in the monitor event. + if [ "$1" = "recovered" ] ; then + exit 0 + else + exit 1 + fi + fi +} + case "$1" in startup) [ -z "$CTDB_PUBLIC_ADDRESSES" ] && { @@ -51,7 +69,6 @@ recovered|updatenatgw|ipreallocated) MYPNN=`ctdb pnn | cut -d: -f2` - NATGWMASTER=`ctdb natgwlist | head -1 | sed -e "s/ .*//"` NATGWIP=`ctdb natgwlist | head -1 | sed -e "s/^[^ ]* *//"` CTDB_NATGW_PUBLIC_IP_HOST=`echo $CTDB_NATGW_PUBLIC_IP | sed -e "s/\/.*/\/32/"` @@ -61,10 +78,7 @@ iptables -I INPUT -p tcp --syn -d $CTDB_NATGW_PUBLIC_IP_HOST -j REJECT 2>/dev/null - if [ "$NATGWMASTER" = "-1" ]; then - echo "There is no NATGW master node" - exit 1 - fi + ensure_natgwmaster "$1" delete_all @@ -101,6 +115,10 @@ delete_all ;; + monitor) + ensure_natgwmaster "$1" + ;; + *) ctdb_standard_event_handler "@" ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/config/events.d/13.per_ip_routing new/ctdb-1.2.52/config/events.d/13.per_ip_routing --- old/ctdb-1.2.46/config/events.d/13.per_ip_routing 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/config/events.d/13.per_ip_routing 2012-10-05 04:05:19.000000000 +0200 @@ -275,7 +275,8 @@ # Add any missing routes. Some might have gone missing if, for # example, all IPs on the network were removed (possibly if the -# primary was removed). +# primary was removed). If $1 is "force" then (re-)add all the +# routes. add_missing_routes () { ctdb ip -v -Y | { @@ -291,7 +292,8 @@ [ -n "$_iface" ] || continue _table_id="${table_id_prefix}${_ip}" - if [ -z "$(ip route show table $_table_id 2>/dev/null)" ] ; then + if [ -z "$(ip route show table $_table_id 2>/dev/null)" -o \ + "$1" = "force" ] ; then add_routing_for_ip "$_iface" "$_ip" fi done @@ -387,6 +389,14 @@ remove_bogus_routes ;; + reconfigure) + add_missing_routes "force" + remove_bogus_routes + + # flush our route cache + set_proc sys/net/ipv4/route/flush 1 + ;; + *) ctdb_standard_event_handler "$@" ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/config/functions new/ctdb-1.2.52/config/functions --- old/ctdb-1.2.46/config/functions 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/config/functions 2012-10-05 04:05:19.000000000 +0200 @@ -160,6 +160,24 @@ ###################################################### +# wrapper around /proc/ settings to allow them to be hooked +# for testing +# 1st arg is relative path under /proc/, 2nd arg is value to set +set_proc () +{ + echo "$2" >"/proc/$1" +} + +###################################################### +# wrapper around getting file contents from /proc/ to allow +# this to be hooked for testing +# 1st arg is relative path under /proc/ +get_proc () +{ + cat "/proc/$1" +} + +###################################################### # check that a rpc server is registered with portmap # and responding to requests # usage: ctdb_check_rpc SERVICE_NAME PROGNUM VERSION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/config/gcore_trace.sh new/ctdb-1.2.52/config/gcore_trace.sh --- old/ctdb-1.2.46/config/gcore_trace.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/ctdb-1.2.52/config/gcore_trace.sh 2012-10-05 04:05:19.000000000 +0200 @@ -0,0 +1,3 @@ +#!/bin/sh + +gcore -o "/var/log/core" "$1" 2>&1 | logger -t "ctdb:gcore_trace" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/include/ctdb_private.h new/ctdb-1.2.52/include/ctdb_private.h --- old/ctdb-1.2.46/include/ctdb_private.h 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/include/ctdb_private.h 2012-10-05 04:05:19.000000000 +0200 @@ -655,6 +655,7 @@ /* internal prototypes */ void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); void ctdb_fatal(struct ctdb_context *ctdb, const char *msg); +void ctdb_external_trace(void); bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2); int ctdb_parse_address(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, const char *str, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/packaging/RPM/ctdb.spec.in new/ctdb-1.2.52/packaging/RPM/ctdb.spec.in --- old/ctdb-1.2.46/packaging/RPM/ctdb.spec.in 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/packaging/RPM/ctdb.spec.in 2012-10-05 04:05:19.000000000 +0200 @@ -3,7 +3,7 @@ Summary: Clustered TDB Vendor: Samba Team Packager: Samba Team <[email protected]> -Version: 1.2.46 +Version: 1.2.52 Release: 1GITHASH Epoch: 0 License: GNU GPL version 3 @@ -89,6 +89,7 @@ %config(noreplace) %{_sysconfdir}/sysconfig/ctdb %config(noreplace) %{_sysconfdir}/ctdb/notify.sh %config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh +%config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh %config(noreplace) %{_sysconfdir}/ctdb/functions %attr(755,root,root) %{initdir}/ctdb @@ -144,6 +145,21 @@ %{_libdir}/libctdb.a %changelog + +* Fri Oct 05 2012 : Version 1.2.52 + - util: ctdb_fork() closes all sockets opened by the main daemon +* Tue Oct 02 2012 : Version 1.2.51 + - NATGW eventscript does not fail on recovered in case of misconfiguration + - Map TEVENT_DEBUG_FATAL to DEBUG_CRIT +* Wed Sep 12 2012 : Version 1.2.50 + - Add utility function to dump core and use it for "unknown family, 0" error +* Tue Aug 21 2012 : Version 1.2.49 + - logging: Close unix socket /tmp/ctdb.socket in syslogd process + - Initscript: Kill any existing ctdbd processes if the ping succeeds +* Thu Aug 08 2012 : Version 1.2.48 + - Fix missing set_proc() in policy routing +* Thu Aug 08 2012 : Version 1.2.47 + - Add reconfigure event for policy routing * Tue Jul 24 2012 : Version 1.2.46 - Default route on NAT gateway should have a metric of 10 * Thu Jul 12 2012 : Version 1.2.45 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ctdb-1.2.46/server/ctdb_logging.c new/ctdb-1.2.52/server/ctdb_logging.c --- old/ctdb-1.2.46/server/ctdb_logging.c 2012-07-26 14:46:11.000000000 +0200 +++ new/ctdb-1.2.52/server/ctdb_logging.c 2012-10-05 04:05:19.000000000 +0200 @@ -555,11 +555,11 @@ const char *fmt, va_list ap) { - enum debug_level lvl = DEBUG_EMERG; + enum debug_level lvl = DEBUG_CRIT; switch (level) { case TEVENT_DEBUG_FATAL: - lvl = DEBUG_EMERG; + lvl = DEBUG_CRIT; break; case TEVENT_DEBUG_ERROR: lvl = DEBUG_ERR; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
