[SCM] CTDB repository - branch master updated - ctdb-1.0.88-9-g46823aa

Ronnie Sahlberg sahlberg at samba.org
Thu Sep 3 10:42:31 MDT 2009


The branch, master has been updated
       via  46823aa7c673bc18a1424500b3f01da9c2dd6333 (commit)
       via  77574b7d7fe11c8e73957a80845481f3b2a64219 (commit)
       via  b869bb0e32d32422a5ba6b235864acba07f2b412 (commit)
       via  0c4c2240267af183d54ffd4c0aacda208f6eff6a (commit)
       via  7a95257a5ec19f232f661bc7f797051bf08ab776 (commit)
       via  e1d709f32196e19d4041ee2958e143791762e08f (commit)
      from  e26d9d32e68e7db1cf4f96c47c0126e9e0b213be (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 46823aa7c673bc18a1424500b3f01da9c2dd6333
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Sep 4 03:05:37 2009 +1000

     new version 1.0.89

commit 77574b7d7fe11c8e73957a80845481f3b2a64219
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Sep 4 02:59:24 2009 +1000

    make it possible to have ctdb manage (start/stop/monitor) winbind without having samba

commit b869bb0e32d32422a5ba6b235864acba07f2b412
Merge: 7a95257a5ec19f232f661bc7f797051bf08ab776 0c4c2240267af183d54ffd4c0aacda208f6eff6a
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Sep 4 02:00:14 2009 +1000

    Merge root at 10.1.1.27:/shared/ctdb/ctdb-git

commit 0c4c2240267af183d54ffd4c0aacda208f6eff6a
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Sep 4 02:20:39 2009 +1000

    new prototype banning code

commit 7a95257a5ec19f232f661bc7f797051bf08ab776
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Sep 2 04:39:17 2009 +1000

    overwrite the state file, dont append to it.
    dont log errors is trying to delete a nonexisting state file
    
    this eliminates some annoying log entries in the ctdb log

commit e1d709f32196e19d4041ee2958e143791762e08f
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Sep 2 03:12:27 2009 +1000

    redirect stderr to dev null since the rule might not exist when we try to unconditionally delete it

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                  |    2 +-
 client/ctdb_client.c         |   45 +++++
 config/events.d/10.interface |    2 +-
 config/events.d/40.vsftpd    |    6 +-
 config/events.d/50.samba     |   79 +++++----
 include/ctdb.h               |   19 +-
 include/ctdb_private.h       |    8 +
 packaging/RPM/ctdb.spec      |   11 +-
 server/ctdb_banning.c        |  121 +++++++++++++
 server/ctdb_control.c        |    8 +
 server/ctdb_monitor.c        |    8 +
 server/ctdb_recoverd.c       |  382 +++++++++++------------------------------
 server/eventscript.c         |   17 +--
 tools/ctdb.c                 |  114 ++++++++-----
 14 files changed, 435 insertions(+), 387 deletions(-)
 create mode 100644 server/ctdb_banning.c


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index a32efa8..cda8ec2 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -54,7 +54,7 @@ CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o server/ctdb_lockwait.o \
 	server/ctdb_traverse.o server/eventscript.o server/ctdb_takeover.o \
 	server/ctdb_serverids.o server/ctdb_persistent.o \
 	server/ctdb_keepalive.o server/ctdb_logging.o server/ctdb_uptime.o \
-	server/ctdb_vacuum.o \
+	server/ctdb_vacuum.o server/ctdb_banning.o \
 	$(CTDB_CLIENT_OBJ) $(CTDB_TCP_OBJ) @INFINIBAND_WRAPPER_OBJ@
 
 TEST_BINS=tests/bin/ctdb_bench tests/bin/ctdb_fetch tests/bin/ctdb_store \
diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index a6135c9..1f5bb4c 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -3842,3 +3842,48 @@ int ctdb_ctrl_disablescript(struct ctdb_context *ctdb, struct timeval timeout, u
 	return 0;
 }
 
+
+int ctdb_ctrl_set_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_ban_time *bantime)
+{
+	int ret;
+	TDB_DATA data;
+	int32_t res;
+
+	data.dsize = sizeof(*bantime);
+	data.dptr  = (uint8_t *)bantime;
+
+	ret = ctdb_control(ctdb, destnode, 0, 
+			   CTDB_CONTROL_SET_BAN_STATE, 0, data, 
+			   NULL, NULL, &res, &timeout, NULL);
+	if (ret != 0 || res != 0) {
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for set ban state failed\n"));
+		return -1;
+	}
+
+	return 0;
+}
+
+
+int ctdb_ctrl_get_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, struct ctdb_ban_time **bantime)
+{
+	int ret;
+	TDB_DATA outdata;
+	int32_t res;
+	TALLOC_CTX *tmp_ctx = talloc_new(NULL);
+
+	ret = ctdb_control(ctdb, destnode, 0, 
+			   CTDB_CONTROL_GET_BAN_STATE, 0, tdb_null,
+			   tmp_ctx, &outdata, &res, &timeout, NULL);
+	if (ret != 0 || res != 0) {
+		DEBUG(DEBUG_ERR,(__location__ " ctdb_control for set ban state failed\n"));
+		talloc_free(tmp_ctx);
+		return -1;
+	}
+
+	*bantime = (struct ctdb_ban_time *)talloc_steal(mem_ctx, outdata.dptr);
+	talloc_free(tmp_ctx);
+
+	return 0;
+}
+
+
diff --git a/config/events.d/10.interface b/config/events.d/10.interface
index 1c8d32d..0871750 100755
--- a/config/events.d/10.interface
+++ b/config/events.d/10.interface
@@ -114,7 +114,7 @@ case $cmd in
 		fi
 	    done
 	}
