[SCM] CTDB repository - branch 2.5 updated - ctdb-2.5.2-15-ge56f920

Amitay Isaacs amitay at samba.org
Thu Feb 27 18:13:33 MST 2014


The branch, 2.5 has been updated
       via  e56f920a8bc1b52f4905032be63e8cf1f4519f19 (commit)
       via  35fae73a25024854c4553e0d9ecedc3789cb5a7f (commit)
       via  3cbd73aff9ded9fab7aa0b0e24ae71d3a5e5f416 (commit)
       via  c8905f3936a10d1d99a75e0e793295f9f9dadbb7 (commit)
       via  d1ea9538b8911ec1d67eb14b0b47687e0eb660a7 (commit)
      from  bd4edfbf7384d39448bedfb64e2f91411ad75e54 (commit)

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


- Log -----------------------------------------------------------------
commit e56f920a8bc1b52f4905032be63e8cf1f4519f19
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Feb 27 12:41:23 2014 +1100

    recoverd: Check if callback function is registered before calling
    
    Fix suggested by by Kevin Osborn <kosborn at overlandstorage.com>.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Thu Feb 27 13:54:59 CET 2014 on sn-devel-104
    
    (Imported from commit 7d05baa96b5c49629803a98ec8160d2c5c51c839)

commit 35fae73a25024854c4553e0d9ecedc3789cb5a7f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 29 15:54:35 2014 +1100

    daemon: After updating tickles on other nodes, set update flag to false
    
    tcp_update_flag is set to true whenever tickles are added or deleted.
    This flag is used to determine whether or not to send tickles list to
    other nodes.  Once tickles list is sent to other nodes successfully,
    set tcp_update_flag to false, so ctdbd does not keep sending same tickles
    list every TickleUpdateInterval (20 seconds).
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 026996550d726836091ff5ebd1ebf925bf237bb0)

commit 3cbd73aff9ded9fab7aa0b0e24ae71d3a5e5f416
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Feb 27 13:47:28 2014 +1100

    daemon: Implement ctdb_control_startup()
    
    This doesn't implement what was recommended.  That would require
    careful error handling, probably with a fallback to this code anyway.
    This is simple and does no worse that the current code.  That is, the
    new node is updated on the next call to tdb_update_tcp_tickles().
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 0723fedcedd4a97870f7b1224945f1587363c9bf)

commit c8905f3936a10d1d99a75e0e793295f9f9dadbb7
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 22 15:00:48 2014 +1100

    daemon: Fix whitespaces
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 75ca1216a63d0a404466bfb94a1fba1e478b80c6)

commit d1ea9538b8911ec1d67eb14b0b47687e0eb660a7
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 22 15:00:33 2014 +1100

    daemon: Always talloc tickle array off vnn instead of ctdb->nodes
    
    This fixes ctdb crash reported in bug #10366.
    Fix suggested by Kevin Osborn <kosborn at overlandstorage.com>.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit f2cd999189ee841fe81115e0873ab5e6a3fc265d)

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

Summary of changes:
 server/ctdb_takeover.c |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index d3a6e25..ba34e8b 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -2577,8 +2577,13 @@ static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
 		/* If the control timed out then that's a real error,
 		 * so call the real fail callback
 		 */
