[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.68-2-g9aca0c4

Amitay Isaacs amitay at samba.org
Sun Nov 3 21:45:13 MST 2013


The branch, 1.2.40 has been updated
       via  9aca0c4c9e50eb9b56c6d0307bc93ffedb84179a (commit)
       via  f4f1c20d789a5756effcae76902964d539b1cdd0 (commit)
      from  1dfb6c1e5fdc9676a7de58bb974f8dddd16e9366 (commit)

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


- Log -----------------------------------------------------------------
commit 9aca0c4c9e50eb9b56c6d0307bc93ffedb84179a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Nov 4 15:18:20 2013 +1100

    New version 1.2.69
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit f4f1c20d789a5756effcae76902964d539b1cdd0
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Oct 29 16:38:42 2013 +1100

    Revert "if a new node enters the cluster, that node will already be frozen at start"
    
    This is unnecessary due to 03e2e436db5cfd29a56d13f5d2101e42389bfc94.
    Furthermore, if a node doesn't force an election but wins it then it
    can fail to record that it is the new recovery master.  This can lead
    to a reverse split brain where there is no recovery master.
    
    This reverts commit c5035657606283d2e35bea40992505e84ca8e7be.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    
    Conflicts:
    	server/ctdb_recoverd.c
    
    (cherry picked from commit c8b542e059a54b8d524bd430cad9d82e5edd864d)

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

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


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index baaabbe..51e1f14 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.68
+Version: 1.2.69
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -155,6 +155,8 @@ development libraries for ctdb
 
 %changelog
 
+* Mon Nov 04 2013 : Version 1.2.69
+  - Nodes should always update recovery master during an election
 * Tue Sep 10 2013 : Version 1.2.68
   - Use fixed size queue buffers for fair scheduling across tevent FDs
   - Nodes to be used as forced rebalance targets must be healthy
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index 9f2c71c..f7cee58 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -1962,7 +1962,7 @@ static bool ctdb_election_win(struct ctdb_recoverd *rec, struct election_message
 /*
   send out an election request
  */
-static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn, bool update_recmaster)
+static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn)
 {
 	int ret;
 	TDB_DATA election_data;
@@ -1978,27 +1978,20 @@ static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn, bool u
 	election_data.dptr  = (unsigned char *)&emsg;
 
 
+	/* first we assume we will win the election and set 
+	   recoverymaster to be ourself on the current node
+	 */
+	ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), pnn, pnn);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, (__location__ " failed to send recmaster election request\n"));
+		return -1;
+	}
+
+
 	/* send an election message to all active nodes */
 	DEBUG(DEBUG_INFO,(__location__ " Send election request to all active nodes\n"));
 	ctdb_client_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
 
-
-	/* A new node that is already frozen has entered the cluster.
-	   The existing nodes are not frozen and dont need to be frozen
-	   until the election has ended and we start the actual recovery
-	*/
-	if (update_recmaster == true) {
-		/* first we assume we will win the election and set 
-		   recoverymaster to be ourself on the current node
-		 */
-		ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), pnn, pnn);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR, (__location__ " failed to send recmaster election request\n"));
-			return -1;
-		}
-	}
-
-
 	return 0;
 }
 
@@ -2036,7 +2029,7 @@ static void election_send_request(struct event_context *ev, struct timed_event *
 	struct ctdb_recoverd *rec = talloc_get_type(p, struct ctdb_recoverd);
 	int ret;
 
-	ret = send_election_request(rec, ctdb_get_pnn(rec->ctdb), false);
+	ret = send_election_request(rec, ctdb_get_pnn(rec->ctdb));
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send election request!\n"));
 	}
@@ -2392,7 +2385,7 @@ static void force_election(struct ctdb_recoverd *rec, uint32_t pnn,
 						timeval_current_ofs(ctdb->tunable.election_timeout, 0), 
 						ctdb_election_timeout, rec);
 
-	ret = send_election_request(rec, pnn, true);
+	ret = send_election_request(rec, pnn);
 	if (ret!=0) {
 		DEBUG(DEBUG_ERR, (__location__ " failed to initiate recmaster election"));
 		return;


-- 
CTDB repository


More information about the samba-cvs mailing list