-	iptables -D INPUT -i $iface -d $ip -j DROP
+	iptables -D INPUT -i $iface -d $ip -j DROP 2> /dev/null
 	[ $failed = 0 ] || {
 		 echo "Failed to del $ip on dev $iface"
 		 exit 1
diff --git a/config/events.d/40.vsftpd b/config/events.d/40.vsftpd
index 29f6fee..539cd80 100755
--- a/config/events.d/40.vsftpd
+++ b/config/events.d/40.vsftpd
@@ -24,11 +24,11 @@ case $cmd in
 	;;
 
      takeip)
-	echo "restart" >> $CTDB_BASE/state/vsftpd/restart
+	echo "restart" > $CTDB_BASE/state/vsftpd/restart
 	;;
 
      releaseip)
-	echo "restart" >> $CTDB_BASE/state/vsftpd/restart
+	echo "restart" > $CTDB_BASE/state/vsftpd/restart
 	;;
 
      recovered)
@@ -39,7 +39,7 @@ case $cmd in
 		service vsftpd start
 	} >/dev/null 2>&1
 
-	/bin/rm -f $CTDB_BASE/state/vsftpd/restart
+	/bin/rm -f $CTDB_BASE/state/vsftpd/restart 2>/dev/null
 	;;
 
      monitor)
diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index 0343ce4..54cf9ce 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -36,7 +36,8 @@ esac
 cmd="$1"
 shift
 
-[ "$CTDB_MANAGES_SAMBA" = "yes" ] || exit 0
+[ "$CTDB_MANAGES_SAMBA" = "yes" ] || [ "$CTDB_MANAGES_WINBIND" = "yes" ] || exit 0
+
 
 # set default samba cleanup period - in minutes
 [ -z "$SAMBA_CLEANUP_PERIOD" ] && {
@@ -144,18 +145,20 @@ case $cmd in
 	/bin/mkdir -p $CTDB_BASE/state/samba
 
 	# make sure samba is not already started
-	service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
-	service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
-	killall -0 -q smbd && {
-	    sleep 1
-	    # make absolutely sure samba is dead
-	    killall -q -9 smbd
-	}
+	[ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
+		service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1
+		service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1
+		killall -0 -q smbd && {
+		    sleep 1
+		    # make absolutely sure samba is dead
+		    killall -q -9 smbd
+		}
 
-	killall -0 -q nmbd && {
-	    sleep 1
-	    # make absolutely sure samba is dead
-	    killall -q -9 nmbd
+		killall -0 -q nmbd && {
+		    sleep 1
+		    # make absolutely sure samba is dead
+		    killall -q -9 nmbd
+		}
 	}
 
 	# restart the winbind service
@@ -173,8 +176,10 @@ case $cmd in
 	# start Samba service. Start it reniced, as under very heavy load 
 	# the number of smbd processes will mean that it leaves few cycles for
 	# anything else
-	nice_service "$CTDB_SERVICE_NMB" start
-	nice_service "$CTDB_SERVICE_SMB" start
+	[ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
+		nice_service "$CTDB_SERVICE_NMB" start
+		nice_service "$CTDB_SERVICE_SMB" start
+	}
 	;;
 	
      takeip)
@@ -192,8 +197,10 @@ case $cmd in
 
      shutdown)
 	# shutdown Samba when ctdb goes down
