Rev 401: we need to listen at transport initialise stage to find our own node number in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed May 30 04:46:15 GMT 2007


------------------------------------------------------------
revno: 401
revision-id: tridge at samba.org-20070530044614-e6rt2yb1v1345p34
parent: tridge at samba.org-20070530043522-e7fwbj5jcoq6m8b1
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-05-30 14:46:14 +1000
message:
  we need to listen at transport initialise stage to find our own node number
modified:
  common/ctdb_monitor.c          ctdb_monitor.c-20070518100625-8jf4ft1mjzmb22ck-1
  ib/ibw_ctdb_init.c             ibw_ctdb_init.c-20070102171305-cn2z4k7ibx8141d5-1
  tcp/tcp_init.c                 tcp_init.c-20061128004937-x70q1cu5xzg5g2tm-2
=== modified file 'common/ctdb_monitor.c'
--- a/common/ctdb_monitor.c	2007-05-20 23:24:34 +0000
+++ b/common/ctdb_monitor.c	2007-05-30 04:46:14 +0000
@@ -64,13 +64,14 @@
 
 		if (node->dead_count >= CTDB_MONITORING_DEAD_COUNT) {
 			ctdb_node_dead(node);
+			ctdb_send_keepalive(ctdb, node->vnn);
 			/* maybe tell the transport layer to kill the
 			   sockets as well?
 			*/
 			continue;
 		}
 		
-		if (node->tx_cnt == 0) {
+		if (node->tx_cnt == 0 && (node->flags & NODE_FLAGS_CONNECTED)) {
 			ctdb_send_keepalive(ctdb, node->vnn);
 		}
 

=== modified file 'ib/ibw_ctdb_init.c'
--- a/ib/ibw_ctdb_init.c	2007-05-30 03:26:50 +0000
+++ b/ib/ibw_ctdb_init.c	2007-05-30 04:46:14 +0000
@@ -88,6 +88,10 @@
 		}
 	}
 
+	/* listen on our own address */
+	if (ctdb_ibw_listen(ctdb, 10)) /* TODO: backlog as param */
+		return -1;
+
 	return 0;
 }
 
@@ -99,10 +103,6 @@
 {
 	int i, ret;
 
-	/* listen on our own address */
-	if (ctdb_ibw_listen(ctdb, 10)) /* TODO: backlog as param */
-		return -1;
-
 	/* everything async here */
 	for (i=0;i<ctdb->num_nodes;i++) {
 		struct ctdb_node *node = ctdb->nodes[i];

=== modified file 'tcp/tcp_init.c'
--- a/tcp/tcp_init.c	2007-05-30 03:26:50 +0000
+++ b/tcp/tcp_init.c	2007-05-30 04:46:14 +0000
@@ -52,6 +52,9 @@
 {
 	int i;
 
+	/* listen on our own address */
+	if (ctdb_tcp_listen(ctdb) != 0) return -1;
+
 	for (i=0; i<ctdb->num_nodes; i++) {
 		if (ctdb_tcp_add_node(ctdb->nodes[i]) != 0) {
 			DEBUG(0, ("methods->add_node failed at %d\n", i));
@@ -69,9 +72,6 @@
 {
 	int i;
 
-	/* listen on our own address */
-	if (ctdb_tcp_listen(ctdb) != 0) return -1;
-
 	/* startup connections to the other servers - will happen on
 	   next event loop */
 	for (i=0;i<ctdb->num_nodes;i++) {



More information about the samba-cvs mailing list