ctdb-daemon: Do not update the VNN state on RELEASE_IP failure
authorMartin Schwenke <martin@meltin.net>
Sat, 30 Jul 2016 01:12:19 +0000 (11:12 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 17 Aug 2016 21:00:26 +0000 (23:00 +0200)
If RELEASE_IP fails then updating the VNN makes it inconsistent with
reality.  Instead, log the failure and move on to the next IP
address.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12158

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index 1e337a4c29a32a858f5e1c49081af9d7b7d093e4..40e457c97c3be3ff5ce12b2f61f62e9b59863a31 100644 (file)
@@ -2147,9 +2147,21 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
                                    ctdb_vnn_iface_string(vnn)));
 
                ctdb_event_script_args(ctdb, CTDB_EVENT_RELEASE_IP, "%s %s %u",
-                                 ctdb_vnn_iface_string(vnn),
-                                 ctdb_addr_to_str(&vnn->public_address),
-                                 vnn->public_netmask_bits);
+                                      ctdb_vnn_iface_string(vnn),
+                                      ctdb_addr_to_str(&vnn->public_address),
+                                      vnn->public_netmask_bits);
+               /* releaseip timeouts are converted to success, so to
+                * detect failures just check if the IP address is
+                * still there...
+                */
+               if (ctdb_sys_have_ip(&vnn->public_address)) {
+                       DEBUG(DEBUG_ERR,
+                             (__location__
+                              " IP address %s not released\n",
+                              ctdb_addr_to_str(&vnn->public_address)));
+                       vnn->update_in_flight = false;
+                       continue;
+               }
 
                data.dptr = (uint8_t *)talloc_strdup(
                                vnn, ctdb_addr_to_str(&vnn->public_address));