[SCM] CTDB repository - branch master updated - ctdb-1.0.113-76-gf4eb41c
Ronnie Sahlberg
sahlberg at samba.org
Mon Feb 8 20:28:19 MST 2010
The branch, master has been updated
via f4eb41cd3a1099da8265351818fba9bd4688a188 (commit)
from 627a6d67a0e9e61f8713e62695b3518c51909230 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f4eb41cd3a1099da8265351818fba9bd4688a188
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Feb 9 14:35:10 2010 +1100
dont just exit(0) upon successful completion of waiting for an ipreallocate to finish.
return success back to the caller instead.
otherwise things like 'ctdb enable -n all' will just finish after the first disabled node has become enabled.
-----------------------------------------------------------------------
Summary of changes:
tools/ctdb.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/tools/ctdb.c b/tools/ctdb.c
index 1c760d4..dbc8b47 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1939,13 +1939,15 @@ static int control_getpid(struct ctdb_context *ctdb, int argc, const char **argv
return 0;
}
+static uint32_t ipreallocate_finished;
+
/*
handler for receiving the response to ipreallocate
*/
static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid,
TDB_DATA data, void *private_data)
{
- exit(0);
+ ipreallocate_finished = 1;
}
static void ctdb_every_second(struct event_context *ev, struct timed_event *te, struct timeval t, void *p)
@@ -2056,6 +2058,7 @@ again:
goto again;
}
+ ipreallocate_finished = 0;
ret = ctdb_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
if (ret != 0) {
DEBUG(DEBUG_ERR,("Failed to send ip takeover run request message to %u\n", options.pnn));
@@ -2067,6 +2070,9 @@ again:
while (timeval_elapsed(&tv) < 3.0) {
event_loop_once(ctdb->ev);
}
+ if (ipreallocate_finished == 1) {
+ return 0;
+ }
DEBUG(DEBUG_INFO,("Timed out waiting for recmaster ipreallocate. Trying again\n"));
retries++;
@@ -2129,6 +2135,7 @@ static int control_enable(struct ctdb_context *ctdb, int argc, const char **argv
struct ctdb_node_map *nodemap=NULL;
+
/* check if the node is already enabled */
if (ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, ctdb, &nodemap) != 0) {
DEBUG(DEBUG_ERR, ("Unable to get nodemap from local node\n"));
@@ -2155,6 +2162,7 @@ static int control_enable(struct ctdb_context *ctdb, int argc, const char **argv
}
} while (nodemap->nodes[options.pnn].flags & NODE_FLAGS_PERMANENTLY_DISABLED);
+
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