ctdbd: Log warnings in release IP when unexpected interface is encountered
authorMartin Schwenke <martin@meltin.net>
Mon, 24 Jun 2013 05:49:48 +0000 (15:49 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 5 Jul 2013 05:52:32 +0000 (15:52 +1000)
Previous code changes work around a potential problems but do not
provide useful information when the a problem occurs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

server/ctdb_takeover.c

index 401a8f30d874d1678625eb8e9f16bd5a5090fba4..f8fb4fdd8cfc31d1f85930c09d4df377778ec5f2 100644 (file)
@@ -977,6 +977,21 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
                        DEBUG(DEBUG_ERR, ("Could not find which interface the ip address is hosted on. can not release it\n"));
                        return 0;
                }
+               if (vnn->iface == NULL) {
+                       DEBUG(DEBUG_WARNING,
+                             ("Public IP %s is hosted on interface %s but we have no VNN\n",
+                              ctdb_addr_to_str(&pip->addr),
+                              iface));
+               } else if (strcmp(iface, ctdb_vnn_iface_string(vnn)) != 0) {
+                       DEBUG(DEBUG_WARNING,
+                             ("Public IP %s is hosted on inteterface %s but VNN says %s\n",
+                              ctdb_addr_to_str(&pip->addr),
+                              iface,
+                              ctdb_vnn_iface_string(vnn)));
+                       /* Should we fix vnn->iface?  If we do, what
+                        * happens to reference counts?
+                        */
+               }
        } else {
                iface = strdup(ctdb_vnn_iface_string(vnn));
        }