struct remote_nodemaps_state {
struct ctdb_node_map_old **remote_nodemaps;
+ struct ctdb_recoverd *rec;
};
static void async_getnodemap_callback(struct ctdb_context *ctdb,
}
+static void async_getnodemap_error(struct ctdb_context *ctdb,
+ uint32_t node_pnn,
+ int32_t res,
+ TDB_DATA outdata,
+ void *callback_data)
+{
+ struct remote_nodemaps_state *state =
+ (struct remote_nodemaps_state *)callback_data;
+ struct ctdb_recoverd *rec = state->rec;
+
+ DBG_ERR("Failed to retrieve nodemap from node %u\n", node_pnn);
+ ctdb_set_culprit(rec, node_pnn);
+}
+
static int get_remote_nodemaps(struct ctdb_recoverd *rec,
TALLOC_CTX *mem_ctx,
struct ctdb_node_map_old ***remote_nodemaps)
nodes = list_of_active_nodes(ctdb, rec->nodemap, mem_ctx, true);
state.remote_nodemaps = t;
+ state.rec = rec;
ret = ctdb_client_async_control(ctdb,
CTDB_CONTROL_GET_NODEMAP,
false,
tdb_null,
async_getnodemap_callback,
- NULL,
+ async_getnodemap_error,
&state);
talloc_free(nodes);
continue;
}
- if (remote_nodemaps[j] == NULL) {
- DEBUG(DEBUG_ERR,(__location__ " Did not get a remote nodemap for node %d, restarting monitoring\n", j));
- ctdb_set_culprit(rec, j);
-
- return;
- }
-
/* if the nodes disagree on how many nodes there are
then this is a good reason to try recovery
*/