[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-128-g46b0933

Ronnie Sahlberg sahlberg at samba.org
Tue Aug 3 00:43:53 MDT 2010


The branch, 1.0.112 has been updated
       via  46b093324c01c56a12fdde0b47980ee57c33c00e (commit)
       via  5e60aad0e19cabb29c3be191698e10049da151c7 (commit)
       via  31f510cceb124e89811c58d29fae336982c2e1a4 (commit)
      from  20579b46300517d11f4c12c640aa365e0cfd0658 (commit)

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


- Log -----------------------------------------------------------------
commit 46b093324c01c56a12fdde0b47980ee57c33c00e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 3 15:42:25 2010 +1000

    New version 1.0.112-31
    
     - Retry the vacuum abort code.
     - Add codestyle doc
     - When rebalancing ip addresses, increase number of iterations from 5
     - When using deterministic ips, dont force ips without home address
       to move back.

commit 5e60aad0e19cabb29c3be191698e10049da151c7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 3 14:12:17 2010 +1000

    For deterministic IPs, check if the designated node can host the ip before
    we try to reassign it back to the home node.
    
    If it can not, of if it is unknown, just leave the ip where it is.
    
    This reduces the amount of "flapping" an ip address with no home node
    does during recoveries.

commit 31f510cceb124e89811c58d29fae336982c2e1a4
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 3 13:34:27 2010 +1000

    When trying to re-balance the ip assignment and shuffle ips from
    nodes with many addresses to nodes with few addresses,
    loop up to num_ips+5 times instead of only 5 times.
    
    When we have very many public ips per node, we might need to loop more than
    5 times or else we will exit without reaching optimal balance.

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

Summary of changes:
 packaging/RPM/ctdb.spec.in |    8 +++++++-
 server/ctdb_takeover.c     |   21 ++++++++++++++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 4017e24..dbe626a 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0.112
-Release: 30
+Release: 31
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -125,6 +125,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_docdir}/ctdb/tests/bin/ctdb_transaction
 
 %changelog
+* Tue Aug 3 2010 : Version 1.0.112-31
+ - Retry the vacuum abort code.
+ - Add codestyle doc
+ - When rebalancing ip addresses, increase number of iterations from 5
+ - When using deterministic ips, dont force ips without home address
+   to move back.
 * Mon Jul 26 2010 : Version 1.0.112-30
  - last minute fix for crash bug in the recent "vacuum abort" code.
 
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index 6c771e0..d0de683 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -737,7 +737,7 @@ create_merged_ip_list(struct ctdb_context *ctdb)
  */
 int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
 {
-	int i, num_healthy, retries;
+	int i, num_healthy, retries, num_ips;
 	struct ctdb_public_ip ip;
 	struct ctdb_public_ipv4 ipv4;
 	uint32_t mask;
@@ -782,6 +782,12 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
 	*/
 	all_ips = create_merged_ip_list(ctdb);
 
+	/* Count how many ips we have */
+	num_ips = 0;
+	for (tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next) {
+		num_ips++;
+	}
+
 	/* If we want deterministic ip allocations, i.e. that the ip addresses
 	   will always be allocated the same way for a specific set of
 	   available/unavailable nodes.
@@ -789,7 +795,12 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
 	if (1 == ctdb->tunable.deterministic_public_ips) {		
 		DEBUG(DEBUG_NOTICE,("Deterministic IPs enabled. Resetting all ip allocations\n"));
 		for (i=0,tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next,i++) {
-			tmp_ip->pnn = i%nodemap->num;
+			int tmp_pnn;
+
+			tmp_pnn = i%nodemap->num;
+			if (can_node_serve_ip(ctdb, tmp_pnn, tmp_ip) == 0) {
+				tmp_ip->pnn = tmp_pnn;
+			}
 		}
 	}
 
@@ -915,11 +926,11 @@ try_again:
 		/* if the spread between the smallest and largest coverage by
 		   a node is >=2 we steal one of the ips from the node with
 		   most coverage to even things out a bit.
-		   try to do this at most 5 times  since we dont want to spend
-		   too much time balancing the ip coverage.
+		   try to do this a limited number of times since we dont
+		   want to spend too much time balancing the ip coverage.
 		*/
 		if ( (maxnum > minnum+1)
-		  && (retries < 5) ){
+		  && (retries < (num_ips + 5)) ){
 			struct ctdb_public_ip_list *tmp;
 
 			/* mark one of maxnode's vnn's as unassigned and try


-- 
CTDB repository


More information about the samba-cvs mailing list