recoverd: Ignore failed ipreallocated controls to inactive nodes master
authorMartin Schwenke <martin@meltin.net>
Tue, 26 Nov 2013 01:35:44 +0000 (12:35 +1100)
committerMartin Schwenke <martin@meltin.net>
Mon, 9 Dec 2013 05:15:15 +0000 (16:15 +1100)
Currently timeouts for controls to inactive nodes can cause banning
credits to be applied.  This should not happen.

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdb_takeover.c

index 04cdd6668d3a3fe7f19d5c250ad313e699606ed5..f5d20fe71b82b4026b2bbc8aaf7ff2324021a380 100644 (file)
@@ -2555,6 +2555,23 @@ static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
        struct iprealloc_callback_data *cd =
                (struct iprealloc_callback_data *)callback;
 
+       numnodes = talloc_array_length(cd->retry_nodes);
+       if (pnn > numnodes) {
+               DEBUG(DEBUG_ERR,
+                     ("ipreallocated failure from node %d, "
+                      "but only %d nodes in nodemap\n",
+                      pnn, numnodes));
+               return;
+       }
+
+       /* Can't run the "ipreallocated" event on a INACTIVE node */
+       if (cd->nodemap->nodes[pnn].flags & NODE_FLAGS_INACTIVE) {
+               DEBUG(DEBUG_WARNING,
+                     ("ipreallocated failed on inactive node %d, ignoring\n",
+                      pnn));
+               return;
+       }
+
        switch (res) {
        case -ETIME:
                /* If the control timed out then that's a real error,
@@ -2571,23 +2588,6 @@ static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
                 * because the error codes are all folded down to -1.
                 * Consider retrying using EVENTSCRIPT control...
                 */
-
-               numnodes = talloc_array_length(cd->retry_nodes);
-               if (pnn > numnodes) {
-                       DEBUG(DEBUG_ERR,
-                             ("ipreallocated failure from node %d, but only %d nodes in nodemap\n",
-                              pnn, numnodes));
-                       return;
-               }
-
-               /* Can't run the "ipreallocated" event on a INACTIVE node */
-               if (cd->nodemap->nodes[pnn].flags & NODE_FLAGS_INACTIVE) {
-                       DEBUG(DEBUG_ERR,
-                             ("ipreallocated failure from node %d, but node is inactive - not flagging a retry\n",
-                              pnn));
-                       return;
-               }
-
                DEBUG(DEBUG_WARNING,
                      ("ipreallocated failure from node %d, flagging retry\n",
                       pnn));