summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-01-18 16:19:36 +1100
committerStefan Metzmacher <metze@samba.org>2020-08-27 10:48:08 +0000
commit772dfb02d45d61115e6c242e6fd9fd26b3a14efc (patch)
treeffa8754905f41cbec4a085809ecea2e2cc7f0578 /ctdb
parent3261adfc84ffa68ffb5549eebefc36fdc52b2b40 (diff)
downloadsamba-772dfb02d45d61115e6c242e6fd9fd26b3a14efc.tar.gz
ctdb-recoverd: Basic cleanups for get_remote_nodemaps()
Don't log an error on failure - let the caller can do this. Apart from this: fix up coding style and modernise the remaining error message. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 52f520d39cd92e1cf2413fd7e0dd362debd6f463)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_recoverd.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 3f72619127a..41f029e6bca 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -2223,38 +2223,45 @@ done:
}
-static void async_getnodemap_callback(struct ctdb_context *ctdb, uint32_t node_pnn, int32_t res, TDB_DATA outdata, void *callback_data)
+static void async_getnodemap_callback(struct ctdb_context *ctdb,
+ uint32_t node_pnn,
+ int32_t res,
+ TDB_DATA outdata,
+ void *callback_data)
{
struct ctdb_node_map_old **remote_nodemaps = callback_data;
if (node_pnn >= ctdb->num_nodes) {
- DEBUG(DEBUG_ERR,(__location__ " pnn from invalid node\n"));
+ DBG_ERR("Invalid PNN\n");
return;
}
- remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal(remote_nodemaps, outdata.dptr);
+ remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal(
+ remote_nodemaps, outdata.dptr);
}
-static int get_remote_nodemaps(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
- struct ctdb_node_map_old *nodemap,
- struct ctdb_node_map_old **remote_nodemaps)
+static int get_remote_nodemaps(struct ctdb_context *ctdb,
+ TALLOC_CTX *mem_ctx,
+ struct ctdb_node_map_old *nodemap,
+ struct ctdb_node_map_old **remote_nodemaps)
{
uint32_t *nodes;
+ int ret;
nodes = list_of_active_nodes(ctdb, nodemap, mem_ctx, true);
- if (ctdb_client_async_control(ctdb, CTDB_CONTROL_GET_NODEMAP,
- nodes, 0,
- CONTROL_TIMEOUT(), false, tdb_null,
+
+ ret = ctdb_client_async_control(ctdb,
+ CTDB_CONTROL_GET_NODEMAP,
+ nodes,
+ 0,
+ CONTROL_TIMEOUT(),
+ false,
+ tdb_null,
async_getnodemap_callback,
NULL,
- remote_nodemaps) != 0) {
- DEBUG(DEBUG_ERR, (__location__ " Unable to pull all remote nodemaps\n"));
-
- return -1;
- }
-
- return 0;
+ remote_nodemaps);
+ return ret;
}
static bool validate_recovery_master(struct ctdb_recoverd *rec,