[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Thu Feb 27 05:56:04 MST 2014


The branch, master has been updated
       via  7d05baa ctdb-recoverd: Check if callback function is registered before calling
       via  0269965 ctdb-daemon: After updating tickles on other nodes, set update flag to false
       via  0723fed ctdb-daemon: Implement ctdb_control_startup()
       via  75ca121 ctdb-daemon: Fix whitespaces
       via  f2cd999 ctdb-daemon: Always talloc tickle array off vnn instead of ctdb->nodes
      from  9b20055 waf: Add option to specify perl vendor dir.

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


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

    ctdb-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

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

    ctdb-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>

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

    ctdb-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>

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

    ctdb-daemon: Fix whitespaces
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

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

    ctdb-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>

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

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


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index d2b2a9e..fe4f472 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -2578,8 +2578,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
@@ -3052,9 +3057,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;
 
@@ -3076,7 +3079,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),
@@ -3090,11 +3093,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),
@@ -3186,12 +3188,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;
 }
 
@@ -3854,11 +3864,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;
@@ -3868,7 +3878,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;
@@ -3876,12 +3886,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;
 }
 
@@ -4006,6 +4016,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;
 		}
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list