[SCM] CTDB repository - branch 1.2 updated - ctdb-1.9.1-252-g4ff998b

Ronnie Sahlberg sahlberg at samba.org
Thu Dec 2 19:56:11 MST 2010


The branch, 1.2 has been updated
       via  4ff998bf33cfa6d1222f7c8f8eba3aeec0f36e6e (commit)
       via  2957e0a2d958c06d22c4dc2f5518d786392b5cb4 (commit)
       via  7cf2a812c72369c530267d19d0b94d2eec40d43e (commit)
       via  64831f94b380731b91ff3a8ce0289401048df617 (commit)
      from  981550e3ae8c1884a8c8f7786d0549e6144794e0 (commit)

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


- Log -----------------------------------------------------------------
commit 4ff998bf33cfa6d1222f7c8f8eba3aeec0f36e6e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Dec 3 13:28:35 2010 +1100

    during ip allocation, there are failure modes where a node might hold a ip address
    but thinks it is still unassigned (-1).
    
    add code to the recovery daemon to detect this case and trigger a reallocation
    so that the ip gets covered
    
    and change the takeip code to allow for this condition, taking on an ip address that is
    already hosted.
    
    cq s1021073

commit 2957e0a2d958c06d22c4dc2f5518d786392b5cb4
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Dec 3 06:08:44 2010 +1100

    new version 1.2.13

commit 7cf2a812c72369c530267d19d0b94d2eec40d43e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Dec 3 06:07:03 2010 +1100

    dont try starting samba through the "init" event

commit 64831f94b380731b91ff3a8ce0289401048df617
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Nov 29 19:31:05 2010 +1100

    new version 1.2.12

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

Summary of changes:
 config/events.d/50.samba   |    2 ++
 packaging/RPM/ctdb.spec.in |    7 ++++++-
 server/ctdb_recoverd.c     |   14 ++++++++++----
 server/ctdb_takeover.c     |    9 +++++++++
 4 files changed, 27 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index 54a29cf..6e84f5f 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -206,8 +206,10 @@ periodic_cleanup() {
 
 ###########################
 
+[ "$1" = "init" ] || {
 ctdb_start_stop_service
 ctdb_start_stop_service "winbind"
+}
 
 is_ctdb_managed_service || is_ctdb_managed_service "winbind" || exit 0
 
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 8f55779..3b830f0 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -3,7 +3,7 @@ Name: ctdb
 Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
-Version: 1.2.11
+Version: 1.2.13
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -142,6 +142,11 @@ development libraries for ctdb
 %{_libdir}/libctdb.a
 
 %changelog
+* Fri Dec 3 2010 : Version 1.2.13
+ - Fix a bug with the script autostart feature.
+   Dont try to start samba during the init event
+* Mon Nov 29 2010 : Version 1.2.12
+ - If we are no longer natgw master, tell winbind to recycle the socket.
 * Mon Nov 22 2010 : Version 1.2.11
  - Fix bugs in the evenstcripts where we are supposed to automatically
    start/stop services when CTDB_MANAGES_* changes, and we were not.
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index c6bf658..9caa502 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -2495,7 +2495,7 @@ static enum monitor_result verify_recmaster(struct ctdb_recoverd *rec, struct ct
 
 /* called to check that the local allocation of public ip addresses is ok.
 */
-static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, uint32_t pnn)
+static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, uint32_t pnn, struct ctdb_node_map *nodemap)
 {
 	TALLOC_CTX *mem_ctx = talloc_new(NULL);
 	struct ctdb_control_get_ifaces *ifaces = NULL;
@@ -2586,11 +2586,17 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
 	   and we dont have ones we shouldnt have.
 	   if we find an inconsistency we set recmode to
 	   active on the local node and wait for the recmaster
-	   to do a full blown recovery
+	   to do a full blown recovery.
+	   also if the pnn is -1 and we are healthy and can host the ip
+	   we also request a ip reallocation.
 	*/
 	if (ctdb->tunable.disable_ip_failover == 0) {
 		for (j=0; j<ips->num; j++) {
-			if (ips->ips[j].pnn == pnn) {
+			if (ips->ips[j].pnn == -1 && nodemap->nodes[pnn].flags == 0) {
+				DEBUG(DEBUG_CRIT,("Public address '%s' is not assigned and we could serve this ip\n",
+						ctdb_addr_to_str(&ips->ips[j].addr)));
+				need_takeover_run = true;
+			} else if (ips->ips[j].pnn == pnn) {
 				if (!ctdb_sys_have_ip(&ips->ips[j].addr)) {
 					DEBUG(DEBUG_CRIT,("Public address '%s' is missing and we should serve this ip\n",
 						ctdb_addr_to_str(&ips->ips[j].addr)));
@@ -3122,7 +3128,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 	 */ 
 	if (ctdb->tunable.disable_ip_failover == 0) {
 		if (rec->ip_check_disable_ctx == NULL) {
-			if (verify_local_ip_allocation(ctdb, rec, pnn) != 0) {
+			if (verify_local_ip_allocation(ctdb, rec, pnn, nodemap) != 0) {
 				DEBUG(DEBUG_ERR, (__location__ " Public IPs were inconsistent.\n"));
 			}
 		}
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index d495807..682d17b 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -611,6 +611,15 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
 		return -1;
 	}
 
+	if (vnn->pnn == -1 && have_ip) {
+		vnn->pnn = ctdb->pnn;
+		DEBUG(DEBUG_CRIT,(__location__ " takeoverip of IP %s is known to the kernel, "
+				  "and we already have it on iface[%s], update local daemon\n",
+				 ctdb_addr_to_str(&vnn->public_address),
+				  ctdb_vnn_iface_string(vnn)));
+		return 0;
+	}
+
 	if (vnn->iface) {
 		if (vnn->iface->link_up) {
 			/* only move when the rebalance gains something */


-- 
CTDB repository


More information about the samba-cvs mailing list