Rev 648: add config option for disabling bans in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Mon Oct 15 03:22:58 GMT 2007


------------------------------------------------------------
revno: 648
revision-id: tridge at samba.org-20071015032258-at61ri1m8z1f62ui
parent: tridge at samba.org-20071010004522-256h49icxxzz7wcb
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Mon 2007-10-15 13:22:58 +1000
message:
  add config option for disabling bans
modified:
  include/ctdb_private.h         ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  server/ctdb_recoverd.c         recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
  server/ctdb_tunables.c         ctdb_tunables.c-20070604095258-4m34d7cm1qa7yos9-1
=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h	2007-09-24 00:12:18 +0000
+++ b/include/ctdb_private.h	2007-10-15 03:22:58 +0000
@@ -87,6 +87,7 @@
 	uint32_t recovery_ban_period;
 	uint32_t database_hash_size;
 	uint32_t rerecovery_timeout;
+	uint32_t enable_bans;
 };
 
 /*

=== modified file 'server/ctdb_recoverd.c'
--- a/server/ctdb_recoverd.c	2007-10-05 03:51:31 +0000
+++ b/server/ctdb_recoverd.c	2007-10-15 03:22:58 +0000
@@ -59,7 +59,7 @@
 	struct ctdb_context *ctdb = rec->ctdb;
 
 	if (!ctdb_validate_pnn(ctdb, pnn)) {
-		DEBUG(0,("Bad pnn %u in ctdb_ban_node\n", pnn));
+		DEBUG(0,("Bad pnn %u in ctdb_unban_node\n", pnn));
 		return;
 	}
 
@@ -99,6 +99,11 @@
 		return;
 	}
 
+	if (0 == ctdb->tunable.enable_bans) {
+		DEBUG(0,("Bans are disabled - ignoring ban of node %u\n", pnn));
+		return;
+	}
+
 	if (pnn == ctdb->pnn) {
 		DEBUG(0,("self ban - lowering our election priority\n"));
 		/* banning ourselves - lower our election priority */

=== modified file 'server/ctdb_tunables.c'
--- a/server/ctdb_tunables.c	2007-09-24 00:12:18 +0000
+++ b/server/ctdb_tunables.c	2007-10-15 03:22:58 +0000
@@ -43,6 +43,7 @@
 	{ "RecoveryBanPeriod",  300,  offsetof(struct ctdb_tunable, recovery_ban_period) },
 	{ "DatabaseHashSize", 10000,  offsetof(struct ctdb_tunable, database_hash_size) },
 	{ "RerecoveryTimeout",   10,  offsetof(struct ctdb_tunable, rerecovery_timeout) },
+	{ "EnableBans",           1,  offsetof(struct ctdb_tunable, enable_bans) },
 };
 
 /*



More information about the samba-cvs mailing list