[SCM] CTDB repository - branch master updated - ctdb-2.2-12-gc48583f

Amitay Isaacs amitay at samba.org
Wed Jun 19 20:55:44 MDT 2013


The branch, master has been updated
       via  c48583fd238496a81ddc46a21892f0b49559036a (commit)
      from  5f8547b1531bba4950b3d873a997585c3a16d31e (commit)

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


- Log -----------------------------------------------------------------
commit c48583fd238496a81ddc46a21892f0b49559036a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jun 18 14:27:34 2013 +1000

    tools/ctdb: Do not exit prematurely on control timeout if retrying in a loop
    
    This avoids premature exits from "ctdb stop" and "ctdb continue" due to
    intermittent control (e.g. getpnn, getnodemap) timeouts.
    
    This needs a proper fix to distinguish between timeout and failure
    conditions and take appropriate action.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

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

Summary of changes:
 tools/ctdb.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tools/ctdb.c b/tools/ctdb.c
index b3cbade..e73cbfd 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1986,7 +1986,8 @@ again:
 	/* get the number of nodes and node flags */
 	if (ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn, ctdb, &nodemap) != 0) {
 		DEBUG(DEBUG_ERR, ("Unable to get nodemap from local node\n"));
-		return -1;
+		sleep(1);
+		goto again;
 	}
 
 	ipreallocate_finished = false;
@@ -2879,10 +2880,9 @@ static int control_stop(struct ctdb_context *ctdb, int argc, const char **argv)
 		/* read the nodemap and verify the change took effect */
 		if (ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, ctdb, &nodemap) != 0) {
 			DEBUG(DEBUG_ERR, ("Unable to get nodemap from local node\n"));
-			exit(10);
 		}
 
-	} while (!(nodemap->nodes[options.pnn].flags & NODE_FLAGS_STOPPED));
+	} while (nodemap == NULL || !(nodemap->nodes[options.pnn].flags & NODE_FLAGS_STOPPED));
 	ret = control_ipreallocate(ctdb, argc, argv);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR, ("IP Reallocate failed on node %u\n", options.pnn));
@@ -2913,10 +2913,9 @@ static int control_continue(struct ctdb_context *ctdb, int argc, const char **ar
 		/* read the nodemap and verify the change took effect */
 		if (ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, ctdb, &nodemap) != 0) {
 			DEBUG(DEBUG_ERR, ("Unable to get nodemap from local node\n"));
-			exit(10);
 		}
 
-	} while (nodemap->nodes[options.pnn].flags & NODE_FLAGS_STOPPED);
+	} while (nodemap == NULL || nodemap->nodes[options.pnn].flags & NODE_FLAGS_STOPPED);
 	ret = control_ipreallocate(ctdb, argc, argv);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR, ("IP Reallocate failed on node %u\n", options.pnn));


-- 
CTDB repository


More information about the samba-cvs mailing list