-		cd->fail_callback(ctdb, pnn, res, outdata,
-				  cd->fail_callback_data);
+		if (cd->fail_callback) {
+			cd->fail_callback(ctdb, pnn, res, outdata,
+					  cd->fail_callback_data);
+		} else {
+			DEBUG(DEBUG_WARNING,
+			      ("iprealloc timed out but no callback registered\n"));
+		}
 		break;
 	default:
 		/* If not a timeout then either the ipreallocated
@@ -3051,9 +3056,7 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata, bool tc
 
 	/* If this is the first tickle */
 	if (tcparray == NULL) {
-		tcparray = talloc_size(ctdb->nodes, 
-			offsetof(struct ctdb_tcp_array, connections) +
-			sizeof(struct ctdb_tcp_connection) * 1);
+		tcparray = talloc(vnn, struct ctdb_tcp_array);
 		CTDB_NO_MEMORY(ctdb, tcparray);
 		vnn->tcp_array = tcparray;
 
@@ -3075,7 +3078,7 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata, bool tc
 	/* Do we already have this tickle ?*/
 	tcp.src_addr = p->src_addr;
 	tcp.dst_addr = p->dst_addr;
-	if (ctdb_tcp_find(vnn->tcp_array, &tcp) != NULL) {
+	if (ctdb_tcp_find(tcparray, &tcp) != NULL) {
 		DEBUG(DEBUG_DEBUG,("Already had tickle info for %s:%u for vnn:%u\n",
 			ctdb_addr_to_str(&tcp.dst_addr),
 			ntohs(tcp.dst_addr.ip.sin_port),
@@ -3089,11 +3092,10 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata, bool tc
 					tcparray->num+1);
 	CTDB_NO_MEMORY(ctdb, tcparray->connections);
 
-	vnn->tcp_array = tcparray;
 	tcparray->connections[tcparray->num].src_addr = p->src_addr;
 	tcparray->connections[tcparray->num].dst_addr = p->dst_addr;
 	tcparray->num++;
-				
+
 	DEBUG(DEBUG_INFO,("Added tickle info for %s:%u from vnn %u\n",
 		ctdb_addr_to_str(&tcp.dst_addr),
 		ntohs(tcp.dst_addr.ip.sin_port),
@@ -3185,12 +3187,20 @@ int32_t ctdb_control_tcp_remove(struct ctdb_context *ctdb, TDB_DATA indata)
 
 
 /*
-  called when a daemon restarts - send all tickes for all public addresses
-  we are serving immediately to the new node.
+  Called when another daemon starts - caises all tickles for all
+  public addresses we are serving to be sent to the new node on the
+  next check.  This actually causes the next scheduled call to
+  tdb_update_tcp_tickles() to update all nodes.  This is simple and
+  doesn't require careful error handling.
  */
-int32_t ctdb_control_startup(struct ctdb_context *ctdb, uint32_t vnn)
+int32_t ctdb_control_startup(struct ctdb_context *ctdb, uint32_t pnn)
 {
-/*XXX here we should send all tickes we are serving to the new node */
+	struct ctdb_vnn *vnn;
+
+	for (vnn = ctdb->vnn; vnn != NULL; vnn = vnn->next) {
+		vnn->tcp_update_needed = true;
+	}
+
 	return 0;
 }
 
@@ -3853,11 +3863,11 @@ int32_t ctdb_control_set_tcp_tickle_list(struct ctdb_context *ctdb, TDB_DATA ind
 				 * list->tickles.num) {
 		DEBUG(DEBUG_ERR,("Bad indata in ctdb_control_set_tcp_tickle_list\n"));
 		return -1;
-	}	
+	}
 
 	vnn = find_public_ip_vnn(ctdb, &list->addr);
 	if (vnn == NULL) {
-		DEBUG(DEBUG_INFO,(__location__ " Could not set tcp tickle list, '%s' is not a public address\n", 
+		DEBUG(DEBUG_INFO,(__location__ " Could not set tcp tickle list, '%s' is not a public address\n",
 			ctdb_addr_to_str(&list->addr)));
 
 		return 1;
@@ -3867,7 +3877,7 @@ int32_t ctdb_control_set_tcp_tickle_list(struct ctdb_context *ctdb, TDB_DATA ind
 	talloc_free(vnn->tcp_array);
 	vnn->tcp_array = NULL;
 
-	tcparray = talloc(ctdb->nodes, struct ctdb_tcp_array);
+	tcparray = talloc(vnn, struct ctdb_tcp_array);
 	CTDB_NO_MEMORY(ctdb, tcparray);
 
 	tcparray->num = list->tickles.num;
@@ -3875,12 +3885,12 @@ int32_t ctdb_control_set_tcp_tickle_list(struct ctdb_context *ctdb, TDB_DATA ind
 	tcparray->connections = talloc_array(tcparray, struct ctdb_tcp_connection, tcparray->num);
 	CTDB_NO_MEMORY(ctdb, tcparray->connections);
 
-	memcpy(tcparray->connections, &list->tickles.connections[0], 
+	memcpy(tcparray->connections, &list->tickles.connections[0],
 	       sizeof(struct ctdb_tcp_connection)*tcparray->num);
 
 	/* We now have a new fresh tickle list array for this vnn */
-	vnn->tcp_array = talloc_steal(vnn, tcparray);
-	
+	vnn->tcp_array = tcparray;
+
 	return 0;
 }
 
@@ -4005,6 +4015,8 @@ static void ctdb_update_tcp_tickles(struct event_context *ev,
 		if (ret != 0) {
 			DEBUG(DEBUG_ERR,("Failed to send the tickle update for public address %s\n",
 				ctdb_addr_to_str(&vnn->public_address)));
+		} else {
+			vnn->tcp_update_needed = false;
 		}
 	}
 


-- 
CTDB repository


More information about the samba-cvs mailing list