ctdb-recoverd: Drop explicit check to flag takeover run needed
authorMartin Schwenke <martin@meltin.net>
Tue, 3 May 2016 01:52:48 +0000 (11:52 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 13 May 2016 11:47:17 +0000 (13:47 +0200)
The recovery daemon should be less involved in the service monitoring
logic.

The cases handled here are already handled elsewhere:

* When a node becomes unhealthy/healthy the monitoring code will
  trigger a takeover run

* When a node is disabled/enabled the ctdb CLI tool will trigger a
  takeover run

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

index ba57028a6617be308b4487280c531cfa6d1967b9..4df57c5b79a2949864eac06501a241fbbe0e1632 100644 (file)
@@ -2814,7 +2814,6 @@ static void monitor_handler(uint64_t srvid, TDB_DATA data, void *private_data)
        struct ctdb_node_map_old *nodemap=NULL;
        TALLOC_CTX *tmp_ctx;
        int i;
-       int disabled_flag_changed;
 
        if (data.dsize != sizeof(*c)) {
                DEBUG(DEBUG_ERR,(__location__ "Invalid data in ctdb_node_flag_change\n"));
@@ -2846,28 +2845,8 @@ static void monitor_handler(uint64_t srvid, TDB_DATA data, void *private_data)
                DEBUG(DEBUG_NOTICE,("Node %u has changed flags - now 0x%x  was 0x%x\n", c->pnn, c->new_flags, c->old_flags));
        }
 
-       disabled_flag_changed =  (nodemap->nodes[i].flags ^ c->new_flags) & NODE_FLAGS_DISABLED;
-
        nodemap->nodes[i].flags = c->new_flags;
 
-       ret = ctdb_ctrl_getrecmode(ctdb, tmp_ctx, CONTROL_TIMEOUT(),
-                                  CTDB_CURRENT_NODE, &ctdb->recovery_mode);
-
-       if (ret == 0 &&
-           rec->recmaster == ctdb->pnn &&
-           ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
-               /* Only do the takeover run if the perm disabled or unhealthy
-                  flags changed since these will cause an ip failover but not
-                  a recovery.
-                  If the node became disconnected or banned this will also
-                  lead to an ip address failover but that is handled 
-                  during recovery
-               */
-               if (disabled_flag_changed) {
-                       rec->need_takeover_run = true;
-               }
-       }
-
        talloc_free(tmp_ctx);
 }