ctdb-recoverd: Use update_flags_on_all_nodes()
authorMartin Schwenke <martin@meltin.net>
Fri, 14 Jun 2019 21:20:19 +0000 (07:20 +1000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 25 Aug 2020 13:57:27 +0000 (13:57 +0000)
This is clearer than using the MODFLAGS control directly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 915d24ac12d27c21649d9e64d201d9df9d583129)

ctdb/server/ctdb_recoverd.c

index 027c57717d49a2b6c2a7fa9ce47829e9d0ac8495..53952e2fe96c41c20c4e1d93cd98a5cfe50ea19d 100644 (file)
@@ -533,19 +533,13 @@ static int update_local_flags(struct ctdb_recoverd *rec, struct ctdb_node_map_ol
                remote_flags = remote_nodemap->nodes[j].flags;
 
                if (local_flags != remote_flags) {
-                       /* We should tell our daemon about this so it
-                          updates its flags or else we will log the same 
-                          message again in the next iteration of recovery.
-                          Since we are the recovery master we can just as
-                          well update the flags on all nodes.
-                       */
-                       ret = ctdb_ctrl_modflags(ctdb,
-                                                CONTROL_TIMEOUT(),
-                                                nodemap->nodes[j].pnn,
-                                                remote_flags,
-                                                ~remote_flags);
+                       ret = update_flags_on_all_nodes(rec,
+                                                       nodemap->nodes[j].pnn,
+                                                       remote_flags);
                        if (ret != 0) {
-                               DEBUG(DEBUG_ERR, (__location__ " Unable to update nodeflags on remote nodes\n"));
+                               DBG_ERR(
+                                   "Unable to update flags on remote nodes\n");
+                               talloc_free(mem_ctx);
                                return -1;
                        }