commands that relate to manual failover of ip addresses (moveip)
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 9 Feb 2010 07:34:47 +0000 (18:34 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 9 Feb 2010 07:34:47 +0000 (18:34 +1100)
can sometimes take long so allow for a longer timeout for the controls used.

tools/ctdb.c

index dbc8b47b13d85bda8f64269b1170aaf19de9214d..406b86a66bf53f825947975abacade917ae5a513 100644 (file)
@@ -45,6 +45,7 @@ static struct {
 } options;
 
 #define TIMELIMIT() timeval_current_ofs(options.timelimit, 0)
+#define LONGTIMELIMIT() timeval_current_ofs(options.timelimit*10, 0)
 
 #ifdef CTDB_VERS
 static int control_version(struct ctdb_context *ctdb, int argc, const char **argv)
@@ -996,7 +997,6 @@ static int control_get_tickles(struct ctdb_context *ctdb, int argc, const char *
 }
 
 
-
 static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn)
 {
        struct ctdb_all_public_ips *ips;
@@ -1055,7 +1055,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
                nodes = list_of_active_nodes_except_pnn(ctdb, nodemap, tmp_ctx, pnn);
        ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_RELEASE_IP,
                                        nodes, 0,
-                                       TIMELIMIT(),
+                                       LONGTIMELIMIT(),
                                        false, data,
                                        NULL, NULL,
                                        NULL);
@@ -1065,7 +1065,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
                return -1;
        }
 
-       ret = ctdb_ctrl_takeover_ip(ctdb, TIMELIMIT(), pnn, &ip);
+       ret = ctdb_ctrl_takeover_ip(ctdb, LONGTIMELIMIT(), pnn, &ip);
        if (ret != 0) {
                DEBUG(DEBUG_ERR,("Failed to take over IP on node %d\n", pnn));
                talloc_free(tmp_ctx);