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 07:47:05 +0000 (17:47 +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>
(cherry picked from commit 38304f88e0c634e97d4687c25adef975f71537b8)

server/ctdb_recoverd.c

index fe6b2381dc692ee5995bd6b9b474069707baa0d8..ad91614c18cef84dc18cf71dd4f83d6ff685a053 100644 (file)
@@ -143,6 +143,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);