Rev 481: handle the case of all nodes being sick for one service in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Jun 6 06:50:00 GMT 2007


------------------------------------------------------------
revno: 481
revision-id: tridge at samba.org-20070606064959-prbxq97dwqthth82
parent: tridge at samba.org-20070606034512-rg9avvcsos0j29oc
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-06-06 16:49:59 +1000
message:
  handle the case of all nodes being sick for one service
modified:
  takeover/ctdb_takeover.c       ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
=== modified file 'takeover/ctdb_takeover.c'
--- a/takeover/ctdb_takeover.c	2007-06-06 03:45:12 +0000
+++ b/takeover/ctdb_takeover.c	2007-06-06 06:49:59 +0000
@@ -432,6 +432,28 @@
 					break;
 				}
 			}
+			
+			/* if no enabled node can take it, then we
+			   might as well use any connected node. It
+			   probably means that some subsystem (such as
+			   NFS) is sick on all nodes. Best we can do
+			   is to keep the other services up. */
+			if (j == i) {
+				for (j=(i+1)%nodemap->num;
+				     j != i;
+				     j=(j+1)%nodemap->num) {
+					if ((nodemap->nodes[j].flags & NODE_FLAGS_CONNECTED) &&
+					    ctdb_same_subnet(ctdb->nodes[j]->public_address, 
+							     ctdb->nodes[i]->public_address, 
+							     ctdb->nodes[j]->public_netmask_bits)) {
+						ctdb->nodes[i]->takeover_vnn = nodemap->nodes[j].vnn;
+						DEBUG(0,("All available nodes disabled for %s - using a connected node\n",
+							 ctdb->nodes[i]->public_address));
+						break;
+					}
+				}
+			}
+			
 			if (j == i) {
 				DEBUG(0,(__location__ " No node available on same network to take %s\n",
 					 ctdb->nodes[i]->public_address));



More information about the samba-cvs mailing list