From 62c4a841d2cda9e96f70e00ed1c84908f69c3675 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 29 Jul 2009 09:58:40 +1000 Subject: [PATCH] When processing the stop node control reply in the client code we should also check the returned status code in case the _stop() command failed due to the eventscripts failing. If this happens, make "ctdb stop" log an error to the console and try the operation again. (This used to be ctdb commit 20e82e0c48e07d1012549f5277f1f5a3f4bd10d1) --- ctdb/client/ctdb_client.c | 5 +++-- ctdb/tools/ctdb.c | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 7062fa703b5..38893568848 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -3714,10 +3714,11 @@ int ctdb_ctrl_setreclock(struct ctdb_context *ctdb, struct timeval timeout, uint int ctdb_ctrl_stop_node(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode) { int ret; + int32_t res; ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_STOP_NODE, 0, tdb_null, - ctdb, NULL, NULL, &timeout, NULL); - if (ret != 0) { + ctdb, NULL, &res, &timeout, NULL); + if (ret != 0 || res != 0) { DEBUG(DEBUG_ERR,("Failed to stop node\n")); return -1; } diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 4c74da7976f..d576fd41cfe 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -1679,8 +1679,7 @@ static int control_stop(struct ctdb_context *ctdb, int argc, const char **argv) do { ret = ctdb_ctrl_stop_node(ctdb, TIMELIMIT(), options.pnn); if (ret != 0) { - DEBUG(DEBUG_ERR, ("Unable to stop node %u\n", options.pnn)); - return ret; + DEBUG(DEBUG_ERR, ("Unable to stop node %u try again\n", options.pnn)); } sleep(1);