[SCM] CTDB repository - branch 1.0.114 updated - ctdb-1.0.114.2-3-g8ee1e84

Stefan Metzmacher metze at samba.org
Thu Jul 14 04:48:32 MDT 2011


The branch, 1.0.114 has been updated
       via  8ee1e84498fd91ffbd2f58edc5ac789df9679c80 (commit)
       via  6ba8af28f8a8f79db65120a97d7157dcc5c7e083 (commit)
       via  2f6749d2a67f76129312c00a907380b681797ed5 (commit)
      from  14a1bf4fff4ce4a48704d09324e4757fbf043f92 (commit)

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


- Log -----------------------------------------------------------------
commit 8ee1e84498fd91ffbd2f58edc5ac789df9679c80
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 13 15:17:24 2011 +0200

    Version 1.0.114.3
    
    metze

commit 6ba8af28f8a8f79db65120a97d7157dcc5c7e083
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jun 21 15:49:30 2011 +0200

    recoverd: try to become the recovery master if we have the capability, but the current master doesn't
    
    metze

commit 2f6749d2a67f76129312c00a907380b681797ed5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jun 21 15:46:34 2011 +0200

    recoverd: let async_getcap_callback() also update ctdb->capabilities
    
    metze

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

Summary of changes:
 packaging/RPM/ctdb.spec.in |    4 +++-
 server/ctdb_recoverd.c     |   27 ++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 33e9035..7128db7 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -4,7 +4,7 @@ Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
-Version: 1.0.114.2
+Version: 1.0.114.3
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -127,6 +127,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_docdir}/ctdb/tests/bin/ctdb_transaction
 
 %changelog
+* Wed Jul 13 2011 : Version 1.0.114.3
+ - Stefan Metzmacher: make sure the recovery master has CTDB_CAP_RECMASTER
 * Fri May 20 2011 : Version 1.0.114.2
  - new series of releases based off 1.0.114
  - Stefan Metzmacher: robustness fixes for banning/recovery lock
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index c58b444..93af64e 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -218,6 +218,10 @@ static void async_getcap_callback(struct ctdb_context *ctdb, uint32_t node_pnn,
 	if (node_pnn < ctdb->num_nodes) {
 		ctdb->nodes[node_pnn]->capabilities = *((uint32_t *)outdata.dptr);
 	}
+
+	if (node_pnn == ctdb->pnn) {
+		ctdb->capabilities = ctdb->nodes[node_pnn]->capabilities;
+	}
 }
 
 /*
@@ -2968,6 +2972,13 @@ again:
 	}
 	nodemap = rec->nodemap;
 
+	/* update the capabilities for all nodes */
+	ret = update_capabilities(ctdb, nodemap);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, (__location__ " Unable to update node capabilities.\n"));
+		goto again;
+	}
+
 	/* check which node is the recovery master */
 	ret = ctdb_ctrl_getrecmaster(ctdb, mem_ctx, CONTROL_TIMEOUT(), pnn, &rec->recmaster);
 	if (ret != 0) {
@@ -2990,7 +3001,6 @@ again:
 		goto again;
 	}
 
-
 	/* if the local daemon is STOPPED, we verify that the databases are
 	   also frozen and thet the recmode is set to active 
 	*/
@@ -3025,6 +3035,21 @@ again:
 		goto again;
 	}
 	
+	/*
+	 * if the current recmaster do not have CTDB_CAP_RECMASTER,
+	 * but we have force an election and try to become the new
+	 * recmaster
+	 */
+	if ((rec->ctdb->nodes[rec->recmaster]->capabilities & CTDB_CAP_RECMASTER) == 0 &&
+	    (rec->ctdb->capabilities & CTDB_CAP_RECMASTER) &&
+	     !(nodemap->nodes[pnn].flags & NODE_FLAGS_INACTIVE)) {
+		DEBUG(DEBUG_ERR, (__location__ " Current recmaster node %u does not have CAP_RECMASTER,"
+				  " but we (node %u) have - force an election\n",
+				  rec->recmaster, pnn));
+		force_election(rec, pnn, nodemap);
+		goto again;
+	}
+
 	/* check that we (recovery daemon) and the local ctdb daemon
 	   agrees on whether we are banned or not
 	*/


-- 
CTDB repository


More information about the samba-cvs mailing list