[SCM] CTDB repository - branch master updated - ctdb-1.0.114-78-g26793ad

Ronnie Sahlberg sahlberg at samba.org
Wed May 5 17:45:33 MDT 2010


The branch, master has been updated
       via  26793ad42b77c2328a00ac9a12bca813c7425245 (commit)
      from  4a679422dc231aa98605b9cc322e4ab442f7bde4 (commit)

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


- Log -----------------------------------------------------------------
commit 26793ad42b77c2328a00ac9a12bca813c7425245
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu May 6 09:33:08 2010 +1000

    when performing a recovery,
    ensure that all nodes use the same reclock file setting as the recovery master

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

Summary of changes:
 server/ctdb_recoverd.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index 3ee607e..c0d5b17 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -1302,6 +1302,41 @@ static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
 	return 0;
 }
 
+/* when we start a recovery, make sure all nodes use the same reclock file
+   setting
+*/
+static int sync_recovery_lock_file_across_cluster(struct ctdb_recoverd *rec)
+{
+	struct ctdb_context *ctdb = rec->ctdb;
+	TALLOC_CTX *tmp_ctx = talloc_new(NULL);
+	TDB_DATA data;
+	uint32_t *nodes;
+
+	if (ctdb->recovery_lock_file == NULL) {
+		data.dptr  = NULL;
+		data.dsize = 0;
+	} else {
+		data.dsize = strlen(ctdb->recovery_lock_file) + 1;
+		data.dptr  = (uint8_t *)ctdb->recovery_lock_file;
+	}
+
+	nodes = list_of_active_nodes(ctdb, rec->nodemap, tmp_ctx, true);
+	if (ctdb_client_async_control(ctdb, CTDB_CONTROL_SET_RECLOCK_FILE,
+					nodes, 0,
+					CONTROL_TIMEOUT(),
+					false, data,
+					NULL, NULL,
+					rec) != 0) {
+		DEBUG(DEBUG_ERR, (__location__ " Failed to sync reclock file settings\n"));
+		talloc_free(tmp_ctx);
+		return -1;
+	}
+
+	talloc_free(tmp_ctx);
+	return 0;
+}
+
+
 /*
   we are the recmaster, and recovery is needed - start a recovery run
  */
@@ -1388,6 +1423,11 @@ static int do_recovery(struct ctdb_recoverd *rec,
 	DEBUG(DEBUG_NOTICE, (__location__ " Recovery - updated db priority for all databases\n"));
 
 
+	/* update all other nodes to use the same setting for reclock files
+	   as the local recovery master.
+	*/
+	sync_recovery_lock_file_across_cluster(rec);
+
 	/* set recovery mode to active on all nodes */
 	ret = set_recovery_mode(ctdb, rec, nodemap, CTDB_RECOVERY_ACTIVE);
 	if (ret != 0) {


-- 
CTDB repository


More information about the samba-cvs mailing list