Rev 404: tell newly connected nodes about any tcp tickle records that we have that they don't have in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed May 30 06:37:40 GMT 2007


------------------------------------------------------------
revno: 404
revision-id: tridge at samba.org-20070530063739-zc29gbh3p4b307ic
parent: tridge at samba.org-20070530061139-3n42c8eoi2nk007e
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-05-30 16:37:39 +1000
message:
  tell newly connected nodes about any tcp tickle records that we have that they don't have
modified:
  takeover/ctdb_takeover.c       ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
=== modified file 'takeover/ctdb_takeover.c'
--- a/takeover/ctdb_takeover.c	2007-05-30 06:11:39 +0000
+++ b/takeover/ctdb_takeover.c	2007-05-30 06:37:39 +0000
@@ -463,6 +463,13 @@
 
 	if (NULL == ctdb_tcp_find(ctdb->tcp_list, tcp)) {
 		DLIST_ADD(ctdb->tcp_list, tcp);
+		DEBUG(2,("Added tickle info for %s:%u from vnn %u\n",
+			 inet_ntoa(tcp->daddr.sin_addr), ntohs(tcp->daddr.sin_port),
+			 tcp->vnn));
+	} else {
+		DEBUG(4,("Already had tickle info for %s:%u from vnn %u\n",
+			 inet_ntoa(tcp->daddr.sin_addr), ntohs(tcp->daddr.sin_port),
+			 tcp->vnn));
 	}
 
 	return 0;
@@ -484,7 +491,11 @@
 
 	tcp = ctdb_tcp_find(ctdb->tcp_list, &t);
 	if (tcp) {
+		DEBUG(2,("Removed tickle info for %s:%u from vnn %u\n",
+			 inet_ntoa(tcp->daddr.sin_addr), ntohs(tcp->daddr.sin_port),
+			 tcp->vnn));
 		DLIST_REMOVE(ctdb->tcp_list, tcp);
+		talloc_free(tcp);
 	}
 
 	return 0;
@@ -503,6 +514,24 @@
 			DLIST_REMOVE(ctdb->tcp_list, tcp);
 			talloc_free(tcp);
 		}
+
+		/* and tell the new guy about any that he should have
+		   from us */
+		if (tcp->vnn == ctdb->vnn) {
+			struct ctdb_control_tcp_vnn t;
+			TDB_DATA data;
+
+			t.vnn  = tcp->vnn;
+			t.src  = tcp->saddr;
+			t.dest = tcp->daddr;
+
+			data.dptr = (uint8_t *)&t;
+			data.dsize = sizeof(t);
+
+			ctdb_daemon_send_control(ctdb, vnn, 0, 
+						 CTDB_CONTROL_TCP_ADD,
+						 0, CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL);
+		}
 	}
 	return 0;
 }



More information about the samba-cvs mailing list