summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-09-09 12:13:11 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-09-19 12:54:30 +1000
commit701c450e901170b7ba69d85294b748d5ebde31db (patch)
tree56b53004fdf6ac0826b35498fb672f74b5a98228 /ctdb
parente167e2e7c702a70ce45f8293e1b274849bce9ca8 (diff)
downloadsamba-701c450e901170b7ba69d85294b748d5ebde31db.tar.gz
samba-701c450e901170b7ba69d85294b748d5ebde31db.tar.xz
samba-701c450e901170b7ba69d85294b748d5ebde31db.zip
recoverd: Fail takeover run if "ipreallocated" fails
Previously flagging a failure was probably avoided because of attempts to run "ipreallocated" events on stopped and banned nodes, which would fail because they are in recovery. Given the change to a new control and that fallback only retries the old method on active nodes, this should never fail in reasonable circumstances. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 53722430ad35f80935aabd12fa07654126443b8b)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_takeover.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index c3513ad0a6..15619f3e90 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -2668,7 +2668,7 @@ static void takeover_run_fail_callback(struct ctdb_context *ctdb,
int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
client_async_callback fail_callback, void *callback_data)
{
- int i, j;
+ int i, j, ret;
struct ctdb_public_ip ip;
struct ctdb_public_ipv4 ipv4;
uint32_t *nodes;
@@ -2858,12 +2858,12 @@ ipreallocated:
iprealloc_data.nodemap = nodemap;
nodes = list_of_connected_nodes(ctdb, nodemap, tmp_ctx, true);
- if (ctdb_client_async_control(ctdb, CTDB_CONTROL_IPREALLOCATED,
- nodes, 0, TAKEOVER_TIMEOUT(),
- false, tdb_null,
- NULL, iprealloc_fail_callback,
- &iprealloc_data) != 0) {
-
+ ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_IPREALLOCATED,
+ nodes, 0, TAKEOVER_TIMEOUT(),
+ false, tdb_null,
+ NULL, iprealloc_fail_callback,
+ &iprealloc_data);
+ if (ret != 0) {
/* If the control failed then we should retry to any
* nodes flagged by iprealloc_fail_callback using the
* EVENTSCRIPT control. This is a best-effort at
@@ -2888,18 +2888,19 @@ ipreallocated:
data.dptr = discard_const("ipreallocated");
data.dsize = strlen((char *)data.dptr) + 1;
- if (ctdb_client_async_control(ctdb,
- CTDB_CONTROL_RUN_EVENTSCRIPTS,
- nodes, 0, TAKEOVER_TIMEOUT(),
- false, data,
- NULL, fail_callback,
- callback_data) != 0) {
+ ret = ctdb_client_async_control(ctdb,
+ CTDB_CONTROL_RUN_EVENTSCRIPTS,
+ nodes, 0, TAKEOVER_TIMEOUT(),
+ false, data,
+ NULL, fail_callback,
+ callback_data);
+ if (ret != 0) {
DEBUG(DEBUG_ERR, (__location__ " failed to send control to run eventscripts with \"ipreallocated\"\n"));
}
}
talloc_free(tmp_ctx);
- return 0;
+ return ret;
}