diff options
| author | Martin Schwenke <martin@meltin.net> | 2013-09-06 13:19:09 +1000 |
|---|---|---|
| committer | Amitay Isaacs <amitay@gmail.com> | 2013-09-19 12:54:32 +1000 |
| commit | c484361076d4fa9077e3e56811f791f073543c19 (patch) | |
| tree | de87418ee1f8e2f9aa2109be6ebb82a9cb2d8f82 | |
| parent | 44b7397962fd496aef506a568ece386f6b4179f3 (diff) | |
tools/ctdb: Make rebalancenode more robust
Use a broadcast instead of trying to win the race of determining the
recovery master and then sending the message before the recovery
master changes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ac946ee4ad01b1e5cd1006930b9f8a190a0a58ba)
| -rw-r--r-- | ctdb/tools/ctdb.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 9eecb690fe..a5553bdc40 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -1752,18 +1752,14 @@ static int control_moveip(struct ctdb_context *ctdb, int argc, const char **argv static int rebalance_node(struct ctdb_context *ctdb, uint32_t pnn) { - uint32_t recmaster; TDB_DATA data; - if (ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), pnn, &recmaster) != 0) { - DEBUG(DEBUG_ERR, ("Unable to get recmaster from node %u\n", pnn)); - return -1; - } - data.dptr = (uint8_t *)&pnn; data.dsize = sizeof(uint32_t); - if (ctdb_client_send_message(ctdb, recmaster, CTDB_SRVID_REBALANCE_NODE, data) != 0) { - DEBUG(DEBUG_ERR,("Failed to send message to force node reallocation\n")); + if (ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_REBALANCE_NODE, data) != 0) { + DEBUG(DEBUG_ERR, + ("Failed to send message to force node %u to be a rebalancing target\n", + pnn)); return -1; } |
