recoverd: Do not set banning credits on a node if current node is inactive
authorAmitay Isaacs <amitay@gmail.com>
Fri, 28 Jun 2013 04:10:47 +0000 (14:10 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 02:59:09 +0000 (12:59 +1000)
If the current node is banned or stopped, then it should not assign banning
credits to other nodes since the current node will not have up-to-date flags
of other nodes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
server/ctdb_recoverd.c

index c15a140b28f929c231db14229768999f39ca201b..be2451b604add318b0d3956d5b645c50c90f8616 100644 (file)
@@ -120,6 +120,12 @@ static void ctdb_set_culprit_count(struct ctdb_recoverd *rec, uint32_t culprit,
                return;
        }
 
+       /* If we are banned or stopped, do not set other nodes as culprits */
+       if (rec->node_flags & NODE_FLAGS_INACTIVE) {
+               DEBUG(DEBUG_NOTICE, ("This node is INACTIVE, cannot set culprit node %d\n", culprit));
+               return;
+       }
+
        if (ctdb->nodes[culprit]->ban_state == NULL) {
                ctdb->nodes[culprit]->ban_state = talloc_zero(ctdb->nodes[culprit], struct ctdb_banning_state);
                CTDB_NO_MEMORY_VOID(ctdb, ctdb->nodes[culprit]->ban_state);