[SCM] CTDB repository - branch master updated - ff413beb4bb31e277e843235a1ce5e5ad7b92c71

Ronnie Sahlberg sahlberg at samba.org
Wed Aug 13 23:58:10 GMT 2008


The branch, master has been updated
       via  ff413beb4bb31e277e843235a1ce5e5ad7b92c71 (commit)
      from  0674b33a7492cc1a194833f5ca87d8b30457faee (commit)

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


- Log -----------------------------------------------------------------
commit ff413beb4bb31e277e843235a1ce5e5ad7b92c71
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Aug 14 09:52:23 2008 +1000

    only freeze the local node when doing a backup and not the entire cluster

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

Summary of changes:
 tools/ctdb.c |   31 +++++++------------------------
 1 files changed, 7 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tools/ctdb.c b/tools/ctdb.c
index 7d8cf84..9ebc852 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1799,12 +1799,10 @@ static int control_backupdb(struct ctdb_context *ctdb, int argc, const char **ar
 {
 	int i, ret;
 	struct ctdb_dbid_map *dbmap=NULL;
-	struct ctdb_node_map *nodemap=NULL;
 	TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
 	TDB_DATA outdata;
 	struct db_file_header dbhdr;
 	int fh;
-	uint32_t *nodes;
 
 	if (argc != 2) {
 		DEBUG(DEBUG_ERR,("Invalid arguments\n"));
@@ -1833,21 +1831,10 @@ static int control_backupdb(struct ctdb_context *ctdb, int argc, const char **ar
 		return -1;
 	}
 
-	ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn, ctdb, &nodemap);
+	/* freeze the node */
+	ret = ctdb_ctrl_freeze(ctdb, TIMELIMIT(), options.pnn);
 	if (ret != 0) {
-		DEBUG(DEBUG_ERR, ("Unable to get nodemap from node %u\n", options.pnn));
-		talloc_free(tmp_ctx);
-		return ret;
-	}
-
-	/* freeze all nodes */
-	nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true);
-	if (ctdb_client_async_control(ctdb, CTDB_CONTROL_FREEZE,
-					nodes, TIMELIMIT(),
-					false, tdb_null,
-					NULL, NULL,
-					NULL) != 0) {
-		DEBUG(DEBUG_ERR, ("Unable to freeze nodes.\n"));
+		DEBUG(DEBUG_ERR, ("Unable to freeze node\n"));
 		ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE);
 		talloc_free(tmp_ctx);
 		return -1;
@@ -1863,14 +1850,10 @@ static int control_backupdb(struct ctdb_context *ctdb, int argc, const char **ar
 		return -1;
 	}
 
-	/* thaw all nodes */
-	nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true);
-	if (ctdb_client_async_control(ctdb, CTDB_CONTROL_THAW,
-					nodes, TIMELIMIT(),
-					false, tdb_null,
-					NULL, NULL,
-					NULL) != 0) {
-		DEBUG(DEBUG_ERR, ("Unable to thaw nodes.\n"));
+	/* thaw the node */
+	ret = ctdb_ctrl_thaw(ctdb, TIMELIMIT(), options.pnn);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, ("Unable to thaw node.\n"));
 		ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE);
 		talloc_free(tmp_ctx);
 		return -1;


-- 
CTDB repository


More information about the samba-cvs mailing list