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)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:53 +0000 (13:35 +0200)
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>
(cherry picked from commit 38304f88e0c634e97d4687c25adef975f71537b8)

server/ctdb_recoverd.c

index c8c26f19b95f888265752ad260ec95b91fdbb8f9..ae6bbd006153834ec9a1875a68e44b062c51fac8 100644 (file)
@@ -141,6 +141,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);