int ctdb_set_single_public_ip(struct ctdb_context *ctdb, const char *iface,
const char *ip);
-int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
- struct ctdb_node_map_old *nodemap);
int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t *force_rebalance_nodes,
client_async_callback fail_callback, void *callback_data);
goto fail;
}
- /* Fetch known/available public IPs from each active node */
- ret = ctdb_reload_remote_public_ips(ctdb, nodemap);
- if (ret != 0) {
- rec->need_takeover_run = true;
- goto fail;
- }
-
do_takeover_run(rec, nodemap, false);
/* execute the "recovered" event script on all nodes */
current = rec->reallocate_requests;
rec->reallocate_requests = NULL;
- /* update the list of public ips that a node can handle for
- all connected nodes
- */
- ret = ctdb_reload_remote_public_ips(ctdb, rec->nodemap);
- if (ret != 0) {
- rec->need_takeover_run = true;
- }
- if (ret == 0) {
- if (do_takeover_run(rec, rec->nodemap, false)) {
- ret = ctdb_get_pnn(ctdb);
- } else {
- ret = -1;
- }
+ if (do_takeover_run(rec, rec->nodemap, false)) {
+ ret = ctdb_get_pnn(ctdb);
+ } else {
+ ret = -1;
}
result.dsize = sizeof(int32_t);
/* we might need to change who has what IP assigned */
if (rec->need_takeover_run) {
- /* update the list of public ips that a node can handle for
- all connected nodes
- */
- ret = ctdb_reload_remote_public_ips(ctdb, nodemap);
- if (ret != 0) {
- return;
- }
-
/* If takeover run fails, then the offending nodes are
* assigned ban culprit counts. And we re-try takeover.
* If takeover run fails repeatedly, the node would get
struct ctdb_public_ip_list_old *ips,
uint32_t pnn);
-int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
- struct ctdb_node_map_old *nodemap)
+static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
+ struct ctdb_node_map_old *nodemap)
{
int j;
int ret;
return -1;
}
+ /* Fetch known/available public IPs from each active node */
+ ret = ctdb_reload_remote_public_ips(ctdb, nodemap);
+ if (ret != 0) {
+ talloc_free(tmp_ctx);
+ return -1;
+ }
+
/* Short-circuit IP allocation if no nodes are in the RUNNING
* runstate yet, since no nodes will be able to host IPs */
can_host_ips = false;