ctdb-recoverd: Avoid nodemap-related checks when recoveries are disabled
authorMartin Schwenke <martin@meltin.net>
Fri, 6 Feb 2015 09:59:11 +0000 (20:59 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 7 Apr 2015 05:43:13 +0000 (07:43 +0200)
The potential resulting recovery won't run anyway.  Also recoveries
may have been disabled by "reloadnodes" and if the nodemaps are
inconsistent between nodes then avoid triggering an unnecessary
recovery.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 2f0521529fde14c67584dc3550f3c3ad9eb1a500..673075a01d2fcf782092c30f0beefafd4956fa10 100644 (file)
@@ -3737,6 +3737,14 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
                process_ipreallocate_requests(ctdb, rec);
        }
 
+       /* If recoveries are disabled then there is no use doing any
+        * nodemap or flags checks.  Recoveries might be disabled due
+        * to "reloadnodes", so doing these checks might cause an
+        * unnecessary recovery.  */
+       if (ctdb_op_is_disabled(rec->recovery)) {
+               return;
+       }
+
        /* get the nodemap for all active remote nodes
         */
        remote_nodemaps = talloc_array(mem_ctx, struct ctdb_node_map *, nodemap->num);