-	service "$CTDB_SERVICE_SMB" stop
-	service "$CTDB_SERVICE_NMB" stop
+	[ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
+		service "$CTDB_SERVICE_SMB" stop
+		service "$CTDB_SERVICE_NMB" stop
+	}
 
 	# stop the winbind service
 	check_ctdb_manages_winbind
@@ -214,30 +221,32 @@ case $cmd in
 		touch $CTDB_BASE/state/samba/periodic_cleanup
 	}
 
-	[ "$CTDB_SAMBA_SKIP_SHARE_CHECK" = "yes" ] || {
-		testparm_background_update
+	[ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
+		[ "$CTDB_SAMBA_SKIP_SHARE_CHECK" = "yes" ] || {
+			testparm_background_update
 
-		testparm_cat | egrep '^WARNING|^ERROR|^Unknown' && {
-		    testparm_foreground_update
-		    testparm_cat | egrep '^WARNING|^ERROR|^Unknown' && {
-			echo "ERROR: testparm shows smb.conf is not clean"
-			exit 1
-		    }
-		}
+			testparm_cat | egrep '^WARNING|^ERROR|^Unknown' && {
+			    testparm_foreground_update
+			    testparm_cat | egrep '^WARNING|^ERROR|^Unknown' && {
+				echo "ERROR: testparm shows smb.conf is not clean"
+				exit 1
+			    }
+			}
 
-		smb_dirs=`testparm_cat | egrep '^[[:space:]]*path = ' | cut -d= -f2`
-		ctdb_check_directories_probe "Samba" $smb_dirs || {
-		    testparm_foreground_update
-		    smb_dirs=`testparm_cat | egrep '^[[:space:]]*path = ' | cut -d= -f2`
-		    ctdb_check_directories "Samba" $smb_dirs
+			smb_dirs=`testparm_cat | egrep '^[[:space:]]*path = ' | cut -d= -f2`
+			ctdb_check_directories_probe "Samba" $smb_dirs || {
+			    testparm_foreground_update
+			    smb_dirs=`testparm_cat | egrep '^[[:space:]]*path = ' | cut -d= -f2`
+			    ctdb_check_directories "Samba" $smb_dirs
+			}
 		}
-	}
 
-	smb_ports="$CTDB_SAMBA_CHECK_PORTS"
-	[ -z "$smb_ports" ] && {
-		smb_ports=`testparm_cat --parameter-name="smb ports"`
+		smb_ports="$CTDB_SAMBA_CHECK_PORTS"
+		[ -z "$smb_ports" ] && {
+			smb_ports=`testparm_cat --parameter-name="smb ports"`
+		}
+		ctdb_check_tcp_ports "Samba" $smb_ports
 	}
-	ctdb_check_tcp_ports "Samba" $smb_ports
 
 	# check winbind is OK
 	check_ctdb_manages_winbind
diff --git a/include/ctdb.h b/include/ctdb.h
index f677359..a5d9d1f 100644
--- a/include/ctdb.h
+++ b/include/ctdb.h
@@ -75,16 +75,6 @@ struct ctdb_call_info {
  */
 #define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
 
-/* 
-   a message ID meaning that a node should be banned
- */
-#define CTDB_SRVID_BAN_NODE 0xF500000000000000LL
-
-/* 
-   a message ID meaning that a node should be unbanned
- */
-#define CTDB_SRVID_UNBAN_NODE 0xF600000000000000LL
-
 /*
   a message to tell the recovery daemon to fetch a set of records
  */
@@ -669,4 +659,13 @@ int ctdb_ctrl_setrecmasterrole(struct ctdb_context *ctdb, struct timeval timeout
 int ctdb_ctrl_enablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
 int ctdb_ctrl_disablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
 
+struct ctdb_ban_time {
+	uint32_t pnn;
+	uint32_t time;
+};
+
+int ctdb_ctrl_set_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_ban_time *bantime);
+int ctdb_ctrl_get_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, struct ctdb_ban_time **bantime);
+
+
 #endif
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 0660dc8..3528a5c 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -226,6 +226,8 @@ struct ctdb_node {
 	   by each node.
 	*/
 	struct ctdb_all_public_ips *public_ips;
+	/* used by the recovery dameon to track when a node should be banned */
+	struct ctdb_banning_state *ban_state; 
 };
 
 /*
@@ -429,6 +431,7 @@ struct ctdb_context {
 	TALLOC_CTX *release_ips_ctx; /* a context used to automatically drop all IPs if we fail to recover the node */
 	TALLOC_CTX *script_monitoring_ctx; /* a context where we store results while running the monitor event */
 	TALLOC_CTX *last_monitoring_ctx; 
+	TALLOC_CTX *banning_ctx;
 };
 
 struct ctdb_db_context {
@@ -587,6 +590,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
 		    CTDB_CONTROL_EVENT_SCRIPT_DISABLED   = 106,
 		    CTDB_CONTROL_ENABLE_SCRIPT           = 107,
 		    CTDB_CONTROL_DISABLE_SCRIPT          = 108,
+		    CTDB_CONTROL_SET_BAN_STATE           = 109,
+		    CTDB_CONTROL_GET_BAN_STATE           = 110,
 };	
 
 /*
@@ -1469,4 +1474,7 @@ int ctdb_vacuum_init(struct ctdb_db_context *ctdb_db);
 int32_t ctdb_control_enable_script(struct ctdb_context *ctdb, TDB_DATA indata);
 int32_t ctdb_control_disable_script(struct ctdb_context *ctdb, TDB_DATA indata);
 
+int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata);
+int32_t ctdb_control_get_ban_state(struct ctdb_context *ctdb, TDB_DATA *outdata);
+
 #endif
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 573fde6..f9df0fc 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -4,7 +4,7 @@ Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
-Version: 1.0.88
+Version: 1.0.89
 Release: 1
 Epoch: 0
 License: GNU GPL version 3
@@ -131,6 +131,15 @@ fi
 %{_libdir}/pkgconfig/ctdb.pc
 
 %changelog
+* Thu Sep 3 2009 : Version 1.0.89
+ - Make it possible to manage winbind independently of samba.
+ - Add new prototype banning code
+ - Overwrite the vsftpd state file instead of appending. This eliminates
+   annoying errors in the log.
+ - Redirect some iptables commands to dev null
+ - From Michael A, explicitely set the broadcast when we takeover a public ip
+ - Remove a reclock file check we no longer need
+ - Skip any persistent database files ending in .bak
 * Mon Aug 17 2009 : Version 1.0.88
  - Add a new state for eventscripts : DISABLED.
    Add two new commands "ctdb enablescript/disablescript" to enable/disable
diff --git a/server/ctdb_banning.c b/server/ctdb_banning.c
new file mode 100644
index 0000000..5dfcef1
--- /dev/null
+++ b/server/ctdb_banning.c
@@ -0,0 +1,121 @@
+/* 
+   ctdb banning code
+
+   Copyright (C) Ronnie Sahlberg  2009
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+#include "includes.h"
+#include "lib/events/events.h"
+#include "lib/tdb/include/tdb.h"
+#include "system/time.h"
+#include "system/network.h"
+#include "system/filesys.h"
+#include "system/wait.h"
+#include "../include/ctdb.h"
+#include "../include/ctdb_private.h"
+
+
+static void
+ctdb_ban_node_event(struct event_context *ev, struct timed_event *te, 
+			       struct timeval t, void *private_data)
+{
+	struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
+
+	DEBUG(DEBUG_ERR,("Banning timedout\n"));
+	ctdb->nodes[ctdb->pnn]->flags &= ~NODE_FLAGS_BANNED;
+
+	if (ctdb->banning_ctx != NULL) {
+		talloc_free(ctdb->banning_ctx);
+		ctdb->banning_ctx = NULL;
+	}
+}
+
+int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
+{
+	struct ctdb_ban_time *bantime = (struct ctdb_ban_time *)indata.dptr;
+
+	DEBUG(DEBUG_INFO,("SET BAN STATE\n"));
+
+	if (bantime->pnn != ctdb->pnn) {
+		if (bantime->pnn < 0 || bantime->pnn >= ctdb->num_nodes) {
+			DEBUG(DEBUG_ERR,(__location__ " ERROR: Invalid ban request. PNN:%d is invalid. Max nodes %d\n", bantime->pnn, ctdb->num_nodes));
+			return -1;
+		}
+		if (bantime->time == 0) {
+			DEBUG(DEBUG_INFO,("unbanning node %d\n", bantime->pnn));
+			ctdb->nodes[bantime->pnn]->flags &= ~NODE_FLAGS_BANNED;
+		} else {
+			DEBUG(DEBUG_INFO,("banning node %d\n", bantime->pnn));
+			if (ctdb->tunable.enable_bans == 0) {
+				DEBUG(DEBUG_INFO,("Bans are disabled - ignoring ban of node %u\n", bantime->pnn));
+				return 0;
+			}
+
+			ctdb->nodes[bantime->pnn]->flags |= NODE_FLAGS_BANNED;
+		}
+		return 0;
+	}
+
+	if (ctdb->banning_ctx != NULL) {
+		talloc_free(ctdb->banning_ctx);
+		ctdb->banning_ctx = NULL;
+	}
+
+	if (bantime->time == 0) {
+		DEBUG(DEBUG_ERR,("Unbanning this node\n"));
+		ctdb->nodes[bantime->pnn]->flags &= ~NODE_FLAGS_BANNED;
+		return 0;
+	}
+
+	if (ctdb->tunable.enable_bans == 0) {
+		DEBUG(DEBUG_ERR,("Bans are disabled - ignoring ban of node %u\n", bantime->pnn));
+		return 0;
+	}
+
+	ctdb->banning_ctx = talloc(ctdb, struct ctdb_ban_time);
+	if (ctdb->banning_ctx == NULL) {
+		DEBUG(DEBUG_CRIT,(__location__ " ERROR Failed to allocate new banning state\n"));
+		return -1;
+	}
+	*((struct ctdb_ban_time *)(ctdb->banning_ctx)) = *bantime;
+
+
+	DEBUG(DEBUG_ERR,("Banning this node for %d seconds\n", bantime->time));
+	ctdb->nodes[bantime->pnn]->flags |= NODE_FLAGS_BANNED;
+
+	event_add_timed(ctdb->ev, ctdb->banning_ctx, timeval_current_ofs(bantime->time,0), ctdb_ban_node_event, ctdb);
+	
+	return 0;
+}
+
+int32_t ctdb_control_get_ban_state(struct ctdb_context *ctdb, TDB_DATA *outdata)
+{
+	struct ctdb_ban_time *bantime;
+
+	bantime = talloc(outdata, struct ctdb_ban_time);
+	CTDB_NO_MEMORY(ctdb, bantime);
+
+	if (ctdb->banning_ctx != NULL) {
+		*bantime = *(struct ctdb_ban_time *)(ctdb->banning_ctx);
+	} else {
+		bantime->pnn = ctdb->pnn;
+		bantime->time = 0;
+	}
+
+	outdata->dptr  = (uint8_t *)bantime;
+	outdata->dsize = sizeof(struct ctdb_ban_time);
+
+	return 0;
+}
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index 7798d52..9521305 100644
--- a/server/ctdb_control.c
+++ b/server/ctdb_control.c
@@ -518,6 +518,14 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 	case CTDB_CONTROL_DISABLE_SCRIPT:
 		return ctdb_control_disable_script(ctdb, indata);
 
+	case CTDB_CONTROL_SET_BAN_STATE:
+		CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_ban_time));
+		return ctdb_control_set_ban_state(ctdb, indata);
+
+	case CTDB_CONTROL_GET_BAN_STATE:
+		CHECK_CONTROL_DATA_SIZE(0);
+		return ctdb_control_get_ban_state(ctdb, outdata);
+
 	default:
 		DEBUG(DEBUG_CRIT,(__location__ " Unknown CTDB control opcode %u\n", opcode));
 		return -1;
diff --git a/server/ctdb_monitor.c b/server/ctdb_monitor.c
index 3632aaf..1e8f8c8 100644
--- a/server/ctdb_monitor.c
+++ b/server/ctdb_monitor.c
@@ -306,6 +306,14 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
 		}
 	}
 
+	/* we dont let other nodes modify our BANNED status */
+	if (c->pnn == ctdb->pnn) {
+		node->flags &= ~NODE_FLAGS_BANNED;
+		if (old_flags & NODE_FLAGS_BANNED) {
+			node->flags |= NODE_FLAGS_BANNED;
+		}
+	}
+
 	if (node->flags == c->old_flags) {
 		DEBUG(DEBUG_INFO, ("Control modflags on node %u - Unchanged - flags 0x%x\n", c->pnn, node->flags));
 		return 0;
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index b661305..7a4f6c5 100644
--- a/server/ctdb_recoverd.c


-- 
CTDB repository


More information about the samba-cvs mailing list